Inserting the Option 82 Field in a DHCP Message
Context
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.
DHCP Option 82 must be configured on the user-side of a device; otherwise, the DHCP message sent to the DHCP server will not carry Option 82.
On a CE12800E, this function cannot be configured in the BD view.
Procedure
- Run system-view
The system view is displayed.
- You can configure the device to insert the Option 82 field in a DHCP message in the interface view, BD view or VLAN view. If the configuration is performed in the VLAN view, the configuration takes effect for all DHCP messages from this VLAN that are received by the interface. If the configuration is performed in the interface view, the configuration takes effect only for the specified interface. If the configuration is performed in the BD view, the configuration takes effect on all the DHCP messages received in the specified BD.
View
Steps
VLAN view
- Run the vlan vlan-id command to enter the VLAN view.
- Run the dhcp option82 { insert | rebuild } enable command to enable the device to insert the Option 82 field in a DHCP message.
By default, the device is disabled from inserting the Option 82 field in a DHCP message.
- Run the quit command to return to the system view.
Interface view
Run the interface interface-type interface-number command to enter the interface view.
- Run the dhcp option82 { insert | rebuild } enable command to enable the device to insert the Option 82 field in a DHCP message.
By default, the device is disabled from inserting the Option 82 field in a DHCP message.
- Run the quit command to return to the system view.
BD view
- Run the bridge-domain bd-id command to enter the BD view.
- Run the dhcp option82 { insert | rebuild } enable command to enable the device to insert the Option 82 field in a DHCP message.
By default, the device is disabled from inserting the Option 82 field in a DHCP message.
- Run the quit command to return to the system view.
- (Optional) You can configure the format of the Option 82 field in the system, BD or interface view. If the configuration is performed in the system view, the configuration takes effect for all interfaces on the device. If the configuration is performed in the interface view, the configuration takes effect only for the specified interface. If the configuration is performed in the BD view, the configuration takes effect on all the DHCP messages received in the specified BD.
View
Steps
System view
- Run the dhcp option82 [ circuit-id | remote-id ] format { default | common | extend | user-defined text } command to configure the format of the Option 82 field in a DHCP message.
By default, the format of the Option 82 field in a DHCP message is default.
Interface view
Run the interface interface-type interface-number command to enter the interface view.
- Run the dhcp option82 [ vlan vlan-id ] [ circuit-id | remote-id ] format { default | common | extend | user-defined text } command to configure the format of the Option 82 field in a DHCP message.By default, the format of the Option 82 field in a DHCP message is default.NOTE:
Layer 3 Ethernet interfaces do not support the vlan parameter.
BD view
Run vni vni-id
The VNI view is displayed.
Run peer ip-address
The VNI peer view is displayed.
Run description description
A description is configured for the peer VXLAN tunnel.
After the command is configured, the description is added to the Option 82 field in DHCP packets.
Run quit
The VNI view is displayed.
Run quit
The system view is displayed.
Run bridge-domain bd-id
The BD view is displayed.
Run dhcp option82 circuit-id format intracom-vxlan
The Option 82 field in VXLAN format is configured for the BD.
By default, the format of the Option 82 field in a DHCP message is default.
NOTE:In VXLAN scenario, you can run dhcp option82 format command to configure the Option 82 format in a BD. After the command is configured:- If a description is configured for the VNI, the description is added to the CID sub-option.
- If no description is configured for the VNI, the circuit-id sub-option of Option 82 is not inserted to DHCP messages.
- Run the dhcp option82 [ circuit-id | remote-id ] format { default | common | extend | user-defined text } command to configure the format of the Option 82 field in a DHCP message.
- Run commit
The configuration is committed.