系統(tǒng)之家 - 系統(tǒng)光盤(pán)下載網(wǎng)站!

當(dāng)前位置:系統(tǒng)之家 > 系統(tǒng)教程 > Linux中使用ping命令進(jìn)行網(wǎng)絡(luò)診斷

Linux系統(tǒng)中如何使用ping命令進(jìn)行網(wǎng)絡(luò)診斷(3)

時(shí)間:2014-12-29 17:28:18 作者:qipeng 來(lái)源:系統(tǒng)之家 1. 掃描二維碼隨時(shí)看資訊 2. 請(qǐng)使用手機(jī)瀏覽器訪問(wèn): https://m.xitongzhijia.net/xtjc/20141229/33672.html 手機(jī)查看 評(píng)論

  實(shí)例5:時(shí)間間隔和次數(shù)限制的ping

  命令:ping -c 10 -i 0.5 192.168.120.206

  輸出:

  代碼如下:

 。踨oot@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 ~]#

  實(shí)例6:通過(guò)域名ping公網(wǎng)上的站點(diǎn)

  命令: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 ~ #

  實(shí)例7:多參數(shù)使用

  命令: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

 。踨oot@localhost ~]#

  說(shuō)明:-i 3 發(fā)送周期為 3秒 -s 設(shè)置發(fā)送包的大小為1024 -t 設(shè)置TTL值為 255

  上面就是Linux下ping命令的具體用法的介紹了,如果你的網(wǎng)絡(luò)出了故障,又想知道是哪里出了問(wèn)題,可以使用ping命令進(jìn)行檢測(cè)。

標(biāo)簽 ping 命令

發(fā)表評(píng)論

0

沒(méi)有更多評(píng)論了

評(píng)論就這些咯,讓大家也知道你的獨(dú)特見(jiàn)解

立即評(píng)論

以上留言僅代表用戶個(gè)人觀點(diǎn),不代表系統(tǒng)之家立場(chǎng)

其他版本軟件

熱門(mén)教程

人氣教程排行

Linux系統(tǒng)推薦

官方交流群 軟件收錄