WWW.PRL.DK
Linux and FreeBSD fun. > DHCP failover

DHCP failover


DHCP failover with the ISCdhcp server.

The two servers time must be absolute equal.
The versions of dhcpd must be equal.

LINK for more info :

ISC dhcp server homepage.


-----------

Now, let's get to work.

-----------
/etc/dhcpd.conf on the primary DHCP server :
failover peer "dhcpcluster" {
primary;
address 192.168.0.11;
port 647;
peer address 192.168.0.12;
peer port 647;
max-response-delay 60;
max-unacked-updates 10;
mclt 60;
split 128;
load balance max seconds 3;
}
server-identifier primary.example.com;
authoritative;
ddns-update-style none;
include "/etc/dhcpd.master";

---------
/etc/dhcpd.conf on the secondary DHCP server :
failover peer "dhcpcluster" {
secondary;
address 192.168.0.12;
port 647;
peer address 192.168.0.11;
peer port 647;
max-response-delay 60;
max-unacked-updates 10;
mclt 60;
load balance max seconds 3;
}
server-identifier secondary.example.com;
authoritative;
ddns-update-style none;
include "/etc/dhcpd.master";

----------

The /etc/dhcpd.master file for both machines :

subnet 192.168.0.0 netmask 255.255.255.0 {
pool {
failover peer "dhcpcluster";
range 192.168.0.50 192.168.0.200;
option domain-name-servers 192.168.0.2, 192.168.0.3;
option domain-name "example.com";
option routers 192.168.0.1;
option broadcast-address 192.168.0.255;
default-lease-time 6000;
max-lease-time 12000;
deny dynamic bootp clients;
}
}


Problems i have seen :

After a period it seems that both servers get unstable and claims that leases are owned by the other node and the result is that nobody gets an IP address.
The only way to get the servers up and running again seems to stop both dhcp daemons and delete the leases files, and then start the daemons again.
If you got a better solution i would like to hear it ;-)