Rebuilding Leases file from log file

Simon Hobson dhcp1 at thehobsons.co.uk
Tue Nov 27 21:30:18 UTC 2007


Larry Apolonio wrote:

>I know its not perfect but is it possible to send dhcp logs to a 
>remote syslog server and rebuild the dhcp leases file based on mac, 
>IP address was assigned, and time. I'd use the lease time in 
>dhcpd.conf to configure the amount of time.  Say the lease time was 
>1 day then
>
>Nov  9 12:24:32 dhcp-server dhcpd: DHCPACK on 10.10.126.164 to 
>00:00:00:00:22:95 via 192.168.0.4
>
>would become
>
>lease 10.10.126.164 {
>  starts 2 2007/11/09 12:24:32;
>  ends 4 2007/11/11 12:24:32;
>  tstp 4 2007/11/11 12:24:32;
>  binding state free;
>  hardware ethernet 00:00:00:00:22:95;
>}
>
>What bad mojo would I encounter?
>
>Basically would I be able to start up my spare server as the DHCP 
>server with the dhcpd.conf file using a leases file generated from 
>the syslog server?
>
>Now I can put the leases file in tmpfs or /dev/ram, syslog would be 
>off the DHCP server, and we would be using something more current 
>than an hourly rsync of the leases file.

Well a while ago Ted suggested something (for cable operators) along 
these lines. Run a DHCP server in the remote locations (ie closer to 
the customers), running OS & apps from flash/whatever (ie diskless) 
and leases in ramdisk. To make the leases persistent, run these in 
failover with a central server back at the NOC (which of course can 
have decent performance disks etc), but configured so that only the 
remote servers normally handle client requests.

If the remote server gets restarted for any reason (such as after a 
power cut), it will pull the leases from it's peer back in the NOC 
and carry on as normal.

Might this be easier to implement - it gives you a continuous live 
backup of the lease states ? Of course, your 'backup' can easily be 
made into a live server by putting it in partner down mode and when 
the primary comes back up the leases will be synced and things will 
revert to normal.


More information about the dhcp-users mailing list