Attackers send forged ARP packets to gateways so that gateways learn incorrect user ARP entries.
Attackers send forged ARP packets to other users so that the users learn incorrect ARP entries.
Attackers send malformed ARP packets to switches so that the switches learn incorrect ARP entries.
To defend against the preceding attacks, configure the following security policies on a switch:
ARP entry fixing
The switch supports the following ARP entry fixing modes, which are applicable to different scenarios and mutually exclusive:
Dynamic ARP Inspection (DAI)
A DAI-enabled switch matches the source IP address, source MAC address, interface number, and VLAN ID of a received ARP packet against a binding database. If the ARP packet matches an entry in the binding database, the switch considers the ARP packet valid and allows it to pass through. If the ARP packet does not match any entry, the switch considers the ARP packet as an attack packet and discards it. A binding database is dynamically generated using DHCP snooping or manually configured.
ARP gateway anti-collision
To prevent bogus gateway attacks, enable ARP gateway anti-collision on the gateway switch when user hosts directly connect to the gateway: If an ARP packet received by the switch meets either of the following conditions:
The switch considers that the ARP packet conflicts with the gateway address, generates an ARP anti-collision entry, and discards ARP packets with the same source MAC address and VLAN ID in a specified period. This prevents ARP packets with the bogus gateway address from being broadcast in a VLAN.
Gratuitous ARP packet discarding
After confirming that an attack is launched using gratuitous ARP packets, configure the gateway switch to discard gratuitous ARP packets.
Gratuitous ARP packet sending
Configure the gateway switch to send gratuitous ARP packets to periodically update the ARP entries of authorized users so that the ARP entries contain the correct gateway switch address.
MAC address consistency check in an ARP packet
The switch checks whether the source and destination MAC addresses in a received ARP packet are the same as those in the Ethernet frame header. If the source or destination MAC address in the ARP packet is different from that in the Ethernet frame header, the switch considers the ARP packet as an attack packet and discards it. If the MAC addresses are the same, the switch performs ARP learning. This effectively protects the network or switch against malformed ARP packet attacks.
ARP packet validity check
To prevent attacks by invalid ARP packets, enable ARP packet validity check on an access or gateway switch to filter out ARP packets with invalid IP or MAC addresses. The switch checks the validity of an ARP packet based on the following items that can be combined freely:
ARP gateway protection
Configure ARP gateway protection on the interface connecting the switch to the gateway to prevent attackers from forging the gateway.
Strict ARP learning
Configure strict ARP learning to enable the switch to learn only ARP entries for ARP Reply packets in response to ARP Request packets sent by itself. In this way, the switch can defend against most ARP attacks.
ARP learning triggered by DHCP
When many DHCP users connect to a gateway switch, the switch needs to learn and age many ARP entries, affecting switch performance. To address this issue, configure ARP learning triggered by DHCP on the gateway switch. When the DHCP server allocates an IP address for a user, the gateway switch generates an ARP entry for the user based on the DHCP ACK packet received on the VLANIF interface.
ARP proxy on a Virtual Private LAN Service (VPLS) network
To prevent bogus ARP packets at the Pseudo Wire (PW) side from being broadcast to the Attachment Circuit (AC) side on a VPLS network, enable ARP proxy over VPLS on a Provider Edge (PE).
Configure ARP entry fixing.
Enable ARP entry fixing and specify the fixed-mac mode.
<HUAWEI> system-view [HUAWEI] arp anti-attack entry-check fixed-mac enable //Configure ARP entry fixing globally or on a VLANIF interface as required.
Configure DAI.
<HUAWEI> system-view [HUAWEI] interface gigabitethernet 1/0/1 [HUAWEI-GigabitEthernet1/0/1] arp anti-attack check user-bind enable //Configure DAI in the interface or VLAN view as required.
Configure ARP gateway anti-collision.
Enable ARP gateway anti-collision.
<HUAWEI> system-view [HUAWEI] arp anti-attack gateway-duplicate enable
Configure gratuitous ARP packet discarding.
Enable the switch to actively discard gratuitous ARP packets globally.
<HUAWEI> system-view [HUAWEI] arp anti-attack gratuitous-arp drop //Configure gratuitous ARP packet discarding globally or on a VLANIF interface as required.
Configure gratuitous ARP packet sending.
Enable the switch to send gratuitous ARP packets on VLANIF 10.
<HUAWEI> system-view [HUAWEI] interface vlanif 10 [HUAWEI-Vlanif10] arp gratuitous-arp send enable //Configure gratuitous ARP packet sending globally or on a VLANIF interface as required.
Configure MAC address consistency check in an ARP packet.
<HUAWEI> system-view [HUAWEI] interface gigabitethernet 1/0/1 [HUAWEI-GigabitEthernet1/0/1] arp validate source-mac destination-mac
Configure ARP packet validity check.
Enable ARP packet validity check and configure the switch to check the source MAC address in an ARP packet.
<HUAWEI> system-view [HUAWEI] arp anti-attack packet-check sender-mac
Configure ARP gateway protection.
Enable ARP gateway protection on the GE1/0/1 interface and set the protected gateway IP address to 10.10.10.1.
<HUAWEI> system-view [HUAWEI] interface gigabitethernet 1/0/1 [HUAWEI-GigabitEthernet1/0/1] arp filter source 10.10.10.1
Configure strict ARP learning.
<HUAWEI> system-view [HUAWEI] interface vlanif 100 [HUAWEI-Vlanif100] arp learning strict force-enable //Configure strict ARP learning globally or on a VLANIF interface as required.
Configure ARP learning triggered by DHCP.
Enable ARP learning triggered by DHCP on VLANIF 100.
<HUAWEI> system-view [HUAWEI] vlan batch 100 [HUAWEI] dhcp enable [HUAWEI] interface vlanif 100 [HUAWEI-Vlanif100] arp learning dhcp-trigger
Configure ARP proxy on a VPLS network.
Enable ARP proxy on a VPLS network.
<HUAWEI> system-view [HUAWEI] dhcp enable [HUAWEI] dhcp snooping enable [HUAWEI] dhcp snooping over-vpls enable [HUAWEI] arp over-vpls enable