The dhcp option82 format command configures the format of the Option 82 field for a VLAN.
The undo dhcp option82 format command restores the default setting.
By default, Option 82 in DHCP packets is in the type1 format.
Parameter | Description | Value |
---|---|---|
user-defined text |
Specifies the self-defined format string of option 82. |
The value is a string of 1 to 255 characters. For the value requirements of the user-defined format character string, see the following "Usage Guidelines". |
type1 |
Indicates the Telecom format of Option 82. CID format: interface name:outer VLAN ID.inner VLAN ID system name/0/0/0/0/0, in ASCII encapsulation mode. |
- |
type2 |
Indicates the NMS format of Option 82. CID format: interface name:outer VLAN ID.inner VLAN ID system name, in ASCII encapsulation mode. |
- |
self-define self-define |
Indicates the user-defined format string of DHCP Option 82. |
The value is a string of 1 to 255 case-insensitive characters. It can contain letters, digits, and special characters. |
cn-telecom |
Indicates the Option 82 information in the standard cn-telecom format. CID format: interface name:outer VLAN ID.inner VLAN ID /0/0/0/0/0/0, in ASCII encapsulation mode. |
- |
cn-telecom-inherit |
Option 82 information in the standard cn-telecom format is inherited. CID format: inherits the access node information in the DHCP request packet and fills in the location information. |
- |
interface interface-type interface-number |
Specifies the interface type and number. |
- |
interface interface-name |
Specifies the interface name. |
- |
Usage Scenario
The option 82 contains the location information of DHCP clients, such as information about login interface, VLAN, and address. After the option 82 field is configured, the device can set up dynamic binding entries with accurate interface information. Based on the option 82 field, the DHCP server assigns IP addresses and policies for DHCP clients.
After a self-define Option 82 format is configured, the device encapsulates the self-define Option 82 format into packets. In addition, you can use the following keywords to define the user-defined option 82 format string. The format string can use the hexadecimal format, ASCII format, or combination of the two formats.Prerequisites
Perform the following operations before running the command:
Precautions
<HUAWEI> system-view [~HUAWEI] dhcp enable [*HUAWEI] vlan 10 [*HUAWEI-vlan10] quit [*HUAWEI] interface GigabitEthernet 0/1/1 [*HUAWEI-GigabitEthernet0/1/1] portswitch [*HUAWEI-GigabitEthernet0/1/1] port default vlan 10 [*HUAWEI-GigabitEthernet0/1/1] quit [*HUAWEI] vlan 10 [*HUAWEI-vlan10] dhcp option82 insert enable interface GigabitEthernet 0/1/1 [*HUAWEI-vlan10] dhcp option82 format self-define testCase interface GigabitEthernet 0/1/1
<HUAWEI> system-view [~HUAWEI] dhcp enable [*HUAWEI] vlan 10 [*HUAWEI-vlan10] quit [*HUAWEI] interface GigabitEthernet 0/1/1 [*HUAWEI-GigabitEthernet0/1/1] portswitch [*HUAWEI-GigabitEthernet0/1/1] port default vlan 10 [*HUAWEI-GigabitEthernet0/1/1] quit [*HUAWEI] vlan 10 [*HUAWEI-vlan10] dhcp option82 insert enable interface GigabitEthernet 0/1/1 [*HUAWEI-vlan10] dhcp option82 format type1 interface GigabitEthernet 0/1/1