If you run out of available IP addresses on a Windows Server DHCP scope devices on the LAN will fail to obtain an IP address and will not be able to connect to the network.
A short-term fix for this is to decrease the DHCP lease time. It generally starts at 8 hours and can be reduced to recycle IP addresses back into the lease pool.
A long-term fix for this is to increase the size of the DHCP scope. This will increase the number of available IP addresses.
A typical DHCP scope will have the following:
- An address pool, which specifies what IP addresses are available to be handed out. The address pool is typically like this:
- 192.168.0.1 through 192.168.0.254 or
- 192.168.1.1 through 192.168.1.254 or
- 10.0.0.1 through 10.0.3.254
- A exclusion list, which marks one or more IP addreses in the range as unavailable to be handed out. This is useful if you have devices - printers and the like - that have a static IP address set which cannot be handed out to any other device
- One or more DHCP reservations, which ensure a DHCP device on the network always has the same IP address
- A subnet mask, which tells a device whether to send network traffic to a peer on the same network or to send it via the router
- The router IP address
- The DNS server(s) IP address(es) for resolving domain names to IP addresses
The simplest way to expand the scope is to delete it and create a new one to replace it with a larger range of available IP addresses. This is the best solution if you don't have a large number of reservations and customisations on the DHCP scope. If you do have a large number of DHCP customisations it's better to export the DHCP scope, amend it externally, then delete the scope on the server and re-import the amended scope. Here's how to to it:
- Take a backup of the DHCP scope. Open command prompt as Administrator and do the following:
netsh dhcp server \\”Server name” scope “scope subnet” dump>c\:dhcp.txt
i.e.
netsh dhcp server \\Server-DC01 scope 10.0.0.0 dump >c:\dhcp.txt - Open the c:zdhcp.txt file with a text editor and change the IP range AND THE SUBNET MASK
192.168.0.1 to 192.168.0.254 will have a subnet mask of 255.255.255.0 with 254 available addresses
192.168.0.1 to 192.168.3.254 will have a subnet mask of 255.255.252.0 with 1,000 available addresses. This is what the exported scop will look like:
Dhcp Server \\SRV01.ACMECORP.local add scope 192.168.0.0 255.255.255.0 "SteinerScope" ""
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 set state 1
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 set delayoffer 0
# ======================================================================
# Start Add Ipranges to the Scope 192.168.0.0, Server SRV01.ACMECORP.local
# ======================================================================
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 Add iprange 192.168.0.1 192.168.0.254
Dhcp Server \\SRV01.ACMECORP.local scope 192.168.0.0 set napstate Off
# ======================================================================
# End Add Ipranges to the Scope 192.168.0.0, Server SRV01.ACMECORP.local
# ======================================================================
# ======================================================================
# Start Add Excluderanges to the Scope : 192.168.0.0, Server : SRV01.ACMECORP.local
# ======================================================================
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 add excluderange 192.168.0.52 192.168.0.52
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 add excluderange 192.168.0.63 192.168.0.63
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 add excluderange 192.168.0.1 192.168.0.29
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 add excluderange 192.168.0.44 192.168.0.44
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 add excluderange 192.168.0.200 192.168.0.254
# ======================================================================
# End Add Excluderanges to the Scope : 192.168.0.0, Server : SRV01.ACMECORP.local
# ======================================================================
# ======================================================================
# Start Add OptionValues to the Scope : 192.168.0.0, Server : SRV01.ACMECORP.local
# ======================================================================
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 set optionvalue 51 DWORD "7200"
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 set optionvalue 3 IPADDRESS "192.168.0.1"
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 set optionvalue 15 STRING "ACMECORP.local"
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 set optionvalue 6 IPADDRESS "192.168.0.254"
# ======================================================================
# End Add OptionValues to the Scope : 192.168.0.0, Server : SRV01.ACMECORP.local
# ======================================================================
# ======================================================================
# Start Add ReservedIp to the Scope : 192.168.0.0, Server : SRV01.ACMECORP.local
# ======================================================================
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 Add reservedip 192.168.0.45 fc15b4336f52 "NPI336F52.ACMECORP.local" "Main Office Printer P3015" "BOTH"
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 Add reservedip 192.168.0.68 c4346b1736e8 "NPI1736E8.ACMECORP.local" "" "DHCP"
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 Add reservedip 192.168.0.149 b083febe1cd6 "DESKTOP-3MEJ7J3.ACMECORP.local" "Neil Tancock Desktop - DNS unfiltered" "DHCP"
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 set reservedoptionvalue 192.168.0.43 6 IPADDRESS "8.8.8.8" "8.8.4.4"
Dhcp Server \\SRV01.ACMECORP.local v4 Scope 192.168.0.0 Set NameProtection enable= 0
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 Set DnsConfig 1 0 1 0
# ======================================================================
# End Add ReservedIp to the Scope : 192.168.0.0, Server : SRV01.ACMECORP.local
# ====================================================================== - The new scope with have the IP address range and subnet mask changed. The changes are marked in green:
Dhcp Server \\SRV01.ACMECORP.local add scope 192.168.0.0 255.255.252.0 "SteinerScope" ""
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 set state 1
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 set delayoffer 0
# ======================================================================
# Start Add Ipranges to the Scope 192.168.0.0, Server SRV01.ACMECORP.local
# ======================================================================
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 Add iprange 192.168.0.1 192.168.3.254
Dhcp Server \\SRV01.ACMECORP.local scope 192.168.0.0 set napstate Off
# ======================================================================
# End Add Ipranges to the Scope 192.168.0.0, Server SRV01.ACMECORP.local
# ======================================================================
# ======================================================================
# Start Add Excluderanges to the Scope : 192.168.0.0, Server : SRV01.ACMECORP.local
# ======================================================================
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 add excluderange 192.168.0.52 192.168.0.52
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 add excluderange 192.168.0.63 192.168.0.63
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 add excluderange 192.168.0.1 192.168.0.29
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 add excluderange 192.168.0.44 192.168.0.44
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 add excluderange 192.168.0.200 192.168.0.254
# ======================================================================
# End Add Excluderanges to the Scope : 192.168.0.0, Server : SRV01.ACMECORP.local
# ======================================================================
# ======================================================================
# Start Add OptionValues to the Scope : 192.168.0.0, Server : SRV01.ACMECORP.local
# ======================================================================
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 set optionvalue 51 DWORD "7200"
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 set optionvalue 3 IPADDRESS "192.168.0.1"
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 set optionvalue 15 STRING "ACMECORP.local"
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 set optionvalue 6 IPADDRESS "192.168.0.254"
# ======================================================================
# End Add OptionValues to the Scope : 192.168.0.0, Server : SRV01.ACMECORP.local
# ======================================================================
# ======================================================================
# Start Add ReservedIp to the Scope : 192.168.0.0, Server : SRV01.ACMECORP.local
# ======================================================================
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 Add reservedip 192.168.0.45 fc15b4336f52 "NPI336F52.ACMECORP.local" "Main Office Printer P3015" "BOTH"
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 Add reservedip 192.168.0.68 c4346b1736e8 "NPI1736E8.ACMECORP.local" "" "DHCP"
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 Add reservedip 192.168.0.149 b083febe1cd6 "DESKTOP-3MEJ7J3.ACMECORP.local" "Neil Tancock Desktop - DNS unfiltered" "DHCP"
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 set reservedoptionvalue 192.168.0.43 6 IPADDRESS "8.8.8.8" "8.8.4.4"
Dhcp Server \\SRV01.ACMECORP.local v4 Scope 192.168.0.0 Set NameProtection enable= 0
Dhcp Server \\SRV01.ACMECORP.local Scope 192.168.0.0 Set DnsConfig 1 0 1 0
# ======================================================================
# End Add ReservedIp to the Scope : 192.168.0.0, Server : SRV01.ACMECORP.local
# ====================================================================== - Save the modified c:\dhcp.txt file as c:\newdhcp.txt
- Go back to the DHCP server and delete the scope completely
- Then go back to the Administrator command prompt and enter the following command:
netsh exec c:\newdhcp.txt -
This will import the DHCP scope with all your settings intact and will also increase the available
IP addresses and, critically, will change the subnet mask. You may need to restart the DHCP server
for the changes to take effect.
| Need help? Please get in touch! |
|
You can call us on 01752 422950, option 2 or, if you are on Number Club, just call extension 3000 You can email us at support@hellocomtec.com You can chat with us now at https://kite.wildix.com/nc-a12/3000 |

