通过发送ARP协议报文测试网络
arping命令是用于发送arp请求到一个相邻主机的工具,arping使用arp数据包,通过ping命令检查设备上的硬件地址。能够测试一个ip地址是否是在网络上已经被使用,并能够获取更多设备信息。功能类似于ping。
arping [选项] [参数]
目的主机:指定发送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)
测试主机之间网络的连通性
ping命令用来测试主机之间网络的连通性。执行ping指令会使用ICMP传输协议,发出要求回应的信息,若远端主机的网络功能没有问题,就会回应该信息,因而得知该主机运作正常。
ping [选项] [参数]
目的主机:指定发送ICMP报文的目的主机。
[root@AY1307311912260196fcZ ~]# ping www.jsdig.com
PING host.1.jsdig.com (100.42.212.8) 56(84) bytes of data.
64 bytes from 100-42-212-8.static.webnx.com (100.42.212.8): icmp_seq=1 ttl=50 time=177 ms
64 bytes from 100-42-212-8.static.webnx.com (100.42.212.8): icmp_seq=2 ttl=50 time=178 ms
64 bytes from 100-42-212-8.static.webnx.com (100.42.212.8): icmp_seq=3 ttl=50 time=174 ms
64 bytes from 100-42-212-8.static.webnx.com (100.42.212.8): icmp_seq=4 ttl=50 time=177 ms
...按Ctrl+C结束
--- host.1.jsdig.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2998ms
rtt min/avg/max/mdev = 174.068/176.916/178.182/1.683 ms