Secondary DHCP server won't start on Centos 6.2

Posted by Slowjoe on Server Fault See other posts from Server Fault or by Slowjoe
Published on 2012-09-15T13:53:27Z Indexed on 2012/09/15 15:39 UTC
Read the original article Hit count: 476

Filed under:
|

I'm trying to create a backup DHCP server. Server times are in sync. Primary server starts fine. Secondary server won't start. Error from /var/log/messages is:

Sep 15 14:47:45 stream dhcpd: Copyright 2004-2010 Internet Systems Consortium.
Sep 15 14:47:45 stream dhcpd: All rights reserved.
Sep 15 14:47:45 stream dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Sep 15 14:47:45 stream dhcpd: /etc/dhcp/dhcpd.conf line 25: invalid statement in peer declaration
Sep 15 14:47:45 stream dhcpd: #011max-response-default
Sep 15 14:47:45 stream dhcpd:          ^
Sep 15 14:47:45 stream dhcpd: /etc/dhcp/dhcpd.conf line 41: failover peer dhcp-failover: not found
Sep 15 14:47:45 stream dhcpd:     failover peer "dhcp-failover"
Sep 15 14:47:45 stream dhcpd:                    ^
Sep 15 14:47:45 stream dhcpd: /etc/dhcp/dhcpd.conf line 49: failover peer dhcp-failover: not found
Sep 15 14:47:45 stream dhcpd:     failover peer "dhcp-failover"
Sep 15 14:47:45 stream dhcpd:                    ^
Sep 15 14:47:45 stream dhcpd: WARNING: Host declarations are global.  They are not limited to the scope you declared them in.
Sep 15 14:47:45 stream dhcpd: /etc/dhcp/dhcpd.conf line 70: failover peer dhcp-failover: not found
Sep 15 14:47:45 stream dhcpd:     failover peer "dhcp-failover"
Sep 15 14:47:45 stream dhcpd:                    ^
Sep 15 14:47:45 stream dhcpd: /etc/dhcp/dhcpd.conf line 78: failover peer dhcp-failover: not found
Sep 15 14:47:45 stream dhcpd:     failover peer "dhcp-failover"
Sep 15 14:47:45 stream dhcpd:                    ^
Sep 15 14:47:45 stream dhcpd: Configuration file errors encountered -- exiting
Sep 15 14:47:45 stream dhcpd:
Sep 15 14:47:45 stream dhcpd: This version of ISC DHCP is based on the release available
Sep 15 14:47:45 stream dhcpd: on ftp.isc.org.  Features have been added and other changes
Sep 15 14:47:45 stream dhcpd: have been made to the base software release in order to make
Sep 15 14:47:45 stream dhcpd: it work better with this distribution.
Sep 15 14:47:45 stream dhcpd:
Sep 15 14:47:45 stream dhcpd: Please report for this software via the CentOS Bugs Database:
Sep 15 14:47:45 stream dhcpd:     http://bugs.centos.org/
Sep 15 14:47:45 stream dhcpd:
Sep 15 14:47:45 stream dhcpd: exiting.

Config file contents:

# DHCP Server Configuration file.
#   see /usr/share/doc/dhcp*/dhcpd.conf.sample
#   see 'man 5 dhcpd.conf'
#

option domain-name "eng.foo.com";
option domain-name-servers ns0.eng.foo.com, ns1.eng.foo.com;
option ntp-servers ntp.eng.foo.com;
#option time-servers ntp.eng.foo.com;

default-lease-time 3600;
max-lease-time 7200;

authoritative;

log-facility local7;

failover peer "dhcp-failover" {
        secondary;
        address 10.0.1.70;
        port 647;
        peer address 10.0.1.11;
        peer port 647;
        max-response-default 30;
        max-unacked-updates 10;
        load balance max seconds 3;
}

#
# Management subnet
#
subnet 10.0.0.0 netmask 255.255.255.0 {
  option subnet-mask 255.255.255.0;
  option broadcast-address 10.0.0.255;
  option routers 10.0.0.1;
  option domain-search "eng.foo.com", "foo.com";

  # Unknown clients get this pool
  pool {
    failover peer "dhcp-failover";
    max-lease-time 300;
    range 10.0.0.240 10.0.0.249;
    allow unknown-clients;
  }

  # Known clients get this pool
  pool {
    failover peer "dhcp-failover";
    max-lease-time 28800;
    range 10.0.0.150 10.0.0.199;
    deny unknown-clients;
  }

  include "/etc/dhcp/dhcpd.conf-engmgmt";

}

#
# Data subnet
#
subnet 10.0.1.0 netmask 255.255.255.0 {
  option subnet-mask 255.255.255.0;
  option broadcast-address 10.0.1.255;
  option routers 10.0.1.1;
  option domain-search "eng.foo.com", "foo.com";

  # Unknown clients get this pool
  pool {
    failover peer "dhcp-failover";
    max-lease-time 300;
    range 10.0.1.240 10.0.1.249;
    allow unknown-clients;
  }

  # Known clients get this pool
  pool {
    failover peer "dhcp-failover";
    max-lease-time 28800;
    range 10.0.1.150 10.0.1.199;
    deny unknown-clients;
  }

  # For centos network installs
  if substring (option vendor-class-identifier, 0, 8) = "anaconda" {
    filename "/autohome/distro/ks/";
    next-server eng-data.eng.foo.com;
  }

  # For PXE network installs
  if substring (option vendor-class-identifier, 0, 9) = "PXEClient" {
    filename "pxelinux.0";
    next-server eng-data.eng.foo.com;
  }

  # For KVM PXE network installs
  if substring (option vendor-class-identifier, 0, 9) = "Etherboot" {
    filename "pxelinux.0";
    next-server eng-data.eng.foo.com;
  }

  include "/etc/dhcp/dhcpd.conf-engdata";

}

© Server Fault or respective owner

Related posts about failover

Related posts about dhcpd