You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
2.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

arping
===
通过发送ARP协议报文测试网络
## 补充说明
**arping命令** 是用于发送arp请求到一个相邻主机的工具arping使用arp数据包通过ping命令检查设备上的硬件地址。能够测试一个ip地址是否是在网络上已经被使用并能够获取更多设备信息。功能类似于ping。
### 语法
```
arping(选项)(参数)
```
### 选项
```
-b用于发送以太网广播帧FFFFFFFFFFFF。arping一开始使用广播地址在收到响应后就使用unicast地址。
-qquiet output不显示任何信息
-f表示在收到第一个响应报文后就退出
-w timeout设定一个超时时间单位是秒。如果到了指定时间arping还没到完全收到响应则退出
-c count表示发送指定数量的ARP请求数据包后就停止。如果指定了deadline选项则arping会等待相同数量的arp响应包直到超时为止
-s source设定arping发送的arp数据包中的SPA字段的值。如果为空则按下面处理如果是DAD模式冲突地址探测则设置为0.0.0.0如果是Unsolicited ARP模式Gratutious ARP则设置为目标地址否则从路由表得出
-I interface设置ping使用的网络接口。
```
### 参数
目的主机指定发送ARP报文的目的主机。
### 实例
```
[root@localhost ~]# arping www.baidu.com
ARPING 220.181.111.147 from 173.231.43.132 eth0
Unicast reply from 220.181.111.147 00:D0:03:[bc:48:00] 1.666ms
Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00] 1.677ms
Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00] 1.691ms
Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00] 1.728ms
Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00] 1.626ms
Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00] 1.292ms
Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00] 1.429ms
Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00] 2.042ms
Sent 8 probes (1 broadcast(s))
Received 8 response(s)
```
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->