DHCP Failover and dhcpd.leases

Randall C Grimshaw rgrimsha at syr.edu
Fri Apr 13 20:32:33 UTC 2012

we have two techniques in play to monitor pool usage based on syslog
in one report we tabulate leases granted
in another we monitor the lts counts as the peers balance their pools - this is very accurate
    $pattern = "/^(.+) (.+):(.+):(.+) (.+) dhcpd: pool (.+) (.+) total (.+) free (.+) backup (.+) lts (.+)$/";
    if( preg_match( $pattern, $line, $matches ) ) {
      $month = $matches[0]; $day = $matches[1]; $hr = $matches[2]; $min = $matches[3]; $sec = $matches[4]; $srv = $matches[5];
      $pool = $matches[6]; $netname = $matches[7]; $total = $matches[8]; $free = $matches[9]; $backup = $matches[10]; $lts = $match
      //   a problem with ISC DHCP is that pool id can be dynamic so only the larger pools (>10) can be monitored
      if( $total > 10 && ( $free + $backup < 3 || ( ( $free + $backup ) / $total ) * 100 < 3 ) ) {
        // SEND AN ALERT //

Randall Grimshaw rgrimsha at syr.edu
From: dhcp-users-bounces+rgrimsha=syr.edu at lists.isc.org [dhcp-users-bounces+rgrimsha=syr.edu at lists.isc.org] on behalf of John Wobus [jw354 at cornell.edu]
Sent: Friday, April 13, 2012 4:07 PM
To: Users of ISC DHCP
Subject: Re: DHCP Failover and dhcpd.leases

> I’m currently using a single DHCP server from which I periodically
> sync the dhcpd.leases file to a second backup DHCP where the deamon
> is not started. That’s my cold standby failover.
> Now I want to use the ISC-DHCPs build-in failover system which I
> already successfully configured and tested in a testing environment.
> My question is, what happens to the leases database when the server
> is in failover mode?
> Are all leases written to the file on both server peers or only
> those which were handed out by the failover peer? Clearly, do both
> servers have the same leases file?
> I built some software around the leases database an so I rely on
> having all active leases in it.
> Another question is, if I change my running config on the productive
> server to do ISC failover, how does this affect already given out
> leases? Are they simply synced to the secondary peer?

Each server sends info about the leases it grants
to the peer server so the peer server can add it to
its lease file.  This communication is done
asynchronously, i.e., though servers wait
for their own lease file update to finish
before sending the ACK, they do NOT make
the ACK wait until the info is on the peer
server's disk.

We periodically scan the leases file to tell
us about pool usage, basically to warn us
of full pools and to give us data to help
make adjustments. We scan only one lease
file, and just keep in mind that our
results aren't watertight, just very

John Wobus
Cornell IT
dhcp-users mailing list
dhcp-users at lists.isc.org

More information about the dhcp-users mailing list