Linux – Force dhcp client to get a new lease

dhcplinux

I have a linux DHCP server running on my network.
I recently found out that I can assign specific IP addresses to clients based
on their MAC address by modifying the dhcpd.conf file.

Now is there something I can do from the server side that would invalidate a
specific client's lease, forcing it to get a new one from the server (after I have added
entries in dhcpd.conf), without releasing/renewing on the client side?

Best Answer

The answer to this depends on how you previously configured the DHCP server.

Normal DHCP behaviour is this:

  1. Lease is given a lease time perhaps 7days.
  2. Client machine starts requesting a new lease half way through the current lease period.
  3. Client machine only stops using the IP address when it either gets a new lease from the same DHCP server or the lease has expired.

The consequence of this is that you need to start planning your network maintenance. When you are going to make a change that will require new IP settings, about "lease time" ahead, you need to reduce the lease time down to a more dynamic setting (e.g. 30 minutes).

that way changes in DHCP will be rolled out smoothly, and then when you are ready, you increase the lease time back to a more sensible value. Do not leave it at 30 minutes as it will mean that should the DHCP server fail, half your machines will be connectionless in 15 minutes.

You can force through a change in lease by asking everyone to reboot their computers (or for the more technically capable, releasing and then renewing their leases)

Related Question