Monday, March 31, 2014

How to change the subnet mask of DHCP scope windows server

You can’t change the subnet mask of the DHCP scope directly without deleting the scope, need to delete the DHCP scope first then recreate the scope with new subnet, but this will lead to largeamount of manual work

To avoid the manual work use the below netsh command toChange the subnet mask in existing DHCP scope with the simple steps

Use the below command to export the scope configuration

Syntex:

C:\>netsh dhcp server \\”Server name” scope “scope subnet” dump>c:\dhcp.txt

Example:

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

To change the subnet mask of the scope

Open the dhcp.txt file and change the subnet mask, dhcp.txt fileresemble the following


Changed the current scope context to 192.168.1.0 scope.

Dhcp Server 192.168.1.24 add scope 192.168.1.0 255.255.255.0 "Vlan-1" "Vlan-1"
Dhcp Server 192.168.1.24 Scope 192.168.1.0 set state 1


Edit the file and save

After this, delete the scope and run the below command to create the scope from the txt file 

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

This will automatically create the DHCP scope with the new subnet mask

This way you can change other configuration details along with subnet mask change, like IP range and Excluderanges

No comments:

How to use Telus Actionec T3200M as a wireless Access point

when you install Telus Internet, they will offer you a modem + router + wireless device Actionec T3200M, a lot of users still want to use th...