Linux arping :向相邻主机发送ARP请求

查看当前缓存ARP表:

arp -a


arping :向相邻主机发送ARP请求

语 法

arping[必要参数][选择参数][目的地址]
功 能
arping 命令: 在指定网卡上发送ARP请求指定地址,源地址 “-s” 参数指定,可用来直接 ping MAC 地址,以及找出那些 ip 地址被哪些电脑所使用了
类似命令:arp   ping   ping6   clockdiff   tracepath   cu   
相似命令:linux命令
执行权限:超级用户 普通用户
命令属性:网络通讯

 

参数
必要参数 

-A ARP回复模式,更新邻居
-b 保持广播
-D 复制地址检测模式
-f 得到第一个回复就 退出
-q 不显示警告信息
-U 主动的ARP模式,更新邻居


选择参数 

-c<数据包的数目> 发送的数据包的数目
-w<超时时间> 设置超时时间
-I<网卡> 使用指定的以太网设备,默认情况下使用eth0
-s 指定源IP地址
-h 显示帮助信息
-V 显示版本信息

 

范例



范例1 : 发送ARP请求 

[root@hnlinux ~]# arping 192.168.0.1 //向指定IP发送ARP请求
ARPING 192.168.0.1 from 192.168.0.3 eth0
Unicast reply from 192.168.0.1 [00:21:27:9E:36:66] 2.480ms
Unicast reply from 192.168.0.1 [00:21:27:9E:36:66] 2.387ms
Unicast reply from 192.168.0.1 [00:21:27:9E:36:66] 1.459ms
Unicast reply from 192.168.0.1 [00:21:27:9E:36:66] 1.494ms
Unicast reply from 192.168.0.1 [00:21:27:9E:36:66] 1.478ms
Unicast reply from 192.168.0.1 [00:21:27:9E:36:66] 2.414ms
Unicast reply from 192.168.0.1 [00:21:27:9E:36:66] 1.464ms
Unicast reply from 192.168.0.1 [00:21:27:9E:36:66] 1.501ms
Sent 8 probes (1 broadcast(s))
Received 8 response(s) //Ctrl+C 终止
[root@hnlinux ~]# 

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

[root@hnlinux ~]# arping -f 192.168.0.1
ARPING 192.168.0.1 from 192.168.0.3 eth0
Unicast reply from 192.168.0.1 [00:21:27:9E:36:66] 0.692ms
Sent 1 probes (1 broadcast(s))
Received 1 response(s)
[root@hnlinux ~]# 

范例3 : 指定发送次数


[root@hnlinux ~]# arping -c 3 192.168.0.1 //指定发送3次
ARPING 192.168.0.1 from 192.168.0.3 eth0
Unicast reply from 192.168.0.1 [00:21:27:9E:36:66] 0.662ms
Unicast reply from 192.168.0.1 [00:21:27:9E:36:66] 0.810ms
Unicast reply from 192.168.0.1 [00:21:27:9E:36:66] 1.491ms
Sent 3 probes (1 broadcast(s))
Received 3 response(s)
[root@hnlinux ~]#

 

范例3 : 主动更新邻居ARP缓存

[root@hnlinux ~]# arping -U -c 1 192.168.0.1


 

参考:http://www.lx138.com/page.php?ID=266


  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值