< Home

dhcp option82 enable

Function

The dhcp option82 enable command enables a device to insert the Option 82 field to a DHCP message.

The undo dhcp option82 enable command disables a device from inserting the Option 82 field to a DHCP message.

By default, a device does not insert the Option 82 field to a DHCP message.

Format

In the interface view, BD view and port group view

dhcp option82 { insert | rebuild } enable

undo dhcp option82 { insert | rebuild } enable

In the VLAN view

dhcp option82 { insert | rebuild } enable interface interface-type interface-number1 [ to interface-number2 ]

undo dhcp option82 { insert | rebuild } enable interface interface-type interface-number1 [ to interface-number2 ]

Parameters

Parameter Description Value

insert

Enables a device to insert the Option 82 field to a DHCP message.

-

rebuild

Enables a device to forcibly insert the Option 82 field to a DHCP message.

-

interface interface-type interface-number1 [ to interface-number2 ]

Specifies the interface type and number.

  • interface-type specifies the interface type.
  • interface-number specifies the interface number.

If this command is run in the VLAN view, the specified interface must have been added to the VLAN.

Views

VLAN view, Ethernet interface view, GE interface view, MultiGE interface view, XGE interface view, 25GE interface view, 40GE interface view, 100GE interface view, Eth-Trunk interface view, port group view, BD view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The Option 82 field records the location of a DHCP client. A device inserts the Option 82 field to a DHCP Request message to notify the DHCP server of the DHCP client location. The DHCP server can assign an IP address and other configurations to the DHCP client, ensuring DHCP client security.

The device inserts the Option 82 field to a DHCP message in two modes:
  • Insert mode: Upon receiving a DHCP Request message without the Option 82 field, the device inserts the Option 82 field. If the DHCP Request message contains the Option 82 field, the device checks whether the Option 82 field contains the remote ID. If so, the device retains the Option 82 field; if not, the device inserts the remote ID.

  • Rebuild mode: Upon receiving a DHCP Request message without the Option 82 field, the device inserts the Option 82 field. If the DHCP Request message contains the Option 82 field, the device deletes the original Option 82 field and inserts the Option 82 field set by the administrator.

The device handles the reply packets from the DHCP server in the same way regardless of whether the Insert or Rebuild method is used.

  • The DHCP reply packets contain Option 82:
    • If the DHCP request packets received by the device do not contain Option 82, the device deletes Option 82 from the DHCP reply packets, and forwards the packets to the DHCP client.
    • If the DHCP request packets contain Option 82, the device changes the Option 82 format in the DHCP reply packets into the Option 82 format in the DHCP request packets, and forwards the packets to the DHCP client.
  • If the DHCP reply packets do not contain Option 82, the device directly forwards the packets.

The physical interface can insert Option82 to the DHCP packets directly forwarded, but does not insert Option82 to the DHCP packets forwarded through a tunnel.

Prerequisites

DHCP snooping has been enabled on the device, or the device has been configured as a DHCP relay agent.

Precautions

  • When receiving a DHCP Request message, the device checks whether the field GIADDR in the packet is 0. If so, the dhcp option82 enable command takes effect; if not, this command does not take effect.
  • DHCP Option 82 must be configured on the user-side of a device; otherwise, the DHCP messages sent to the DHCP server will not carry Option 82.

Example

# Enable the device to insert the Option 82 field to DHCP messages on GE0/0/1.

<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] dhcp option82 insert enable
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >