If the lease files are lost what would be the solution?

Simon Hobson dhcp1 at thehobsons.co.uk
Thu Apr 26 07:51:58 UTC 2007


S Kalyanasundaram wrote:

>The leases are stored in dhcpd.leases and backup is at 
>dhcpd.leases~. For some reason these files are lost and dont have 
>any kind of backup of them and again server got stopped. Say some 
>hardware fault have come. We will have to restart the dhcpd server 
>without the lease database.
>
>Does anyone faced this kind of situation. What would be the good 
>suggestion for recovering this problem.
>
>The problem is, the existing client go for renewal and may be get a 
>new IP address which breaks his (connection, download or whatever). 
>The other case would be new clients have come up and ask for an IP 
>and the server check for a free IP but which is already available 
>and mark as abandon and give some new IP to the new client. When the 
>original client goes for renewal of the IP but that is already 
>marked as abandon. So after that i guess it will get a new IP 
>address.


Best option is not to lose the file in the first place :-)

Second best, and really your only option, is to simply start with a 
new file. As clients come to renew they will normally get the same 
address. When each client renews, it will ask for a lease on the 
address it already has, and as long as this is 'free' and allowed to 
the client then the server will give it.

If the server tries to allocate an address to a new client (or one 
that doesn't keep it's address) then the 'ping before offer' may 
prevent the address being issued (but many clients now block pings in 
their firewall). If the server offer an address that is in use but 
not yet renewed, then most clients should decline the offer (after 
using ARP to see if it's free), and the server should make a new 
offer - with the process repeating until the client gets an offer 
that is acceptable.

It's possible that you may need to clean out a few abandoned leases 
when it's all settled down.


More information about the dhcp-users mailing list