HA DHCP

High Availability DHCP services

DHCP services can be set up to be highly available across two servers. The servers in the example below are 10.10.0.10 and 10.10.0.11. It requires two files: /etc/dhcpd.conf and /etc/dhcpd.master. The dhcpd.conf file must be modified for each peer, the dhcpd.master is identical for both servers.

dhcpd.conf 10.10.0.10
# Global Options
option domain-name "example.com";
option domain-name-servers 10.10.0.10,10.10.0.11;
option tftp-server-name "10.10.0.10";
option time-servers 10.10.0.10,10.10.0.11;
option ntp-servers 10.10.0.10,10.10.0.11;
option time-offset -25200;
default-lease-time 86400;
ddns-update-style interim;
max-lease-time 86400;
authoritative;
ddns-update-style  none;
option sip-servers-name code 120 = text;

failover peer "dhcp" {
  primary;
  address 10.10.0.10;
  port 520;
  peer address 10.10.0.11;
  peer port 521;
  max-response-delay 60;
  max-unacked-updates 10;
  mclt 600;
  split 128;
  load balance max seconds 3;
}
include "/etc/dhcpd.master";
dhcpd.conf 10.10.0.11
# Global Options
option domain-name "example.com";
option domain-name-servers 10.10.0.10,10.10.0.11;
option tftp-server-name "10.10.0.10";
option time-servers 10.10.0.10,10.10.0.11;
option ntp-servers 10.10.0.10,10.10.0.11;
option time-offset -25200;
default-lease-time 86400;
ddns-update-style interim;
max-lease-time 86400;
authoritative;
ddns-update-style  none;
option sip-servers-name code 120 = text;

failover peer "dhcp" {
  secondary;
  address 10.10.0.11;
  port 521;
  peer address 10.10.0.10;
  peer port 520;
  max-response-delay 60;
  max-unacked-updates 10;
  load balance max seconds 3;
}
include "/etc/dhcpd.master";
dhcpd.master both servers
# Global Options
option domain-name "example.com";
option domain-name-servers 10.10.0.10,10.10.0.11;
option tftp-server-name "10.10.0.10";
option time-servers 10.10.0.10,10.10.0.11;
option ntp-servers 10.10.0.10,10.10.0.11;
option time-offset -25200;
default-lease-time 86400;
ddns-update-style interim;
max-lease-time 86400;
authoritative;
ddns-update-style  none;
option sip-servers-name code 120 = text;

subnet 10.10.0.10 netmask 255.255.255.0 {

}


# eth1 - SALES
#
subnet 10.10.1.0 netmask 255.255.255.0 {
  pool {
   failover peer "dhcp";
   range                     10.10.1.2  10.10.1.254;
   deny dynamic bootp clients;
   default-lease-time           43200;
   max-lease-time               43200;
   option routers               10.10.1.1;
   option subnet-mask           255.255.255.0;
   option domain-name           "example.com";
   option tftp-server-name      "10.10.1.10";
   option sip-servers-name      "sipx1.example.com:12000/cmcprov/login";
   option domain-name-servers   10.10.0.10;
   option ntp-servers           10.10.0.10;
        group {
        next-server sipx1.example.com;                # TFTP serve
                host information_systems_fxs_1 {
                        hardware ethernet 00:00:00:00:00:00;
                        fixed-address 10.10.1.16;
                }
        }
  }
}