arping命令 – 向邻近主机发送ARP请求报文
使用ARP应答数据包代替ARP请求数据包) | | ---- | -------------------------------------------------------------- | | -b | 仅发送MAC级广播 | | -c | 发送指定个数ARP请求数据包后停止 | | -D | 重复地址检测模式(DAD) | | -f | 在第一个回复确认目标存活后退出命令 | | -h | 打印帮助手册并退出 | | -I | 指定ARP请求报文的网络接口 | | -q | 安静模式。不显示任何信息 | | -s | 指定发送ARP请求数据包的源IP地址 | | -U | 更新邻近主机的ARP缓存 | **参考实例** 测试目标主机的存活状态: ``` [root@anycode ~]# arping -f 192.168.60.1 ARPING 192.168.60.1 from 192.168.60.149 ens192 Unicast reply from 192.168.60.1 [00:03:0F:81:6B:F1] 1.995ms Sent 1 probes (1 broadcast(s)) Received 1 response(s) ``` 向目标主机发送3次(指定次数)ARP请求报文: ``` [root@anycode ~]# arping -c 3 192.168.60.1 ARPING 192.168.60.1 from 192.168.60.149 ens192 Unicast reply from 192.168.60.1 [00:03:0F:81:6B:F1] 1.813ms Unicast reply from 192.168.60.1 [00:03:0F:81:6B:F1] 1.850ms Unicast reply from 192.168.60.1 [00:03:0F:81:6B:F1] 1.816ms Sent 3 probes (1 broadcast(s)) Received 3 response(s) ``` 使用指定网口发送指定次数ARP请求报文后自动退出命令: ``` [root@anycode ~]# arping -I ens192 -c 2 192.168.60.1 ARPING 192.168.60.1 from 192.168.60.149 ens192 Unicast reply from 192.168.60.1 [00:03:0F:81:6B:F1] 1.861ms Unicast reply from 192.168.60.1 [00:03:0F:81:6B:F1] 1.921ms Sent 2 probes (1 broadcast(s)) Received 2 response(s) ```