Share via


How to turn off Last-Known IP address for DHCP testing?

Question

Monday, May 30, 2016 3:42 AM

When a Windows system sends a DHCPDiscover packet, it includes the option 50 request for a specific IP address.  If that address is available, DHCP grants it.  Therefore, a client gets the same IP address every time.  This makes network testing difficult.  One work-around is to set up a virtual machine so that it boots up, newly fresh every time, as if it never before had an IP address.  As you can imagine, this requires an extreme amount of time and resources for 20 student workstations.

My goal is to find out where Windows stores its last-known IP address so the lease can be deleted.  This information is not in the registry where a normal search can find it.  Deleting the existing DHCP info does not help.  Some how, Windows remembers its last-known address and requests it with each DHCP request. 

BTW, this information is also useful for effectively creating a client-side DHCP reservation with an ISP or other DHCP server that is out of your control.  In my case, I need to prep the workstations of my students so that the Cisco lesson will work as Cisco planned.  Your help is welcome.  Thank you.

Cloud Production

All replies (3)

Monday, May 30, 2016 2:40 PM ✅Answered

How to force Windows 7 to ask for a “fresh” IP address from DHCP server?

Has some interesting related info. The marked answer suggests the info is stored in a portion of the registry that is cached while the network subsystem is running.

Lower down a suggestion, from an admin command prompt;

ipconfig /release
net stop dhcp
net start dhcp
ipconfig /renew

Results in no Option 50 being sent when I had a look Did need top stop the WW3 service I had running and has perhaps left Windows a bit confused as it reports no internet access now (but there is I am typing this). So have a look at that see if that can do what you want.


Monday, May 30, 2016 3:17 PM ✅Answered

The reuse of the previous IP address is deeply buried into the system. Short answer: Change the MAC address of the network card.

Also read this:

http://superuser.com/questions/470585/how-to-force-windows-7-to-ask-for-a-fresh-ip-address-from-dhcp-server

Best regards, George


Tuesday, May 31, 2016 2:35 AM ✅Answered

Hi Rain Dance,

"Therefore, a client gets the same IP address every time"
First of all, this behavior is by design for dhcp protocol and it is not decided by Microsoft.

If you want to test with different IP address every time, there are two options.
1.Exclude the all assigned IP addresses from the DHCP server. As for configuring the DHCP, it is recommended to ask for help from our Server forum.
2.Delete the IP address registry key from the client.
The IP address configuration is located here.
HKEY_LOCAL_MACHINE\SYSTEM \CurrentControlSet \Services \Tcpip\Parameters\Interfaces

I hope my clarification will be useful.

Best regards

Please mark the reply as an answer if you find it is helpful.

If you have feedback for TechNet Support, contact [email protected]