在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
ping ping [ -LRUbdfnqrvR ] [ -c count ] [ -i wait ] [ -l preload ] [ -p pattern ] [ -s packetsize ] 参数 例1 复制代码 代码如下:[root@localhost ~]# ping baidu.com PING baidu.com (123.125.114.144) 56(84) bytes of data. 64 bytes from 123.125.114.144: icmp_seq=1 ttl=54 time=3.51 ms 64 bytes from 123.125.114.144: icmp_seq=2 ttl=54 time=6.03 ms --- baidu.com ping statistics --- 复制代码 代码如下:[root@localhost ~]# ping -c 5 -i 0.5 baidu.com PING baidu.com (123.125.114.144) 56(84) bytes of data. 64 bytes from 123.125.114.144: icmp_seq=1 ttl=54 time=2.92 ms 64 bytes from 123.125.114.144: icmp_seq=2 ttl=54 time=2.97 ms 64 bytes from 123.125.114.144: icmp_seq=3 ttl=54 time=2.99 ms 64 bytes from 123.125.114.144: icmp_seq=4 ttl=54 time=6.98 ms 64 bytes from 123.125.114.144: icmp_seq=5 ttl=54 time=3.14 ms --- baidu.com ping statistics --- 例2 例:-i 指定发送数据包时间间隔,-c 指定一共发送多少个数据包,-I 指定源地址,-q指定直接显示程序的启动和最后结果 复制代码 代码如下:# ping -i 0.2 -c 30 -I 192.168.10.208 180.149.132.47 -q PING 180.149.132.47 (180.149.132.47) from 192.168.10.208 : 56(84) bytes of data. --- 180.149.132.47 ping statistics --- arping -A ARP回复模式,更新邻居 例: 复制代码 代码如下:[root@Blackghost ~] arping 192.168.1.11 ARPING 192.168.1.11 from 192.168.1.6 eth0 Unicast reply from 192.168.1.11 [08:00:27:7e:b8:08] 2.780ms Unicast reply from 192.168.1.11 [08:00:27:7e:b8:08] 2.187m 例b,向指定主机发送ARP请求,当收到第一个包自动退出 复制代码 代码如下:[root@Blackghost ~] arping -f 192.168.1.11 Unicast reply from 192.168.1.11 [08:00:27:7e:b8:08] 3.080ms Sent 1 probes (1 broadcast(s)) Received 1 response(s) 例c,指定发送次数 复制代码 代码如下:[root@Blackghost ~] arping -c 4 192.168.1.11 Unicast reply from 192.168.1.11 [08:00:27:7e:b8:08] 3.080ms Unicast reply from 192.168.1.11 [08:00:27:7e:b8:08] 2.670ms Unicast reply from 192.168.1.11 [08:00:27:7e:b8:08] 1.850ms Unicast reply from 192.168.1.11 [08:00:27:7e:b8:08] 4.120ms Sent 4 probes (4 broadcast(s)) Received 4 response(s) |
请发表评论