Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2016-07-14
11
Medium Priority
?
602 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 19

Expert Comment

by:Mal Osborne
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 1600 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
When ransomware hits your clients, what do you do?

MSPs: Endpoint security isn’t enough to prevent ransomware.
As the impact and severity of crypto ransomware attacks has grown, Webroot has fought back, not just by building a next-gen endpoint solution capable of preventing ransomware attacks but also by being a thought leader.

 
LVL 71

Assisted Solution

by:Qlemo
Qlemo earned 400 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
 
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 71

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 1600 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
In this article, WatchGuard's Director of Security Strategy and Research Teri Radichel, takes a look at insider threats, the risk they can pose to your organization, and the best ways to defend against them.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

636 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