Option 82 Supported by DHCP Snooping
Overview
During traditional dynamic IP address allocation, a DHCP server cannot detect the DHCP client location based on the received DHCP Request message. As a result, DHCP clients in the same VLAN have the same rights to access network resources. The network administrator cannot control network access of clients in the same VLAN, which brings challenges to security control.
DHCP Relay Agent Information Option, that is, the Option 82 field, records the location of a DHCP client. A DHCP snooping-enabled device or a DHCP relay agent 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 Option 82 field contains two commonly used suboptions: circuit ID and remote ID. The circuit ID distinguishes VLAN ID and interface number of a client, and the remote ID distinguishes the MAC address of the client.
- As a DHCP relay agent, the device supports the Option 82 field regardless of whether DHCP snooping is enabled on the device. However, as an access device on a Layer 2 network, the device supports the Option 82 field only after DHCP snooping is enabled.
- The Option 82 field records the location of a DHCP client and is encapsulated in a DHCP Request message that is sent to the DHCP server. To deploy different IP addresses or security policies for different clients, the DHCP server must support the Option 82 field and be configured with IP address assignment or security policies.
- The Option 82 field is different from parameters recorded in a DHCP snooping binding table. The device adds the Option 82 field to the DHCP Request message when the DHCP client requests an IP address. At this time, the client does not have an IP address. A DHCP snooping binding table is generated based on the DHCP ACK messages received from the DHCP server. At this time, the client obtains an IP address.
Implementation
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 a remote ID. If so, the device retains the Option 82 field; if not, the device inserts a 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 the Option 82 field:
- If the DHCP request packets received by the device do not contain the Option 82 field, the device deletes the Option 82 field from the DHCP reply packets, and forwards the packets to the DHCP client.
- If the DHCP request packets contain the Option 82 field, the device changes the Option 82 format in the DHCP reply packets into the Option 82 format in the DHCP request packets, and then forwards the packets to the DHCP client.
- If the DHCP reply packets do not contain the Option 82 field, the device directly forwards the packets.