2024年11月Linux系统中如何使用ping命令进行网络诊断(3)

发布时间:

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

  ⑵命令:ping -c -i . ...

  ⑶[rootlocalhost ~]# ping -c -i . ...

  ⑷PING ... (... ( bytes of data.

  ⑸ bytes from ...: icmp_seq= ttl= time=. ms

  ⑹ bytes from ...: icmp_seq= ttl= time=. ms

  ⑺ bytes from ...: icmp_seq= ttl= time=. ms

  ⑻ bytes from ...: icmp_seq= ttl= time=. ms

  ⑼ bytes from ...: icmp_seq= ttl= time=. ms

  ⑽ bytes from ...: icmp_seq= ttl= time=. ms

  ⑾ bytes from ...: icmp_seq= ttl= time=. ms

  ⑿ bytes from ...: icmp_seq= ttl= time=. ms

  ⒀ bytes from ...: icmp_seq= ttl= time=. ms

  ⒁ bytes from ...: icmp_seq= ttl= time=. ms《/p》 《p》--- ... ping statistics ---

  ⒂ packets transmitted, received, % packet loss, time ms

  ⒃rtt min/avg/max/mdev = ./././. ms

  ⒄[rootlocalhost ~]# ping -c -i . ...

  ⒅PING ... (... ( bytes of data.

  ⒆ bytes from ...: icmp_seq= ttl= time=. ms

  ⒇ bytes from ...: icmp_seq= ttl= time=. ms

  ⒈ bytes from ...: icmp_seq= ttl= time=. ms

  ⒉ bytes from ...: icmp_seq= ttl= time=. ms

  ⒊ bytes from ...: icmp_seq= ttl= time=. ms

  ⒋ bytes from ...: icmp_seq= ttl= time=. ms

  ⒌ bytes from ...: icmp_seq= ttl= time=. ms

  ⒍ bytes from ...: icmp_seq= ttl= time=. ms

  ⒎ bytes from ...: icmp_seq= ttl= time=. ms

  ⒏ bytes from ...: icmp_seq= ttl= time=. ms《/p》 《p》--- ... ping statistics ---

  ⒐ packets transmitted, received, % packet loss, time ms

  ⒑rtt min/avg/max/mdev = ./././. ms

  ⒒[rootlocalhost ~]#

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

  ⒔命令:ping -c

  ⒕peida-VirtualBox ~ # ping -c

  ⒖PING (... ( bytes of data.

  ⒗ bytes from ...: icmp_req= ttl= time=. ms

  ⒘ bytes from ...: icmp_req= ttl= time=. ms

  ⒙ bytes from ...: icmp_req= ttl= time=. ms

  ⒚ bytes from ...: icmp_req= ttl= time=. ms

  ⒛ bytes from ...: icmp_req= ttl= time=. ms《/p》 《p》--- ping statistics ---

  ① packets transmitted, received, % packet loss, time ms

  ②rtt min/avg/max/mdev = ./././. ms

  ③peida-VirtualBox ~ #

  ④实例:多参数使用

  ⑤命令:ping -i -s -t ...

  ⑥[rootlocalhost ~]# ping -i -s -t ...

  ⑦PING ... (... ( bytes of data.

  ⑧ bytes from ...: icmp_seq= ttl= time=. ms

  ⑨ bytes from ...: icmp_seq= ttl= time=. ms

  ⑩ bytes from ...: icmp_seq= ttl= time=. ms

  Ⅰ bytes from ...: icmp_seq= ttl= time=. ms

  Ⅱ bytes from ...: icmp_seq= ttl= time=. ms

  Ⅲ bytes from ...: icmp_seq= ttl= time=. ms

  Ⅳ bytes from ...: icmp_seq= ttl= time=. ms

  Ⅴ bytes from ...: icmp_seq= ttl= time=. ms

  Ⅵ bytes from ...: icmp_seq= ttl= time=. ms

  Ⅶ bytes from ...: icmp_seq= ttl= time=. ms

  Ⅷ bytes from ...: icmp_seq= ttl= time=. ms

  Ⅸ bytes from ...: icmp_seq= ttl= time=. ms

  Ⅹ bytes from ...: icmp_seq= ttl= time=. ms

  ㈠ bytes from ...: icmp_seq= ttl= time=. ms

  ㈡ bytes from ...: icmp_seq= ttl= time=. ms《/p》 《p》--- ... ping statistics ---

  ㈢ packets transmitted, received, % packet loss, time ms

  ㈣rtt min/avg/max/mdev = ./././. ms

  ㈤[rootlocalhost ~]#

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

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