dhcp failover with isc dhcpd

3/31/2013 - http:_www.madboa.com/geek/dhcp-failover/

dhcp failover with isc dhcpd for high-availability

* network  : 192.168.0.0
* pool     : 192.168.0.100 - 192.168.0.150
* primary  : 192.168.0.1
* secondary: 192.168.0.2

# # /etc/dhcpd.conf - primary #

authoritative; ddns-update-style none;

failover peer "failover" { primary; address 192.168.0.1; port 647; peer address 192.168.0.2; peer port 647; max-response-delay 30; max-unacked-updates 10; load balance max seconds 3; mclt 1800; split 128; }

subnet 192.168.0.0 netmask 255.255.255.0 { option subnet-mask 255.255.255.0; option broadcast-address 192.168.0.255; option routers 192.168.0.1; pool { failover peer "failover"; max-lease-time 1800; # 30 minutes range 192.168.0.100 192.168.0.150; } }

#
# /etc/dhcpd.conf - secondary
#

authoritative;
ddns-update-style none;

failover peer "failover" {
  secondary; # declare this to be the secondary server
  address 192.168.0.2;
  port 647;
  peer address 192.168.0.1;
  peer port 647;
  max-response-delay 30;
  max-unacked-updates 10;
  load balance max seconds 3;
}

subnet 192.168.0.0 netmask 255.255.255.0 {
  option subnet-mask 255.255.255.0;
  option broadcast-address 192.168.0.255;
  option routers 192.168.0.1;
  pool {
    failover peer "failover";
    max-lease-time 1800; # 30 minutes
    range 192.168.0.100 192.168.0.150;
  }
}