Load Balanced DHCP Servers

Jan Hugo Prins jhp at jhprins.org
Mon Nov 6 15:15:37 UTC 2006


Hi,

I'm currently looking into the option of creating 2 loadbalanced DHCP 
servers for our production environment and I have setup a little test 
network. At first sight it looks as if everything works ok, but after 
checking some logs etc I run into some strange things:

The first thing I see is that in the RFC they are talking about several 
different states that either one of the servers can be in, and in the 
logs I only see about 3 different states and both server sometimes go 
from normal to normal etc. A little strange.

A little bit of my logs:

Nov  3 10:40:50 dhcp1 dhcpd: Internet Systems Consortium DHCP Server 
V3.0.3-RedHat
Nov  3 10:40:50 dhcp1 dhcpd: Copyright 2004-2005 Internet Systems 
Consortium.
Nov  3 10:40:50 dhcp1 dhcpd: All rights reserved.
Nov  3 10:40:50 dhcp1 dhcpd: For info, please visit 
http://www.isc.org/sw/dhcp/
Nov  3 10:40:50 dhcp1 dhcpd: Wrote 100 leases to leases file.
Nov  3 10:40:50 dhcp1 dhcpd: Listening on 
LPF/eth1/00:0c:29:18:cf:ed/192.168.102/24
Nov  3 10:40:50 dhcp1 dhcpd: Sending on   
LPF/eth1/00:0c:29:18:cf:ed/192.168.102/24
Nov  3 10:40:50 dhcp1 dhcpd: Sending on   Socket/fallback/fallback-net
Nov  3 10:40:51 dhcp1 dhcpd: failover peer dhcp: I move from normal to 
startup
Nov  3 10:40:51 dhcp1 dhcpd: failover peer dhcp: peer moves from normal 
to communications-interrupted
Nov  3 10:40:51 dhcp1 dhcpd: failover peer dhcp: I move from startup to 
normal
Nov  3 10:40:51 dhcp1 dhcpd: failover peer dhcp: peer moves from 
communications-interrupted to normal
Nov  3 10:40:51 dhcp1 dhcpd: pool 9e9aa20 192.168.102/24 total 191  free 
104  backup 85  lts -9
Nov  3 10:43:16 dhcp1 dhcpd: peer dhcp: disconnected
Nov  3 10:43:16 dhcp1 dhcpd: failover peer dhcp: I move from normal to 
communications-interrupted
Nov  3 10:48:32 dhcp1 dhcpd: DHCPREQUEST for 192.168.102.101 from 
00:17:31:4d:36:9b via eth1
Nov  3 10:48:32 dhcp1 dhcpd: DHCPACK on 192.168.102.101 to 
00:17:31:4d:36:9b via eth1
Nov  3 10:49:04 dhcp1 dhcpd: failover peer dhcp: peer moves from normal 
to normal
Nov  3 10:49:04 dhcp1 dhcpd: failover peer dhcp: I move from 
communications-interrupted to normal
Nov  3 10:49:04 dhcp1 dhcpd: pool 9e9aa20 192.168.102/24 total 191  free 
104  backup 85  lts -9
Nov  3 11:12:41 dhcp1 dhcpd: peer dhcp: disconnected
Nov  3 11:12:41 dhcp1 dhcpd: failover peer dhcp: I move from normal to 
communications-interrupted

And on host 2:

