A computer loses its DHCP IP address if a DHCP server is not available
Posted on 2016-07-14
I have a wide spread network, which has unreliable connections.
For management purposes, a centralised DHCP server is used.
This is to monitor the PCs that are on the network and to use a DHCP DENY method of controlling rogue devices.
When a remote PC is rebooted and the local gateway is unavailable, the DORA method in Windows means that the PC will look for a new lease regardless of how long the lease has left.
From a tech article i read:
Restarting a Windows 7 or 2008 R2 DHCP client:
If the client had a current lease prior to the restart, upon restart, it will attempt the RA sequence. If a DHCP server doesn't respond with an ACK, it then attempts to ping the gateway address from it's previous configuration to see if the IP config it previously had is on the same network.
If the gateway responds, it will keep it's current lease for the remainder of the lease and continues on with the 50% and the 87.5% rule of the RA sequence.
If the gateway doesn't respond, the RA sequence kicks in, it releases its current configuration, and starts a fresh DORA sequence,
Now the issue i have is that sometimes the gateway will not respond.
So the PC's restart the DORA process and get a 169.xxx address.
But i want the local subnet to continue to have the same IP, so they can print, access local resources etc.
I could setup an Alternate Configuration IP Address, but there is a few hundred machines that this could affect over multiple subnets, so that doesnt scale out.
An alternate solution Ive found is from a Microsoft Support Article (Article ID: 958336)
To resolve this issue, add a registry value to force the client to keep its DHCP IP address, even if a DHCP server is not available. To add this value, follow these steps:
1.Start Registry Editor. To do this, click Start, type regedit in the Start Search box, and then press Enter.
2.To activate the setting for all adapters, locate the following registry subkey:
(Windows Vista only) To activate this setting for a specific adapter, locate the adapter-specific registry key:
3.On the Edit menu, point to New, and then click DWORD Value.
4.Type DontPingGateway, and then press Enter.
5.On the Edit menu, click Modify.
6.In the Value data box, type 1, and then click OK.
7.Exit Registry Editor.
8.Restart the computer.
This procedure forces the client to keep its DHCP IP address even if a DHCP server is not available. If you use the Alternate Configuration tab to modify the IP address for an adapter, this IP address is assigned to the adapter.
Note In Windows 7, the new registry value is not obeyed if you try to set it for a specific adapter in the following subkey:
Which again will resolve the issue. But changing the registry manually doesnt scale out.
The solution is to use Group Policy to force the "DontPingGateway" registry key to all the remote PCs.
However, i cant see how i can get the ADAPTER setting which is a different GUID for each adapter.
Potentially, i would need to adjust both wired and wireless adapters.
The majority of PCs are Windows 10, but there are some Windows 7 machines as well.
So i would like to see how I can get a Group Policy to allow the addition of DontPingGateway=1 registry setting on all active network adapters.
I guess I also need to understand if this would have any other effects that I dont know about.