Monday, March 25, 2013

netsh & editing dhcp scopes for subnet mask changes

for fsck's sake.  my subnet mask that i'm handing out on my ms server 2008 dns server does not match reality.
not at all.

well.  ms says delete and re-create.  please no.

my server has name:  invernonuclear (192.168.1.2)
my old scope is:  192.168.1.0/255.255.255.0 "poi"
my scope is: 192.168.1.0/255.255.240.0 "poi"

run an administrative cmd shell.  then...


c:\>netsh dhcp server \\invernonuclear scope 192.168.1.0 dump>c:\dhcp.txt

then, open the saves file and edit it to suit.  in my case:

Dhcp Server 192.168.1.2 add scope 192.168.1.0 255.255.240.0 "poi" "poi"

save. delete old scope and then import...

C:\>netsh exec c:\dhcp.txt

now.  if you are silly, you might have dhcp scopes sacked really really close.  you change your mask and try to run the above.
whoops!  error.  stay in your netmask bounds.

now if you're being fancy dancy, you'll need to create superscopes.

No comments: