5

On our DHCP server, the lease time is currently set to infinite.

I want to switch it over to 8 days, but from what i understand the clients do not do a DHCP renew if they have infinite lease.

Will a machine do the whole DHCP handshake even if it has an infinite lease?

MDMarra
  • 100,734
  • 32
  • 197
  • 329
Bruno
  • 53
  • 1
  • 3

4 Answers4

11

I don't agree with the accepted answer.

A DHCP client that has an ip address for which the lease has not yet expired or is not in the renewal phase does not go through the DORA process upon reboot. The DHCP client will request to continue using it's currently leased ip address. Furthermore, a DHCP client attempting to renew it's currently leased ip address does not go through the DORA process. If that's what you and Mallik are referring to when you mention "DHCP handshake", then that's wrong.

Although I've never seen the scenario you describe I'm assuming that the DHCP client would get the new ip address lease time upon reboot when it recieves the ACK from the server to it's request to continue using the currently leased ip address.

For a client that doesn't currently have a an ip address the DHCP process is as such:

D = Discover O = Offer R = Request A = Acknowledge

For a client that currently has a valid ip address for which the lease has not yet expired the process is as such:

R = Request (to continue using the currently leased ip address) A = Acknowledge

joeqwerty
  • 109,901
  • 6
  • 81
  • 172
  • I would say that depends on the client. If the OS is started first, before IP is setup and the client does cache its DHCP-lease on disk, and the client is configured to use that cache, then you are right. – Nils Mar 02 '12 at 21:50
  • Most (nearly all?) clients will perform a release as part of their interface downing routine. So rebooting or downing the interface *should* work. Unless infinite is a special case, I've never actually seen it used. – Scott Pack Mar 04 '12 at 13:24
  • Windows clients don't release their ip address on a reboot or a power off. Furthermore, If they did what would be the purpose of the lease time, whether it was 1 minute or 1 year? – joeqwerty Mar 04 '12 at 14:36
3

When computer boots up, it does the whole DHCP handshake. And when half the lease time expires, the DHCP client requests for renewing the ip address. And at the end of the lease time, it requests again and if fails, it restarts the entire DHCP cycle and sees if any new servers respond to its DHCP request.

And if the lease time is infinite, and if the DHCP client does not go down, it does not have to renew, but if it has gone down for some time and booted up, it restarts the DHCP handshake.

So, to answer your question, yes, it does the whole DHCP handshake with the server to get ip address after booting.

Mallik
  • 144
  • 3
2

Booting the computer will to a DHCP refresh. If you don't want to reboot, you can bounce the network interface, or explicitly ask the PC to refresh.

duffbeer703
  • 20,797
  • 4
  • 31
  • 39
0

A Windows DHCP Client with an infinite lease will still release it by default on shutdown, so at boot it will do the handshake.

Windows clients release their DHCP lease at shutdown based on 2 things.

  1. did they get an option 2 from the DHCP server that tells them to?
  2. Does the registry override what is set in option 2?

By default, option 2 in DHCP is not set, and when it is not set, windows defaults to releasing the DHCP lease on shutdown.
Even if it is set, Option 2 can be overridden by setting the DWORD ReleaseOnShutdown to 0, which is under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces{interface-id-here}

Other possible values are:

  1. Always release the lease
  2. Release or leave the lease depending on option 2 from the Server