Link to home
Start Free TrialLog in
Avatar of HBS-Mach
HBS-MachFlag for Solomon Islands

asked on

A computer loses its DHCP IP address if a DHCP server is not available

Hi,
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:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
(Windows Vista only) To activate this setting for a specific adapter, locate the adapter-specific registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\<Adapter>
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:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\<Adapter>


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.
Avatar of Mal Osborne
Mal Osborne
Flag of Australia image

Bit of as tangent I know, but you wouldn't have any switches with spanning tree protocol enabled by any chance? Standard STP blocks traffic for a while when a connected machine starts, often causing the problem you describe. Sometimes even if a DHCP server is up, clients fail to get a lease at boot time.

Try configuring RSTP or disabling it altogether.
Avatar of HBS-Mach

ASKER

Thanks Malmensa.
The issue is repeatable when we deliberately turn off the Gateway at the remote site and reboot a PC.
The PC then gets a 169.xxx address.
As soon as we turn the remote gateway back on, DHCP works as expected.
So I dont think STP is the problem.
ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Kane - TechSoEasy
Jeffrey Kane - TechSoEasy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@Jeffery,
Thanks, I will give this a go.
Its been the weekend, so will have to wait until people come into the remote office.
The addition of the registry key has worked for all adapters when using the key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
The PCs in question keep their IP Address.

However the NAS Box (a Netgear Ready NAS Duo RND2000) immediately drops off the network and is unaccessible when the gateway device is offline.
The NetGear NAS is a different cup of tea, because it (probably) runs a Linux. But it sounds very strange that the NAS should loose its IP, unless it is rebooted each day.
Maybe you are looking at correcting this issue the wrong way.  What are you using for your DHCP Server, and why does the local gateway keep going offline?
We are using a central windows DHCP server.
The local gateway relays the DHCP requests to it.
The gateway goes offline due to power issues (its run via a Generator) as well as the wifi radio link from one site (where the PC and NAS box is) to the other locally (where the gateway is) sometimes fails.

The Netgear NAS has a DHCP address, with a reservation.
We dont know its username/password and its been changed from default.

The Lease duration is set to 16 days, so the NAS box shouldnt need to renew its IP for 8 days.
I dont believe that the NAS box is being turned off.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the help.
The Registry setting allows the PCs to ensure that dont try to get a new IP everytime they boot.
The Netgear password issue will need to be resolved via the OS Re-Install method of password recovery.
Although it says you wont lose data, I will be ensuring there is a good backup beforehand!