Configuring the DHCP smart relay feature

The DHCP smart relay feature allows the DHCP relay agent to insert secondary IP addresses when the DHCP server does not send back a DHCP-OFFER message.

The relay agent initially inserts its primary IP address in the giaddr field before forwarding a request to the DHCP server. If no DHCP-OFFER is received, the relay agent allows the client to send a maximum of two requests to the DHCP server by using the primary IP address. If no DHCP-OFFER is returned after two retries, the relay agent switches to a secondary IP address. If the DHCP server still does not respond, the next secondary IP address is used. After the secondary IP addresses are all tried and the DHCP server does not respond, the relay agent repeats the process by starting from the primary IP address.

Without this feature, the relay agent only inserts the primary IP address in the giaddr field of all requests.

On a relay agent where DHCP address pools and gateway addresses are configured, the smart relay feature starts the process from the first gateway address. For more information, see "Configuring a DHCP address pool on the DHCP relay agent."

To configure the DHCP smart relay feature for a common network:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter interface view.

interface interface-type interface-number

N/A

3. Enable the DHCP relay agent.

dhcp select relay

By default, an interface operates in the DHCP server mode when DHCP is enabled.

4. Assign primary and secondary IP addresses to the DHCP relay agent.

ip address ip-address { mask-length | mask } [ sub ]

By default, the DHCP relay agent does not have any IP addresses.

5. Return to system view.

quit

N/A

6. Enable the DHCP smart relay feature.

dhcp smart-relay enable

By default, the DHCP smart relay feature is disabled.

To configure the DHCP smart relay feature for a network with DHCP address pools:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter interface view.

interface interface-type interface-number

N/A

3. Enable the DHCP relay agent.

dhcp select relay

By default, an interface operates in the DHCP server mode when DHCP is enabled.

4. Return to system view.

quit

N/A

5. Create a DHCP address pool and enter its view.

dhcp server ip-pool pool-name

By default, no DHCP address pool exists.

6. Specify gateway addresses for the clients matching the DHCP address pool.

gateway-list ip-address&<1-64>

By default, the DHCP address pool does not have any gateway addresses.

7. Specify DHCP servers for the DHCP address pool.

remote-server ip-address&<1-8>

By default, the DHCP address pool does not have any DHCP server IP addresses.

You can specify a maximum of eight DHCP servers for one DHCP address pool for high availability. The relay agent forwards DHCP-DISCOVER and DHCP-REQUEST packets to all DHCP servers in the DHCP address pool.

8. Return to system view.

quit

N/A

9. Enable the DHCP smart relay feature.

dhcp smart-relay enable

By default, the DHCP smart relay feature is disabled.