Specifying the DHCP server selecting algorithm
About DHCP server selecting algorithm
The DHCP relay agent supports the polling and master-backup DHCP server selecting algorithms.
By default, the DHCP relay agent uses the polling algorithm. It forwards DHCP requests to all DHCP servers. The DHCP clients select the DHCP server from which the first received DHCP reply comes.
If the DHCP relay agent uses the master-backup algorithm, it forwards DHCP requests to the master DHCP server first. If the master DHCP server is not available, the relay agent forwards the subsequent DHCP requests to a backup DHCP server. If the backup DHCP server is not available, the relay agent selects the next backup DHCP server, and so on. If no backup DHCP server is available, it repeats the process starting from the master DHCP server.
The master DHCP server is determined in one of the following ways:
In a common network where multiple DHCP server addresses are specified on the DHCP relay interface, the first specified DHCP server is the master. The other DHCP servers are backup.
In a network where DHCP address pools are configured on the DHCP relay agent, the first specified DHCP server in a DHCP address pool is the master. The other DHCP servers in the DHCP address pool are backup.
DHCP server selection supports the following functions:
DHCP server response timeout time—The DHCP relay agent determines that a DHCP server is not available if it does not receive any response from the server within the DHCP server response timeout time. The DHCP server response timeout time is configurable and the default is 30 seconds.
DHCP server switchback—If the DHCP relay agent selects a backup DHCP server, it does not switch back to the master DHCP server by default. You can configure the DHCP relay agent to switch back to the master DHCP server after a delay. If the master DHCP server is available, the DHCP relay agent forwards DHCP requests to the master DHCP server. If the master DHCP server is not available, the DHCP relay agent still uses the backup DHCP server.
Specifying the DHCP server selecting algorithm in interface view
Enter system view.
system-view
Enter interface view.
interface interface-type interface-number
Specify the DHCP server selecting algorithm.
dhcp relay server-address algorithm { master-backup | polling }
By default, the polling algorithm is used. The DHCP relay agent forwards DHCP requests to all DHCP servers.
(Optional.) Set the DHCP server response timeout time for DHCP server switchover.
dhcp relay dhcp-server timeout time
By default, the DHCP server response timeout time is 30 seconds.
(Optional.) Enable the switchback to the master DHCP server and set the delay time.
dhcp relay master-server switch-delay delay-time
By default, the DHCP relay agent does not switch back to the master DHCP server.
Specifying the DHCP server selecting algorithm in DHCP address pool view
Enter system view.
system-view
Enter DHCP address pool view.
dhcp server ip-pool pool-name
Specify the DHCP server selecting algorithm.
dhcp relay server-address algorithm { master-backup | polling }
By default, the polling algorithm is used. The DHCP relay agent forwards DHCP requests to all DHCP servers.
(Optional.) Set the DHCP server response timeout time for DHCP server switchover.
dhcp-server timeout time
By default, the DHCP server response timeout time is 30 seconds.
(Optional.) Enable the switchback to the master DHCP server and set the delay time.
master-server switch-delay delay-time
By default, the DHCP relay agent does not switch back to the master DHCP server.