当网络遭遇ARP欺骗攻击时,通常会出现以下三种典型症状。作为网络管理员,我经常通过这些特征快速判断攻击情况:
最直观的表现就是设备能够连接局域网但无法访问外网。具体表现为:
这种情况特别具有迷惑性,因为很多用户会误以为是外网故障。实际上,这是由于攻击者伪造了网关ARP响应,导致你的数据包被发送到了错误的MAC地址。
实战经验:遇到这种情况时,我会先用tracert命令测试路由路径。如果数据包在网关处就断了,极可能是ARP欺骗。
通过arp -a命令可以观察到:
我在实际排查中会建立一个基准数据库,记录所有关键网络设备的合法MAC地址。这样在排查时就能快速比对异常。
使用Wireshark等工具抓包时,会观察到:
下图是我在一次实际攻击排查中的抓包截图,可以看到攻击者(00:0c:29...)在持续发送伪造的ARP响应:

这是最直接有效的防御方法,我推荐所有重要主机都进行配置。具体步骤:
bash复制# Linux/macOS
ip route show | grep default
# Windows
route print
bash复制# Windows
arp -d *
# Linux
ip neigh flush all
bash复制# Windows
arp -a
# Linux
arp -n 或 ip neigh
bash复制# Windows
arp -s 网关IP 网关MAC
# Linux
arp -i eth0 -s 网关IP 网关MAC
重要提示:静态绑定在系统重启后会失效。要使绑定永久生效:
- Windows:创建开机脚本
- Linux:写入/etc/ethers文件并启用arpd服务
我推荐使用专业的ARP防护工具如ArpON。以下是详细安装配置指南:
bash复制sudo apt update
sudo apt install arpon -y
bash复制arpon --version
bash复制sudo arpon -d -i eth0 -s
参数说明:
ini复制# 监控网卡
interface = eth0
# 防护模式
mode = hybrid
# 日志记录
logfile = /var/log/arpon.log
bash复制sudo systemctl enable arpon
sudo systemctl start arpon
在企业网络中,我通常会配置交换机的端口安全功能:
cisco复制interface GigabitEthernet0/1
switchport port-security
switchport port-security maximum 2
switchport port-security mac-address xxxx.xxxx.xxxx
switchport port-security violation restrict
cisco复制ip arp inspection vlan 10
ip arp inspection validate src-mac dst-mac ip
cisco复制ip dhcp snooping vlan 10
ip dhcp snooping trust
cisco复制access-list 110 deny arp any any
access-list 110 permit arp host 合法网关 any
access-list 110 permit arp any host 合法网关
bash复制sudo apt install arpwatch
sudo systemctl start arpwatch
python复制#!/usr/bin/env python3
import os
import time
LEGAL_GATEWAY = "00:11:22:33:44:55"
def check_arp():
result = os.popen("arp -a").read()
if LEGAL_GATEWAY not in result:
alert_admin()
while True:
check_arp()
time.sleep(60)
当检测到ARP欺骗攻击时,我的标准响应流程:
bash复制arpspoof -i eth0 -t 目标IP 网关IP
在实际网络管理中,ARP欺骗防御需要结合技术手段和管理制度。我建议至少部署三层防御:终端静态绑定、网络设备防护和实时监控告警。对于特别重要的网络环境,还可以考虑部署专业的网络安全防护系统。