Nov  3 11:43:42 dhcp2 dhcpd: Internet Systems Consortium DHCP Server 
V3.0.4-RedHat
Nov  3 11:43:42 dhcp2 dhcpd: Copyright 2004-2006 Internet Systems 
Consortium.
Nov  3 11:43:42 dhcp2 dhcpd: All rights reserved.
Nov  3 11:43:42 dhcp2 dhcpd: For info, please visit 
http://www.isc.org/sw/dhcp/
Nov  3 11:43:42 dhcp2 dhcpd: Wrote 100 leases to leases file.
Nov  3 11:43:42 dhcp2 dhcpd: Listening on 
LPF/eth1/00:0c:29:a9:44:66/192.168.102/24
Nov  3 11:43:42 dhcp2 dhcpd: Sending on   
LPF/eth1/00:0c:29:a9:44:66/192.168.102/24
Nov  3 11:43:42 dhcp2 dhcpd: Sending on   Socket/fallback/fallback-net
Nov  3 11:43:42 dhcp2 dhcpd: failover peer dhcp: I move from 
communications-interrupted to startup
Nov  3 11:43:50 dhcp2 dhcpd: Internet Systems Consortium DHCP Server 
V3.0.4-RedHat
Nov  3 11:43:50 dhcp2 dhcpd: Copyright 2004-2006 Internet Systems 
Consortium.
Nov  3 11:43:50 dhcp2 dhcpd: All rights reserved.
Nov  3 11:43:50 dhcp2 dhcpd: For info, please visit 
http://www.isc.org/sw/dhcp/
Nov  3 11:43:50 dhcp2 dhcpd: Wrote 100 leases to leases file.
Nov  3 11:43:50 dhcp2 dhcpd: Listening on 
LPF/eth1/00:0c:29:a9:44:66/192.168.102/24
Nov  3 11:43:50 dhcp2 dhcpd: Sending on   
LPF/eth1/00:0c:29:a9:44:66/192.168.102/24
Nov  3 11:43:50 dhcp2 dhcpd: Sending on   Socket/fallback/fallback-net
Nov  3 11:43:50 dhcp2 dhcpd: failover peer dhcp: I move from 
communications-interrupted to startup
Nov  3 11:43:56 dhcp2 dhcpd: failover peer dhcp: I move from startup to 
communications-interrupted
Nov  3 11:43:56 dhcp2 dhcpd: failover peer dhcp: peer moves from normal 
to normal
Nov  3 11:43:56 dhcp2 dhcpd: failover peer dhcp: I move from 
communications-interrupted to normal
Nov  3 11:43:56 dhcp2 dhcpd: pool 952f9c0 192.168.102/24 total 191  free 
104  backup 85  lts 9


Then I see in the leases file something strange. On host 1 I see the 
following:

failover peer "dhcp" state {
  my state communications-interrupted at 5 2006/11/03 10:14:53;
  partner state normal at 1 2006/10/30 17:13:45;
  mclt 600;
}

failover peer "dhcp" state {
  my state normal at 5 2006/11/03 10:43:56;
  partner state normal at 1 2006/10/30 17:13:45;
  mclt 600;
}

On host 2 I see the following:

failover peer "dhcp" state {
  my state normal at 5 2006/11/03 10:14:43;
  partner state normal at 1 2006/10/30 17:11:41;
}

The "partner state normal at" time never seems to change. Whenever I 
look in the leases file of either one of the servers, they allways 
report the partner state normal time as being the time that the server 
got started the first time.
This seems a little strange to me.

Finally my config files that I put on the servers:

Server1:
ddns-update-style none;
one-lease-per-client true;
option domain-name "testlan.local";
option domain-name-servers 192.168.102.1;
option subnet-mask 255.255.255.0;
authoritative;
failover peer "dhcp" {
  primary;
  address 192.168.102.1;
  port 647;
  peer address 192.168.102.2;
  peer port 847;
  max-response-delay 60;
  max-unacked-updates 10;
  mclt 600;
  split 128;
  load balance max seconds 3;
}
include "/etc/dhcpd.master";



Server2:
ddns-update-style none;
one-lease-per-client true;
option domain-name "testlan.local";
option domain-name-servers 192.168.102.1;
option subnet-mask 255.255.255.0;
authoritative;
failover peer "dhcp" {
  secondary;
  address 192.168.102.2;
  port 847;
  peer address 192.168.102.1;
  peer port 647;
  max-response-delay 60;
  max-unacked-updates 10;
}
include "/etc/dhcpd.master";



The dhcpd.master file is the same on both servers:

subnet 192.168.102.0 netmask 255.255.255.0 {
   pool {
     failover peer "dhcp";
     range 192.168.102.10 192.168.102.200;
     deny dynamic bootp clients;
    }
   option routers 192.168.102.1;
   max-lease-time 86400;
   default-lease-time 86400;
}



I hope someone can declare the things that I see for me. Am I doing 
something completly wrong? Is the behaviour normal or did I run into 
some strange bugs?
Please enlighten me.

Greetings,
Jan Hugo Prins


More information about the dhcp-users mailing list