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.
- Both peers must be vRouter and must be running the same version of Vyatta software.
- Each server must be configured to point to the other as the failover peer.
- The time on the servers must be exactly synchronized.
- The start-stop range must have at least one IP address for each subnet that has not been either excluded (by using service dhcp-server shared-network-name name subnet ipv4net exclude ipv4) or statically mapped (by using service dhcp-server static-mapping mapname).
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.
To configure R1 as the primary DHCP server in this failover scenario, perform the following steps in configuration mode 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. |
|
Specify the default router for DHCP1. |
|
Specify a DNS server for DHCP1. |
|
Specify the local IP address for the DHCP server for failover. |
|
Specify the IP address of the peer DHCP server for failover. |
|
Specify the role that the DHCP server plays in the failover group. |
|
Specify the name of the failover group. |
|
Commit the changes. |
|
Show the configuration. |
|
To configure R2 as the secondary DHCP server in this failover scenario, perform the following steps in configuration mode 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. |
|
Specify the default router for DHCP1. |
|
Specify a DNS server for DHCP1. |
|
Specify the local IP address for the DHCP server for failover. |
|
Specify the IP address of the peer DHCP server for failover. |
|
Specify the role that the DHCP server plays in the failover group. |
|
Specify the name of the failover group. |
|
Commit the changes. |
|
Show the configuration. |
|