語 法
arping[必要參數][選擇參數][目的位址]
功 能
arping 指令: 在指定網卡上發送ARP請求指定位址,源位址 “-s” 參數指定,可用來直接 ping MAC 位址,以及找出那些 ip 位址被哪些電腦所使用了
類似指令:
相似指令:
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
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)
範例3 : 指定發送次數
[root@hnlinux ~]# arping -c 3 192.168.0.1 //指定發送3次
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 ~]#
本文轉自feisky部落格園部落格,原文連結:http://www.cnblogs.com/feisky/archive/2011/11/20/2256587.html,如需轉載請自行聯系原作者