Configuring the DHCP smart relay feature

The DHCP smart relay feature allows the DHCP relay agent to pad secondary IP addresses when the DHCP server does not reply the DHCP-OFFER message.

The relay agent initially pads its primary IP address to 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 pads the primary IP address to the giaddr field of all requests.

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

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 relay 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 relay address pool and enter its view.

dhcp server ip-pool pool-name

By default, no DHCP relay address pool exists.

This command is the same for creating DHCP address pools on a DHCP server. However, the relay address pool names are not necessarily the same as the server address pool names.

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

gateway-list ip-address&<1-64> [ export-route ]

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

7. Specify DHCP servers for the relay address pool.

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

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

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