![linux基本命令示例](https://i-blog.csdnimg.cn/blog_migrate/e162eb9c99d17752fedd16f922f2c948.png)
linux基本命令示例
There are a lot of tools for network troubleshooting and debugging. Arping is one of them which only pings same network hosts. So what makes arping special is it uses network layer arp packets. This works on mac protocol. It is useful especially to find hosts those do not respond layer 3 and layer 4 ping requests.
有许多用于网络故障排除和调试的工具。 Arping是仅对相同网络主机执行ping操作的其中之一。 因此,使arping与众不同的是它使用网络层arp包。 这适用于mac协议。 查找不响应第3层和第4层ping请求的主机尤其有用。
为Debian,Ubuntu,Mint,Kali安装 (Install For Debian, Ubuntu, Mint, Kali)
We can install arping
command for Ubuntu, Debian, Mint, Kali with the arping
package name like below.
我们可以使用如下所示的arping
软件包名称为Ubuntu,Debian,Mint,Kali安装arping
命令。
$ sudo apt install arping -y
![Install](https://i-blog.csdnimg.cn/blog_migrate/c0bdc1a22354b6aabff50ba264f902f2.png)
为CentOS,Fedora,Red Hat安装(Install For CentOS, Fedora, Red Hat)
We can install arping
command for CentOS, Fedora, Red Hat with the arping
package name like below.
我们可以使用如下的arping
软件包名称为CentOS,Fedora,Red Hat安装arping
命令。
$ sudo yum install arping -y
帮忙 (Arping Help)
We can list help information and popular options with the -h
option like below.
我们可以使用-h
选项列出帮助信息和常用选项,如下所示。
$ arping -h
![Help](https://i-blog.csdnimg.cn/blog_migrate/bbbd2027cd7e1dbc7bfa4e3de7b88465.png)
For complete usage information please use --help
option.
有关完整的用法信息,请使用--help
选项。
$ apirng --help
![Arping Detailed Help and Usage Information](https://i-blog.csdnimg.cn/blog_migrate/dee39289a7ea7f453879d2f1525ed3f1.png)
平阿普(Ping Arp)
We will use arping command without providing any option. We will just provide the destination host IP address. In this example, we will ping the IP address 192.168.122.1
with the ARP packages.
我们将使用arping命令而不提供任何选项。 我们将只提供目标主机IP地址。 在此示例中,我们将使用ARP软件包ping IP地址192.168.122.1
。
$ sudo arping 192.168.122.1
![Ping Arp](https://i-blog.csdnimg.cn/blog_migrate/311e8eb3d0d24cc155ac9747433bf499.png)
From the responses to the ARP ping packets we can find the following information.
从对ARP ping数据包的响应中,我们可以找到以下信息。
- `index` is the index number of the current ping series which starts from 0 . “ index”是当前ping系列的索引号,从0开始。
- `time` is the time duration between sending ARP packet and getting a response which is generally around 10 milliseconds. “时间”是发送ARP数据包到获得响应之间的持续时间,通常为10毫秒左右。
设定计数 (Set Count)
We can set ping request count with -c
option. In the example, we will set the ping packet count to 2
.
我们可以使用-c
选项设置ping请求计数。 在示例中,我们将ping数据包计数设置为2
。
$ sudo arping -c 2 192.168.122.1
![Set Count](https://i-blog.csdnimg.cn/blog_migrate/006b0ea4f02bb22b7b8142c7e25b5063.png)
设置源地址(Set Source Address)
Source mac address can be set with -s
option. In the example, we will set aa:bb:cc:dd:ee:ff
as source mac address
可以使用-s
选项设置源mac地址。 在示例中,我们将aa:bb:cc:dd:ee:ff
为源mac地址
$ sudo arping -s aa:bb:cc:dd:ee:ff 192.168.122.1
![Set Source Address](https://i-blog.csdnimg.cn/blog_migrate/32c0c53156c0a769cc759eab79a609e3.png)
翻译自: https://www.poftut.com/arping-command-tutorial-examples-linux/
linux基本命令示例