In normal situations, a PC can access the Internet after obtaining an IP address using DHCP. However, if the IP address is assigned by a bogus DHCP server, the PC cannot access the Internet with the bogus IP address. If this issue occurs, you are advised to configure DHCP snooping on the Layer 2 access device or the first DHCP relay agent from the device to ensure that PCs can obtain correct IP addresses.
When you configure DHCP snooping on a Layer 2 access device, steps 1, 2, and 3 are mandatory and must be performed in sequence.
When you configure DHCP snooping on the first DHCP relay agent, only steps 1 and 2 are required.
Enable DHCP snooping globally.
<HUAWEI> system-view [HUAWEI] dhcp enable [HUAWEI] dhcp snooping enable
Configure the interfaces connected to DHCP clients. Perform the configuration on all interfaces connected to DHCP clients. GE0/0/1 is used as an example.
[HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] dhcp snooping enable [HUAWEI-GigabitEthernet0/0/1] quit
Perform the configuration on interfaces connected to the DHCP server. GE0/0/2 is used as an example.
[HUAWEI] interface gigabitethernet 0/0/2 [HUAWEI-GigabitEthernet0/0/2] dhcp snooping trusted [HUAWEI-GigabitEthernet0/0/2] quit