Skip to content

Instantly share code, notes, and snippets.

@umardx
Created June 14, 2017 04:58
Show Gist options
  • Select an option

  • Save umardx/ed1ba54037732fdff463c19db7cb5433 to your computer and use it in GitHub Desktop.

Select an option

Save umardx/ed1ba54037732fdff463c19db7cb5433 to your computer and use it in GitHub Desktop.
DHCP Failover Config File
DHCP Configuration
======================================================================
Primary Server
======================================================================
#dhcpd.conf
authoritative;
option domain-name "localdomain.dx";
option domain-name-servers 192.168.10.11, 192.168.10.12;
default-lease-time 600;
max-lease-time 7200;
# fail over configuration
failover peer "dhcp-backup" {
primary; # This is the primary
address 192.168.1.11; # This DHCP Server IP Address
port 647;
peer address 192.168.10.12; # Secondary DHCP Server ip address
peer port 647;
max-response-delay 60;
max-unacked-updates 10;
load balance max seconds 3;
}
subnet 192.168.10.0 netmask 255.255.255.0 {
option domain-name "localdomain.dx";
option domain-name-servers 192.168.10.11, 192.168.10.12;
option broadcast-address 192.168.10.255;
option routers 192.168.10.1;
pool {
failover peer "dhcp-backup";
range 192.168.10.201 192.168.10.230;
default-lease-time 6000;
max-lease-time 72000;
}
}
#Static Lease Configuration
host ns1 {
hardware ethernet 00:80:33:c3:EE:AA;
fixed-address 192.168.10.11;
}
=======================================================================
DHCP Lease Database Check
=======================================================================
cat /var/lib/dhcpd/dhcpd.leases
====================================================================================
Secondary Server
====================================================================================
#dhcpd.conf
authoritative;
option domain-name "nlocaldomain.dx";
option domain-name-servers 192.168.10.11, 192.168.10.12;
default-lease-time 600;
max-lease-time 7200;
# fail over configuration
failover peer "dhcp-backup" {
secondary; # This is the secondary
address 192.168.1.12; # This DHCP Server IP Address
port 647;
peer address 192.168.10.11; # Primary DHCP Server ip address
peer port 647;
max-response-delay 60;
max-unacked-updates 10;
load balance max seconds 3;
}
subnet 192.168.10.0 netmask 255.255.255.0 {
option domain-name "nlocaldomain.dx";
option domain-name-servers 192.168.10.11, 192.168.10.12;
option broadcast-address 192.168.10.255;
option routers 192.168.10.1;
pool {
failover peer "dhcp-backup";
range 192.168.10.201 192.168.10.230;
default-lease-time 6000;
max-lease-time 72000;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment