Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
    
Which dchp server and version are you running? Restarting the server might work, sending the server a kill -HUP might work also. –  msw Nov 16 '10 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. –  Ptolemy Nov 21 '10 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 Mar 19 '12 at 18:43
add comment

2 Answers 2

up vote 4 down vote accepted

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)

share|improve this answer
    
thank you for this. your solution seems to be closest to what i had in mind. –  ankit Nov 21 '10 at 3:17
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.