Solved

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

Posted on 2016-07-14
11
135 Views
Last Modified: 2016-07-24
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
Comment
Question by:HBS-Mach
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 16

Expert Comment

by:Malmensa
ID: 41711737
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
 
LVL 1

Author Comment

by:HBS-Mach
ID: 41711746
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
 
LVL 74

Accepted Solution

by:
Jeffrey Kane - TechSoEasy earned 400 total points
ID: 41711760
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
 
LVL 68

Assisted Solution

by:Qlemo
Qlemo earned 100 total points
ID: 41711781
... 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
 
LVL 1

Author Comment

by:HBS-Mach
ID: 41716125
@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
Are your corporate email signatures appalling?

Is it scary how unprofessional your email signatures look? Do users create their own terrible designs and give themselves stupid job titles? You can make this a lot easier for yourself by choosing an email signature management solution from Exclaimer today.

 
LVL 1

Author Comment

by:HBS-Mach
ID: 41720012
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
 
LVL 68

Expert Comment

by:Qlemo
ID: 41720311
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
 
LVL 74

Expert Comment

by:Jeffrey Kane - TechSoEasy
ID: 41721967
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
 
LVL 1

Author Comment

by:HBS-Mach
ID: 41722041
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
 
LVL 74

Assisted Solution

by:Jeffrey Kane - TechSoEasy
Jeffrey Kane - TechSoEasy earned 400 total points
ID: 41724244
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
 
LVL 1

Author Closing Comment

by:HBS-Mach
ID: 41726848
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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Resolve DNS query failed errors for Exchange
Is your computer hacked? learn how to detect and delete malware in your PC
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now