Vyatta Network OS Documentation

Learn how to install, configure and operate the Vyatta NOS, which helps drive our virtual networking & physical platforms portfolio.

Setting up DHCP servers for failover

The vRouter also provides a failover feature to allow for DHCP redundancy on a given subnet.

In a failover configuration, two DHCP servers act as failover peers, with one of the peers designated as the primary and the other as the secondary. For DHCP failover to work, the following conditions must be met.

The system times should be synchronized before configuring DHCP failover. Use of NTP time synchronization is highly recommended. However, if difficulties arise because of incorrect system times, disable NTP, reset the times correctly, and then re-enable NTP.

Note that DHCP leases are assigned only in failover configurations if proper communication is established between the two failover peers. If the configuration is incorrect (if, for example, one failover peer is configured but the other is not), DHCP leases are not dispersed.

Also note that statically mapped addresses are not renewed by a failover server unless they are explicitly defined on that server by using service dhcp-server static-mapping mapname.

The following figure shows the sample DHCP server failover configuration.

Figure 1. DHCP server failover configuration

To configure R1 as the primary DHCP server in this failover scenario, perform the following steps in configuration mode on R1.

Table 1. Setting up DHCP failover on R1

Step

Command

Create the configuration node for DHCP1 on the 192.168.42.0/24 subnet. Specify the start and stop IP addresses for the pool.


vyatta@R1# set service dhcp-server shared-network-name DHCP1 subnet 192.168.42.0/24 start 192.168.42.100 stop 192.168.42.199

Specify the default router for DHCP1.


vyatta@R1# set service dhcp-server shared-network-name DHCP1 subnet 192.168.42.0/24 default-router 192.168.42.254

Specify a DNS server for DHCP1.


vyatta@R1# set service dhcp-server shared-network-name DHCP1 subnet 192.168.42.0/24 dns-server 192.168.42.253

Specify the local IP address for the DHCP server for failover.


vyatta@R1# set service dhcp-server shared-network-name DHCP1 subnet 192.168.42.0/24 failover local-address 192.168.42.1

Specify the IP address of the peer DHCP server for failover.


vyatta@R1# set service dhcp-server shared-network-name DHCP1 subnet 192.168.42.0/24 failover peer-address 192.168.42.2

Specify the role that the DHCP server plays in the failover group.


vyatta@R1# set service dhcp-server shared-network-name DHCP1 subnet 192.168.42.0/24 failover status primary

Specify the name of the failover group.


vyatta@R1# set service dhcp-server shared-network-name DHCP1 subnet 192.168.42.0/24 failover name FAILOVER

Commit the changes.


vyatta@R1# commit

Show the configuration.


vyatta@R1# show service dhcp-server shared-network-name DHCP1
	shared-network-name DHCP1 {
		subnet 192.168.42.0/24 {
			default-router 192.168.42.254
			dns-server 192.168.42.253
			failover {
				local-address 192.168.42.1
				name FAILOVER
				peer-address 192.168.42.2
				status primary
			}
			start 192.168.42.100 {
				stop 192.168.42.199
			}
		}
	}

To configure R2 as the secondary DHCP server in this failover scenario, perform the following steps in configuration mode on R2.

Table 2. Setting up DHCP failover on R2

Step

Command

Create the configuration node for DHCP1 on the 192.168.42.0/24 subnet. Specify the start and stop IP addresses for the pool.


vyatta@R2# set service dhcp-server shared-network-name DHCP1 subnet 192.168.42.0/24 start 192.168.42.100 stop 192.168.42.199

Specify the default router for DHCP1.


vyatta@R2# set service dhcp-server shared-network-name DHCP1 subnet 192.168.42.0/24 default-router 192.168.42.254

Specify a DNS server for DHCP1.


vyatta@R2# set service dhcp-server shared-network-name DHCP1 subnet 192.168.42.0/24 dns-server 192.168.42.253

Specify the local IP address for the DHCP server for failover.


vyatta@R2# set service dhcp-server shared-network-name DHCP1 subnet 192.168.42.0/24 failover local-address 192.168.42.2

Specify the IP address of the peer DHCP server for failover.


vyatta@R2# set service dhcp-server shared-network-name DHCP1 subnet 192.168.42.0/24 failover peer-address 192.168.42.1

Specify the role that the DHCP server plays in the failover group.


vyatta@R2# set service dhcp-server shared-network-name DHCP1 subnet 192.168.42.0/24 failover status secondary

Specify the name of the failover group.


vyatta@R2# set service dhcp-server shared-network-name DHCP1 subnet 192.168.42.0/24 failover name FAILOVER

Commit the changes.


vyatta@R2# commit

Show the configuration.


vyatta@R2# show service dhcp-server shared-network-name DHCP1
	shared-network-name DHCP1 {
		subnet 192.168.42.0/24 {
			default-router 192.168.42.254
			dns-server 192.168.42.253
			failover {
				local-address 192.168.42.2
				name FAILOVER
				peer-address 192.168.42.1
				status secondary
			}
			start 192.168.42.100 {
				stop 192.168.42.199
			}
		}
	}