This section describes how to prevent the attacker connected to the Layer-3 interface from changing the CHADDR value to launch attacks.
Before preventing the attacker from changing CHADDR through a Layer-3 device, complete the following tasks:
Configure the DHCP server.
Configure a DHCP relay agent.
system-view
dhcp snooping enable
Enable DHCP snooping globally before enabling DHCP snooping on a Layer-3 interface.
interface interface-type interface-number
DHCP snooping can be enabled on the following Layer-3 interfaces:
Ethernet interfaces
Ethernet sub-interfaces
Vlanif interfaces
Layer-3 Eth-Trunk interfaces
dhcp snooping enable
dhcp snooping check dhcp-chaddr enable
Enable checking CHADDRs. The device compares the CHADDR field in the received DHCP Request message with the source MAC address in the frame header. If they are inconsistent, the received DHCP request message is considered as an attack packet and is directly discarded.
If the following results are displayed, the configuration is successful:
DHCP snooping is enabled in both the system and interface views.
Statistics about the discarded ARP, IP, and DHCP packets are displayed.
<sysname> display dhcp snooping interface GigabitEthernet 0/0/1
dhcp snooping enable
dhcp snooping check dhcp-chaddr enable
arp total 0
ip total 0
dhcp-request total 0
chaddr&src mac total 0
dhcp-reply total 0