arping
是检测 ARP 协议的重要命令
安装
apt install arping
help
$ arping --help
ARPing 2.20, by Thomas Habets <thomas@habets.se>
usage: arping [ -0aAbdDeFpPqrRuUv ] [ -w <sec> ] [ -W <sec> ] [ -S <host/ip> ]
[ -T <host/ip ] [ -s <MAC> ] [ -t <MAC> ] [ -c <count> ]
[ -C <count> ] [ -i <interface> ] [ -m <type> ] [ -g <group> ]
[ -V <vlan> ] [ -Q <priority> ] <host/ip/MAC | -B>
demo
$ arping 172.20.0.1
# 检查一次
$ arping -c 1 172.20.0.1
ARPING 172.20.0.1
60 bytes from 3a:f9:d3:81:3c:65 (172.20.0.1): index=0 time=184.555 usec
--- 172.20.0.1 statistics ---
1 packets transmitted, 1 packets received, 0% unanswered (0 extra)
rtt min/avg/max/std-dev = 0.185/0.185/0.185/0.000 ms
# 指定网卡
$ arping -i ens38 -c 1 172.20.0.1
ARPING 172.20.0.1
60 bytes from 3a:f9:d3:81:3c:65 (172.20.0.1): index=0 time=200.574 usec
--- 172.20.0.1 statistics ---
1 packets transmitted, 1 packets received, 0% unanswered (0 extra)
rtt min/avg/max/std-dev = 0.201/0.201/0.201/0.000 ms
# 查看指定IP是否被不同的MAC占用
$ arping -d 172.20.0.1
# 查看指定MAC地址的IP
$ arping -i ens38 3a:f9:d3:81:3c:65