語(yǔ) 法
arping[必要參數(shù)][選擇參數(shù)][目的地址]功 能
arping 命令: 在指定網(wǎng)卡上發(fā)送ARP請(qǐng)求指定地址,源地址 “-s” 參數(shù)指定,可用來(lái)直接 ping MAC 地址,以及找出那些 ip 地址被哪些電腦所使用了類(lèi)似命令: arp ping ping6 clockdiff tracepath cu
相似命令: linux命令
執(zhí)行權(quán)限: 超級(jí)用戶 普通用戶
命令屬性: 網(wǎng)絡(luò)通訊
參數(shù)
必要參數(shù)
-A ARP回復(fù)模式,更新鄰居
-b 保持廣播
-D 復(fù)制地址檢測(cè)模式
-f 得到第一個(gè)回復(fù)就 退出
-q 不顯示警告信息
-U 主動(dòng)的ARP模式,更新鄰居
選擇參數(shù)
-c<數(shù)據(jù)包的數(shù)目> 發(fā)送的數(shù)據(jù)包的數(shù)目
-w<超時(shí)時(shí)間> 設(shè)置超時(shí)時(shí)間
-I<網(wǎng)卡> 使用指定的以太網(wǎng)設(shè)備,默認(rèn)情況下使用eth0
-s 指定源IP地址
-h 顯示幫助信息
-V 顯示版本信息
范例
范例1 : 發(fā)送ARP請(qǐng)求
[root@hnlinux ~]# arping 192.168.0.1 //向指定IP發(fā)送ARP請(qǐng)求
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 : 向指定主機(jī)發(fā)送ARP請(qǐng)求,當(dāng)收到第一個(gè)包自動(dòng)退出
[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 : 指定發(fā)送次數(shù)
[root@hnlinux ~]# arping -c 3 192.168.0.1 //指定發(fā)送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 ~]#