10

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?

3
  • Which dchp server and version are you running? Restarting the server might work, sending the server a kill -HUP might work also.
    – msw
    Commented Nov 16, 2010 at 4:38
  • Imagine what chaos would occur if a DHCP server forgot its leases over a reboot. you could potentially end up with the same IP address being assigned to two different computers. Commented Nov 21, 2010 at 1:54
  • The above comment is not accurate for all implementations. The standard DHCPd service on Linux does a ping to the next IP it wants to offer to ensure that there is no collision.
    – Magellan
    Commented Mar 19, 2012 at 18:43

2 Answers 2

5

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)

1
  • thank you for this. your solution seems to be closest to what i had in mind.
    – ankit
    Commented Nov 21, 2010 at 3:17
2

You might want to lower your default-lease-time and max-lease-time in dhcpd.conf. This should force your clients to obtain a new lease once the time expires.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .