开源是一种精神,分享是一种美德!

arping

相关命令:ping
arping 命令: 在指定网卡上发送ARP请求指定地址,源地址 “-s” 参数指定,可用来直接 ping MAC 地址,以及找出那些 ip 地址被哪些电脑所使用了

-A ARP回复模式,更新邻居
-b 保持广播
-D 复制地址检测模式
-f 得到第一个回复就 退出
-q 不显示警告信息
-U 主动的ARP模式,更新邻居
-c <数据包的数目> 发送的数据包的数目
-w <超时时间> 设置超时时间
-I <网卡> 使用指定的以太网设备,默认情况下使用eth0
-s 指定源IP地址
-h 显示帮助信息
-V 显示版本信息

例a,指定IP发送ARP请求

[root@Blackghost ~] arping 192.168.1.11
ARPING 192.168.1.11 from 192.168.1.6 eth0
Unicast reply from 192.168.1.11 [08:00:27:7e:b8:08] 2.780ms
Unicast reply from 192.168.1.11 [08:00:27:7e:b8:08] 2.187m

例b,向指定主机发送ARP请求,当收到第一个包自动退出

[root@Blackghost ~] arping -f 192.168.1.11
Unicast reply from 192.168.1.11 [08:00:27:7e:b8:08] 3.080ms
Sent 1 probes (1 broadcast(s))
Received 1 response(s)      

例c,指定发送次数

[root@Blackghost ~] arping -c 4 192.168.1.11
Unicast reply from 192.168.1.11 [08:00:27:7e:b8:08] 3.080ms
Unicast reply from 192.168.1.11 [08:00:27:7e:b8:08] 2.670ms
Unicast reply from 192.168.1.11 [08:00:27:7e:b8:08] 1.850ms
Unicast reply from 192.168.1.11 [08:00:27:7e:b8:08] 4.120ms
Sent 4 probes (4 broadcast(s))
Received 4 response(s)   
 

# arping -I eth1 -c 1 192.168.131.155   #当有多块网卡的时候,指定特定的设备来发送请求包

# arping -d 192.168.131.155  #查看某个IP是否被不同的MAC占用

# arping -c 1 52:54:00:a1:31:89    #查看某个MAC地址的IP,要在同一子网才查得到

 

确定MAC和IP的对应,确定指定的网卡绑定了指定的IP
# arping -c 1  -T 192.168.131.156  00:13:72:f9:ca:60

确定IP和MAC对应,确定指定IP绑在了指定的网卡上

# arping -c 1  -t  00:13:72:f9:ca:60 192.168.131.156

有时候,本地查不到某主机,可以通过让网关或别的机器去查。以下几种形式测了下都可以

# arping -c 1  -S 10.240.160.1 -s 88:5a:92:12:c1:c1  10.240.162.115
# arping -c 1  -S 10.240.160.1   10.240.162.115
# arping -c 1  -s 88:5a:92:12:c1:c1  10.240.162.115

评论(0)

暂无评论

评论

名字:
验证码:
获取验证码
内容: