The gateway IP address (GIADDR) field in a DHCP Request message records the IP address of the first DHCP relay agent through which the DHCP Request message passes. When a DHCP client sends a DHCP Request message, if the DHCP server and client are on different network segments, the first DHCP relay agent fills its own IP address in the GIADDR field before forwarding the DHCP Request message. The DHCP server then uses the IP address in this field to locate the DHCP client and select an appropriate address pool from which to assign an IP address to the client.
To ensure that the device obtains parameters such as MAC addresses for generating a binding table, enable DHCP snooping on Layer 2 access devices or the first DHCP relay agent (DHCP Relay1, in Figure 1). This ensures that the GIADDR field in the DHCP Request messages received by the DHCP snooping-enabled device is 0. If the GIADDR field is not 0, the message is considered to be invalid and discarded. This function is recommended if DHCP snooping is enabled on the DHCP relay agent.
In normal situations, the GIADDR field in DHCP messages sent by user PCs is 0. If the GIADDR field is not 0, the DHCP server cannot correctly allocate IP addresses. To prevent attackers from applying for IP addresses with the DHCP messages with a number other than 0 in the GIADDR field, you are advised to configure this function.
The system view is displayed.
If you run this command in the VLAN view, the command takes effect on all the DHCP messages in the specified VLAN received by all the interfaces on the device. If you run this command in the interface view, the command takes effect on all the DHCP messages received by the specified interface.