内网出现“网关 MAC 变了”“部分用户突然断网”“ARP 表里同一 IP 对应多个 MAC”,怀疑 ARP 欺骗或中间人攻击。Dynamic ARP Inspection(DAI)用 DHCP snooping 绑定表校验 ARP,但配置不当会连正常网关和静态设备一起误伤。
DAI 在启用的 VLAN 内检查 ARP 请求和应答,将 ARP 报文中的发送方 MAC/IP 与 DHCP snooping 绑定表或 ARP ACL 比对,不匹配就丢弃。非信任端口执行检查,信任端口(上联、网关、合法服务器)直接放行;因此信任口画得过大,防护会形同虚设。
Cisco 还可开启 src-mac、dst-mac、ip 校验,其中 dst-mac 对某些老设备或代理 ARP 兼容性较差,建议先在测试 VLAN 验证。静态 IP、VRRP/HSRP 虚拟地址、负载均衡 VIP 不在 DHCP 绑定表中,必须用 ARP ACL 或静态绑定放行。
变更影响与回滚:在已有静态地址、虚拟网关或代理 ARP 的 VLAN 上直接启用 DAI,可能把网关和服务器 ARP 丢掉,导致整段断网。先在单个 VLAN 灰度、保留 Console、准备 ARP ACL;回滚是 no ip arp inspection vlan 10(Cisco)或关闭对应 VLAN 的检测功能。
# Cisco IOS
ip arp inspection vlan 10
interface GigabitEthernet1/0/24
ip arp inspection trust
ip arp inspection validate src-mac dst-mac ip
arp access-list STATIC-HOSTS
permit ip host 192.0.2.50 mac host 0000.5e00.5301
ip arp inspection filter STATIC-HOSTS vlan 10
show ip arp inspection
show ip arp inspection statistics vlan 10
show ip dhcp snooping binding
# Huawei VRP(等价能力,依赖 DHCP snooping,以设备版本为准)
interface GigabitEthernet0/0/1
arp anti-attack check user-bind enable
display arp anti-attack statistics
# H3C Comware
vlan 10
arp detection enable
interface GigabitEthernet1/0/24
arp detection trust
display arp detection statistics
# Juniper Junos(EX ELS,以设备版本为准)
set vlans users forwarding-options dhcp-security arp-inspection
show arp inspection statistics
排障时先看 DAI 丢包计数和日志,再核对绑定表里是否有对应 MAC-IP;如果绑定表为空,DAI 没有判断依据,会丢弃大量 ARP。Huawei/H3C/Juniper 的功能名称和命令随平台版本差异较大,Junos ELS 如上,非 ELS 老版本走 ethernet-switching-options secure-access-port,配置前查对应版本文档。
dst-mac 校验后老设备或代理 ARP 不兼容,出现间歇性丢包。
小程序版
微信扫码,随时查命令