linux ping3,Linux系统中如何使用ping命令进行网络诊断(3)

实例5:时间间隔和次数限制的ping

命令:ping -c 10 -i 0.5 192.168.120.206

输出:

代码如下:

[root@localhost ~]# ping -c 10 -i 0.5 192.168.120.206

PING 192.168.120.206 (192.168.120.206) 56(84) bytes of data.

64 bytes from 192.168.120.206: icmp_seq=1 ttl=64 time=1.24 ms

64 bytes from 192.168.120.206: icmp_seq=2 ttl=64 time=0.235 ms

64 bytes from 192.168.120.206: icmp_seq=3 ttl=64 time=0.244 ms

64 bytes from 192.168.120.206: icmp_seq=4 ttl=64 time=0.300 ms

64 bytes from 192.168.120.206: icmp_seq=5 ttl=64 time=0.255 ms

64 bytes from 192.168.120.206: icmp_seq=6 ttl=64 time=0.264 ms

64 bytes from 192.168.120.206: icmp_seq=7 ttl=64 time=0.263 ms

64 bytes from 192.168.120.206: icmp_seq=8 ttl=64 time=0.331 ms

64 bytes from 192.168.120.206: icmp_seq=9 ttl=64 time=0.247 ms

64 bytes from 192.168.120.206: icmp_seq=10 ttl=64 time=0.244 ms《/p》 《p》--- 192.168.120.206 ping statistics ---

10 packets transmitted, 10 received, 0% packet loss, time 4499ms

rtt min/avg/max/mdev = 0.235/0.362/1.241/0.294 ms

[root@localhost ~]# ping -c 10 -i 0.01 192.168.120.206

PING 192.168.120.206 (192.168.120.206) 56(84) bytes of data.

64 bytes from 192.168.120.206: icmp_seq=1 ttl=64 time=0.244 ms

64 bytes from 192.168.120.206: icmp_seq=2 ttl=64 time=0.195 ms

64 bytes from 192.168.120.206: icmp_seq=3 ttl=64 time=0.219 ms

64 bytes from 192.168.120.206: icmp_seq=4 ttl=64 time=0.204 ms

64 bytes from 192.168.120.206: icmp_seq=5 ttl=64 time=3.56 ms

64 bytes from 192.168.120.206: icmp_seq=6 ttl=64 time=1.93 ms

64 bytes from 192.168.120.206: icmp_seq=7 ttl=64 time=0.193 ms

64 bytes from 192.168.120.206: icmp_seq=8 ttl=64 time=0.193 ms

64 bytes from 192.168.120.206: icmp_seq=9 ttl=64 time=0.202 ms

64 bytes from 192.168.120.206: icmp_seq=10 ttl=64 time=0.211 ms《/p》 《p》--- 192.168.120.206 ping statistics ---

10 packets transmitted, 10 received, 0% packet loss, time 90ms

rtt min/avg/max/mdev = 0.193/0.716/3.564/1.080 ms

[root@localhost ~]#

实例6:通过域名ping公网上的站点

命令:ping -c 5 www.58.com

输出:

代码如下:

peida-VirtualBox ~ # ping -c 5 www.58.com

PING www.58.com (211.151.111.30) 56(84) bytes of data.

64 bytes from 211.151.111.30: icmp_req=1 ttl=49 time=14.7 ms

64 bytes from 211.151.111.30: icmp_req=2 ttl=49 time=16.4 ms

64 bytes from 211.151.111.30: icmp_req=3 ttl=49 time=15.2 ms

64 bytes from 211.151.111.30: icmp_req=4 ttl=49 time=14.6 ms

64 bytes from 211.151.111.30: icmp_req=5 ttl=49 time=19.9 ms《/p》 《p》--- www.58.com ping statistics ---

5 packets transmitted, 5 received, 0% packet loss, time 20101ms

rtt min/avg/max/mdev = 14.618/16.192/19.917/1.965 ms

peida-VirtualBox ~ #

实例7:多参数使用

命令:ping -i 3 -s 1024 -t 255 192.168.120.206

输出:

代码如下:

[root@localhost ~]# ping -i 3 -s 1024 -t 255 192.168.120.206

PING 192.168.120.206 (192.168.120.206) 1024(1052) bytes of data.

1032 bytes from 192.168.120.206: icmp_seq=1 ttl=64 time=1.99 ms

1032 bytes from 192.168.120.206: icmp_seq=2 ttl=64 time=0.694 ms

1032 bytes from 192.168.120.206: icmp_seq=3 ttl=64 time=0.300 ms

1032 bytes from 192.168.120.206: icmp_seq=4 ttl=64 time=0.481 ms

1032 bytes from 192.168.120.206: icmp_seq=5 ttl=64 time=0.415 ms

1032 bytes from 192.168.120.206: icmp_seq=6 ttl=64 time=0.600 ms

1032 bytes from 192.168.120.206: icmp_seq=7 ttl=64 time=0.411 ms

1032 bytes from 192.168.120.206: icmp_seq=8 ttl=64 time=0.281 ms

1032 bytes from 192.168.120.206: icmp_seq=9 ttl=64 time=0.318 ms

1032 bytes from 192.168.120.206: icmp_seq=10 ttl=64 time=0.362 ms

1032 bytes from 192.168.120.206: icmp_seq=11 ttl=64 time=0.408 ms

1032 bytes from 192.168.120.206: icmp_seq=12 ttl=64 time=0.445 ms

1032 bytes from 192.168.120.206: icmp_seq=13 ttl=64 time=0.397 ms

1032 bytes from 192.168.120.206: icmp_seq=14 ttl=64 time=0.406 ms

1032 bytes from 192.168.120.206: icmp_seq=15 ttl=64 time=0.458 ms《/p》 《p》--- 192.168.120.206 ping statistics ---

15 packets transmitted, 15 received, 0% packet loss, time 41999ms

rtt min/avg/max/mdev = 0.281/0.531/1.993/0.404 ms

[root@localhost ~]#

说明:-i 3 发送周期为 3秒 -s 设置发送包的大小为1024 -t 设置TTL值为 255

上面就是Linux下ping命令的具体用法的介绍了,如果你的网络出了故障,又想知道是哪里出了问题,可以使用ping命令进行检测。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值