• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 960
  • Last Modified:

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.
0
HBS-Mach
Asked:
HBS-Mach
  • 5
  • 3
  • 2
  • +1
3 Solutions
 
Mal OsborneAlpha GeekCommented:
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.
0
 
HBS-MachAuthor Commented:
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.
0
 
Jeffrey Kane - TechSoEasyPrincipal ConsultantCommented:
You can add the registry key to apply to ALL Adapters if you instead create it on this key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

Then you won't have to know the specific interface.
0
How do you know if your security is working?

Protecting your business doesn’t have to mean sifting through endless alerts and notifications. With WatchGuard Total Security Suite, you can feel confident that your business is secure, meaning you can get back to the things that have been sitting on your to-do list.

 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
... and as the cited text tells, the adapter-specific setting doesn't work anyway with W7 (and probably W10 either).
The setting might result in issues with WLAN on mobile devices changing their network location often. Something like the WLAN interface not detecting location changes properly, and keeping wrong IP addresses.
0
 
HBS-MachAuthor Commented:
@Jeffery,
Thanks, I will give this a go.
Its been the weekend, so will have to wait until people come into the remote office.
0
 
HBS-MachAuthor Commented:
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.
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
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.
0
 
Jeffrey Kane - TechSoEasyPrincipal ConsultantCommented:
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?
0
 
HBS-MachAuthor Commented:
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.
0
 
Jeffrey Kane - TechSoEasyPrincipal ConsultantCommented:
If your gateway device goes offline, then everything will be inaccessible on your network.  That's the nature of what a Gateway does.

If you can't access the NAS to change it to a static IP, then you should follow this article to to reset the Admin password to get access:
http://kb.netgear.com/app/answers/detail/a_id/22784/~/how-do-i-recover-a-lost-administrator-password-on-my-readynas-os-6-storage
0
 
HBS-MachAuthor Commented:
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!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Network Scalability - Handle Complex Environments

Monitor your entire network from a single platform. Free 30 Day Trial Now!

  • 5
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now