Example for Configuring Defense Against ARP MITM Attacks
Networking Requirements
As shown in Figure 10-9, the users of a department access the Internet through SwitchA. Among the users connected to SwitchA, some users obtain IP addresses through DHCP and some users are allocated static IP addresses. All users are in the same VLAN as the DHCP server. If attackers initiate MITM attacks, the data of authorized users will leak; therefore, the administrator requires that SwitchA can prevent MITM attacks.
CE12800E does not support the example after having the ED-E, EG-E, and EGA-E series cards installed.
Configuration Roadmap
- Configure the DHCP snooping function so that the device can generate the address and port binding entries for dynamic users and the binding entries can be manually configured for static users. These binding entries are used for ARP packet validity check.
- Enable DAI so that SwitchA compares the source IP address, source MAC address, VLAN ID, and interface number of the ARP packet with DHCP snooping binding entries and filter out invalid packets. This prevents ARP MITM attacks.
Procedure
- Create a VLAN and add interfaces to the VLAN.
# Create VLAN 10, and add 10GE1/0/1, 10GE1/0/2, 10GE1/0/3, and 10GE2/0/1 to VLAN 10.
<HUAWEI> system-view [~HUAWEI] sysname SwitchA [*HUAWEI] commit [~SwitchA] vlan batch 10
[*SwitchA] interface 10ge 1/0/1 [*SwitchA-10GE1/0/1] port link-type access [*SwitchA-10GE1/0/1] port default vlan 10 [*SwitchA-10GE1/0/1] quit
[*SwitchA] interface 10ge 1/0/2 [*SwitchA-10GE1/0/2] port link-type access [*SwitchA-10GE1/0/2] port default vlan 10 [*SwitchA-10GE1/0/2] quit
[*SwitchA] interface 10ge 1/0/3 [*SwitchA-10GE1/0/3] port link-type access [*SwitchA-10GE1/0/3] port default vlan 10 [*SwitchA-10GE1/0/3] quit
[*SwitchA] interface 10ge 2/0/1 [*SwitchA-10GE2/0/1] port link-type trunk [*SwitchA-10GE2/0/1] port trunk allow-pass vlan 10 [*SwitchA-10GE2/0/1] quit
- Configure DHCP snooping.
# Enable DHCP snooping globally.
[*SwitchA] dhcp enable [*SwitchA] dhcp snooping enable
# Enable DHCP snooping in VLAN 10.
[*SwitchA] vlan 10 [*SwitchA-vlan10] dhcp snooping enable [*SwitchA-vlan10] quit
# Configure 10GE2/0/1 as a trusted interface.
[*SwitchA] interface 10ge 2/0/1 [*SwitchA-10GE2/0/1] dhcp snooping trusted [*SwitchA-10GE2/0/1] quit
# Configure a static binding table.
[*SwitchA] user-bind static ip-address 10.0.0.2 mac-address 0001-0001-0001 interface 10ge 1/0/3 vlan 10 [*SwitchA] commit
- Enable DAI in VLAN 10.
[*SwitchA] vlan 10 [*SwitchA-vlan10] arp anti-attack check user-bind enable [*SwitchA-vlan10] commit
- Verify the configuration.
Run the display current-configuration command to view the configuration of the DHCP Snooping, static binding table, and DAI function. For details, see configuration files.
Configuration File
Configuration file of SwitchA
# sysname SwitchA # vlan batch 10 # dhcp enable # dhcp snooping enable # user-bind static ip-address 10.0.0.2 mac-address 0001-0001-0001 interface 10GE1/0/3 vlan 10 # vlan 10 dhcp snooping enable arp anti-attack check user-bind enable # interface 10GE1/0/1 port default vlan 10 # interface 10GE1/0/2 port default vlan 10 # interface 10GE1/0/3 port default vlan 10 # interface 10GE2/0/1 port link-type trunk port trunk allow-pass vlan 10 dhcp snooping trusted # return