DHCP client stubbornly sticks to old reservation.

mxnerd

Diamond Member
Jul 6, 2007
6,799
1,103
126
I have a workstation previously i assigned 10.1.1.5 as its reserved IP through Win2003 DHCP.

Now I deleted old reservation from DHCP server and created a new reseration with IP address 10.1.1.6, rebooted the client workstation several times, even restarted DHCP server, remove the host name/IP from DNS server,...

Yet, the client workstation is stubbornly getting 10.1.1.5 from the DHCP server. What's wrong and why is this happening?

 

mcmilljb

Platinum Member
May 17, 2005
2,144
2
81
Try forcing it to renew by doing a "ipconfig /release" and then a "ipconfig /renew"
 

spidey07

No Lifer
Aug 4, 2000
65,469
5
76
Yep, it still thinks it's old reservation is valid and according to the DHCP server and lease time it probably is. a release and renew should do it.
 

mxnerd

Diamond Member
Jul 6, 2007
6,799
1,103
126
Thanks guys, that did the trick! I did it before several times but since haven't use it for a while and forgot there is such command.

But I'm still scratching my head why other methods does not work. Oh well.


 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Originally posted by: mxnerd
Thanks guys, that did the trick! I did it before several times but since haven't use it for a while and forgot there is such command.

But I'm still scratching my head why other methods does not work. Oh well.

The client computer still thinks it's lease is valid so it won't attempt to renew it.
 

spidey07

No Lifer
Aug 4, 2000
65,469
5
76
When a client request an address from a DHCP server the server gives it an address and a lease time. From the server and client's perspective the lease is good for the specified lease time no matter what, unless the address is released. So when you restarted the computer the lease was still good as the lease time hadn't expired.
 

mxnerd

Diamond Member
Jul 6, 2007
6,799
1,103
126

When a client request an address from a DHCP server the server gives it an address and a lease time. From the server and client's perspective the lease is good for the specified lease time no matter what, unless the address is released. So when you restarted the computer the lease was still good as the lease time hadn't expired.
Yes, I know the basic theory. I set the lease time as 2 days (Microsoft set it 8 days as default)

However, I deleted the old resevation from DHCP server and confirmed that old IP is not in the address leases.

So is somehow the old resevation info is still inside DHCP server buffer/memory even after i restarted the DHCP server?
 

spidey07

No Lifer
Aug 4, 2000
65,469
5
76
Of course it is. The lease was still good. The server can't communicate to the client "gimme that address back!". It can only do that when the client attempts a renew with a NACK.
 

mcmilljb

Platinum Member
May 17, 2005
2,144
2
81
Originally posted by: spidey07
Of course it is. The lease was still good. The server can't communicate to the client "gimme that address back!". It can only do that when the client attempts a renew with a NACK.

And just to add to this. Since the computer still thinks the lease is good, it will not talk to the dhcp server until it wants to renew. I think I read that Windows does its first attempt when the lease is half expired. When it tries to renew the lease before it expires, that's when it learns about it. Plus since the lease is good to the client, it just keeps on using the ip address like nothing is wrong.

This is why protecting against rogue dhcp attacks is very important. It's a bitch to get dhcp fixed when they have wrong information, and you have to physically go to the computer and release the dhcp lease.
 

mxnerd

Diamond Member
Jul 6, 2007
6,799
1,103
126
Thanks for the info.

The other method I forgot to mention is that I tried using "repair" option from network properties did not work either.

I did this IP renew remotely via VNC and I was afraid that the client won't renew its IP so I created a batch file on the remote computer to do "ipconfig /release" & "ipconfig /renew" in one shot. And it did work perfectly.

Thanks again.

 

seepy83

Platinum Member
Nov 12, 2003
2,132
3
71
I was always under the impression that a computer reboot or even the network cable being disconnected/reconnected would cause the client to release its lease.

Can someone clarify this for me?

For example: I have a lease on my laptop from my Work network that is valid for 3 more days. I shutdown my laptop, bring it home, and connect it to my Home network. My laptop isn't going to try to use the lease from my Work network...it's going to pull an address from my DHCP Server at home.

How does the client know it has changed networks and needs to get a new lease?
 

dphantom

Diamond Member
Jan 14, 2005
4,763
327
126
Originally posted by: seepy83
I was always under the impression that a computer reboot or even the network cable being disconnected/reconnected would cause the client to release its lease.

Can someone clarify this for me?

For example: I have a lease on my laptop from my Work network that is valid for 3 more days. I shutdown my laptop, bring it home, and connect it to my Home network. My laptop isn't going to try to use the lease from my Work network...it's going to pull an address from my DHCP Server at home.

How does the client know it has changed networks and needs to get a new lease?

Because it sends out a request. If it sees the work DHCP and you already have a lease that has not expired, you won't get a new IP. If you're at home, then when the PC sends its request, it sees a new DHCP server and the DHCP server will fulfill the request for an IP.
 

James Bond

Diamond Member
Jan 21, 2005
6,023
0
0
Originally posted by: seepy83
I was always under the impression that a computer reboot or even the network cable being disconnected/reconnected would cause the client to release its lease.

Can someone clarify this for me?

For example: I have a lease on my laptop from my Work network that is valid for 3 more days. I shutdown my laptop, bring it home, and connect it to my Home network. My laptop isn't going to try to use the lease from my Work network...it's going to pull an address from my DHCP Server at home.

How does the client know it has changed networks and needs to get a new lease?

This was answered in the post above mine, but to reiterate:
The old lease that he had (10.1.1.5) was technically still valid after a reboot, even by the server.

When you take your computer home, the new DHCP server it is contacting doesn't recognize an active lease and dishes out a new one.

Spidey, correct me if I'm wrong on that.