Configuring the DHCP relay agent to forward DHCP replies based on Option 82

Configure this feature if the DHCP relay agent is required to forward DHCP replies to DHCP clients based on Option 82.

For example, an IPRAN network has a primary gateway and a secondary gateway. An L3VE interface is configured as the relay interface on each of the gateways. Multiple L2VE subinterfaces are configured to receive packets. One L2VE subinterface corresponds to one PW. Only the primary gateway receives DHCP requests, but both the primary and secondary gateways might receive DHCP replies. The primary gateway can forward DHCP replies based on locally recorded user information, but the secondary gateway cannot. The secondary gateway can only forward DHCP replies to all PWs.

To enable the secondary gateway to forward a DHCP reply to only the intended PW, perform the following tasks:

To configure the DHCP relay agent to forward DHCP replies based on Option 82:

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 relay agent to handle Option 82.

dhcp relay information enable

By default, handling of Option 82 is disabled.

4. Configure the padding mode and padding format for the Circuit ID sub-option.

dhcp relay information circuit-id { bas [ sub-interface-vlan ] | string circuit-id | { normal | verbose [ node-identifier { mac | sysname | user-defined node-identifier } ] [ interface ] } [ sub-interface-vlan ] [ format { ascii | hex } ] }

By default, the padding mode for the Circuit ID sub-option is normal, and the padding format is hex.

The device name (set by using the sysname command) must not include spaces if it is configured as the padding content for sub-option 1. Otherwise, the DHCP relay agent will fail to add or replace Option 82.

You must set the padding mode to bas, normal, or verbose, and specify the sub-interface-vlan keyword for this command.

5. Configure the DHCP relay agent to forward DHCP replies based on Option 82.

dhcp relay forward reply by-option82

By default, the DHCP relay agent does not forward DHCP replies based on Option 82.