Thursday, December 16, 2010

Debian DHCP server failover

Before we start I assume you followed previous two posts: setup and dynamic-dns. Our primary dhcp server located at 192.168.10.4 and secondary at 192.168.10.5.

Primary DHCP Server

  1. You need declare failover section that identifies the primary dhcp server (file /etc/dhcp/dhcpd.conf).
    failover peer "dhcp-failover" {
      primary; # declare this to be the primary server
      address 192.168.10.4;
      port 647;
      peer address 192.168.10.5;
      peer port 647;
      max-response-delay 30;
      max-unacked-updates 10;
      load balance max seconds 3;
      mclt 1800;
      split 128;
    }
    
  2. Failover peer needs to be referenced by concrete subnet:
    subnet 192.168.10.0 netmask 255.255.255.0 {
      pool {
        # In order to turn off failover just comment out
        # the line below
        failover peer "dhcp-failover";
        range 192.168.10.41 192.168.10.254;
      }
      option subnet-mask 255.255.255.0;
      option broadcast-address 192.168.10.255;
      option routers gw1.dev.local;
    }
    

Secondary DHCP Server

  1. Failover secondary peer declaration (file /etc/dhcp/dhcpd.conf):
    failover peer "dhcp-failover" {
      secondary; # declare this to be the secondary server
      address 192.168.10.5;
      port 647;
      peer address 192.168.10.4;
      peer port 647;
      max-response-delay 30;
      max-unacked-updates 10;
      load balance max seconds 3;
    }
    
  2. subnet 192.168.10.0 netmask 255.255.255.0 {
      pool {
        # In order to turn off failover just comment out
        # the line below
        failover peer "dhcp-failover";
        range 192.168.10.41 192.168.10.254;
      }
      option subnet-mask 255.255.255.0;
      option broadcast-address 192.168.10.255;
      option routers gw1.dev.local;
    }
    
That pretty much you need to do. Read more here.

No comments :

Post a Comment