dhcp option82 insert enable (VLAN view)

Function

The dhcp option82 insert enable command enables option 82 insertion.

The undo dhcp option82 insert enable command disables option 82 insertion.

By default, option 82 insertion is disabled.

Format

dhcp option82 insert enable [ interface { interface-type interface-number | interface-name } ]

undo dhcp option82 insert enable [ interface { interface-type interface-number | interface-name } ]

Parameters

Parameter Description Value
interface interface-type interface-number

Indicates the interface type and interface number.

-

interface interface-name

Indicates the interface name.

-

Views

VLAN view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
dhcp write

Usage Guidelines

Usage Scenario

The option fields in a DHCP packet store some control information and parameters that are not defined in common protocols. This field consists of the Code, Length, and Value fields. Option 82 field refers to the option fields in which the Code value is 82.

The option 82 field contains the location information of DHCP hosts, such as information about login interface, VLAN, and address. The option 82 field helps create DHCP snooping binding entries with accurate interface information. DHCP relays specify clients and policies for IP address assignment based on the option 82 field. For example, the DHCP server assigns IP addresses in a network segment for the clients that logs in from Gigabitethernet 0/1/1. The DHCP server assigns IP addresses in another network segment for the clients that logs in from Ethernet 0/1/2.

Configuration Impact

After the dhcp option82 insert enable command is run, the device inserts the option 82 field into a DHCP packet if no option 82 field exists in the packet. If the option 82 field exists in a DHCP packet, the device checks whether the option 82 field contains suboptions. If the option 82 field contains suboptions, the device does not change the suboptions. If the option 82 field does not contain suboptions and the suboption format is configured, the device inserts suboptions into the option 82 field.

If the dhcp option82 insert enable (VLAN view) command and the dhcp option82 rebuild enable (VLAN view) command are run in the same view, the last configuration takes effect.

Example

# Enable option 82 insertion for GE 0/1/1 in VLAN 100.
<HUAWEI> system-view
[~HUAWEI] dhcp enable
[*HUAWEI] vlan 100
[*HUAWEI-vlan100] quit
[*HUAWEI] interface GigabitEthernet 0/1/1
[*HUAWEI-GigabitEthernet0/1/1] portswitch
[*HUAWEI-GigabitEthernet0/1/1] port default vlan 100
[*HUAWEI-GigabitEthernet0/1/1] quit
[*HUAWEI] vlan 100
[*HUAWEI-vlan100] dhcp option82 insert enable interface GigabitEthernet 0/1/1
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >