ping [ -d] [ -D ] [ -n ] [ -q ] [ -r] [ -v] [ \ -R ] [ -a addr_family ] [ -c Count ] [ -w timeout ] [ -f | -i \ Wait ] [ -l Preload ] [ -p Pattern ] [ -s PacketSize ] [ -S hostname/IP addr ] \ [ -L ] [ - I a.b.c.d. ] [ -o interface ] [ -T ttl ] Host [ PacketSize ] \ [ Count ]
/usr/sbin/ping 命令发送一个因特网控制报文协议(ICMP) ECHO_REQUEST 去从主机或网关那里获得 ICMP ECHO_RESPONSE 信号。ping 命令用于:
如果主机正在运行并连在网上,它就对回送信号进行响应。每个回送信号请求包含一个网际协议(IP)和 ICMP 头,后面紧跟一个 timeval 结构,以及来填写这个信息包的足够的字节。缺省情况是连续发送回送信号请求直到接收到中断信号(Ctrl-C)。
ping 命令每秒发送一个数据报并且为每个接收到的响应打印一行输出。ping 命令计算信号往返时间和(信息)包丢失情况的统计信息,并且在完成之后显示一个简要总结。ping 命令在程序超时或当接收到 SIGINT 信号时结束。Host 参数或者是一个有效的主机名或者是因特网地址。
缺省情况下,ping 命令将连续发送回送信号请求到显示器直到接收到中断信号(Ctrl-C). 中断键可以使用 stty 命令来更改。
由于连续回送信号请求会对系统造成一定的负载,重复的请求信号应当主要用作问题隔离。
PacketSize | 指定了要发送数据的字节数。缺省值是 56,当和 8 字节的 ICMP 头数据合并时被转换成 64 字节的 ICMP 数据。包含这个参数是为了和以前的 ping 命令版本相兼容。 |
Count | 指定了要发送(接收)的回送信号请求的数目。 包含这个参数是为了和以前的 ping 命令版本相兼容。 |
PING canopus.austin.century.com: (128.116.1.5): 56 data bytes 64 bytes from 128.116.1.5: icmp_seq=0 ttl=255 time=2 ms 64 bytes from 128.116.1.5: icmp_seq=1 ttl=255 time=2 ms 64 bytes from 128.116.1.5: icmp_seq=2 ttl=255 time=3 ms 64 bytes from 128.116.1.5: icmp_seq=3 ttl=255 time=2 ms 64 bytes from 128.116.1.5: icmp_seq=4 ttl=255 time=2 ms ----canopus.austin.century.com PING Statistics---- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max = 2/2/3 ms
PING lear.austin.century.com: (128.114.4.18) 56 data bytes 64 bytes from 128.114.4.18: icmp_seq=0 ttl=255 time=6 ms 64 bytes from 128.114.4.18: icmp_seq=1 ttl=255 time=17 ms 64 bytes from 128.114.4.18: icmp_seq=2 ttl=255 time=6 ms 64 bytes from 128.114.4.18: icmp_seq=3 ttl=255 time=6 ms 64 bytes from 128.114.4.18: icmp_seq=4 ttl=255 time=6 ms ^C ----lear.austin.century.com PING Statistics ---- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max = 6/8/17 ms
注: 输出将一直重复直到接收到中断信号(Ctrl-C)。
PING opus.austin.century.com: (129.35.34.234): 2000 data bytes 2008 bytes from 129.35.34.234: icmp_seq=0 ttl=255 time=20 ms 2008 bytes from 129.35.34.234: icmp_seq=1 ttl=255 time=19 ms 2008 bytes from 129.35.34.234: icmp_seq=2 ttl=255 time=20 ms 2008 bytes from 129.35.34.234: icmp_seq=3 ttl=255 time=20 ms 2008 bytes from 129.35.34.234: icmp_seq=4 ttl=255 time=20 ms 2008 bytes from 129.35.34.234: icmp_seq=5 ttl=255 time=19 ms 2008 bytes from 129.35.34.234: icmp_seq=6 ttl=255 time=19 ms ^C ----opus.austin.century.com PING Statistics---- 7 packets transmitted, 7 packets received, 0% packet loss round-trip min/avg/max = 19/19/20 ms
注: 输出将一直重复直到接收到中断信号 (Ctrl-C)。
Ping stlopnor.austin.century.com: (129.35.34.234): 56 data bytes .^C ----stlopnor.austin.century.com PING Statistics ---- 1098 packets transmitted, 1097 packets received, 0% packet loss round-trip min/avg/max = 4/4/11
注: flood-ping 命令的输出将一直重复,直到接收到中断信号(Ctrl-C)。
PING opus.austin.century.com: (129.35.34.234): 56 data bytes 64 bytes from 129.35.34.234: icmp_seq=0 ttl=255 time=5 ms 64 bytes from 129.35.34.234: icmp_seq=1 ttl=255 time=5 ms 64 bytes from 129.35.34.234: icmp_seq=2 ttl=255 time=6 ms ^C ----opus.austin.century.com PING Statistics---- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max = 5/5/6 ms
注: 输出将一直重复,直到接收到中断信号(Ctrl-C)。
PING opus.austin.century.com: (129.35.34.234): 56 data bytes 64 bytes from 129.35.34.234: icmp_seq=0 ttl=255 time=9 ms 64 bytes from 129.35.34.234: icmp_seq=1 ttl=255 time=11 ms 64 bytes from 129.35.34.234: icmp_seq=2 ttl=255 time=16 ms 64 bytes from 129.35.34.234: icmp_seq=3 ttl=255 time=22 ms 64 bytes from 129.35.34.234: icmp_seq=4 ttl=255 time=26 ms 64 bytes from 129.35.34.234: icmp_seq=5 ttl=255 time=27 ms 64 bytes from 129.35.34.234: icmp_seq=6 ttl=255 time=30 ms 64 bytes from 129.35.34.234: icmp_seq=7 ttl=255 time=31 ms 64 bytes from 129.35.34.234: icmp_seq=8 ttl=255 time=33 ms 64 bytes from 129.35.34.234: icmp_seq=9 ttl=255 time=35 ms 64 bytes from 129.35.34.234: icmp_seq=10 ttl=255 time=36 ms 64 bytes from 129.35.34.234: icmp_seq=11 ttl=255 time=6 ms 64 bytes from 129.35.34.234: icmp_seq=12 ttl=255 time=6 ms 64 bytes from 129.35.34.234: icmp_seq=13 ttl=255 time=6 ms 64 bytes from 129.35.34.234: icmp_seq=14 ttl=255 time=7 ms 64 bytes from 129.35.34.234: icmp_seq=15 ttl=255 time=6 ms ^C ----opus.austin.century.com PING Statistics---- 16 packets transmitted, 16 packets received, 0% packet loss round-trip min/avg/max = 6/19/36 ms
注: 输出将一直重复,直到接收到中断信号(Ctrl-C)。
PATTERN: 0xff PING opus.austin.century.com: (129.35.34.234): 56 data bytes 64 bytes from 129.35.34.234: icmp_seq=0 ttl=255 time=5 ms 64 bytes from 129.35.34.234: icmp_seq=1 ttl=255 time=5 ms 64 bytes from 129.35.34.234: icmp_seq=2 ttl=255 time=5 ms 64 bytes from 129.35.34.234: icmp_seq=3 ttl=255 time=6 ms 64 bytes from 129.35.34.234: icmp_seq=4 ttl=255 time=5 ms ^C ----opus.austin.century.com PING Statistics---- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max = 5/5/6 ms
注: 输出将一直重复,直到接收到中断信号(Ctrl-C)。
PING bach.austin.century.com: (129.35.34.234): 56 data bytes ^C ----bach.austin.century.com PING Statistics---- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max = 5/5/8 ms
注: 虽然没有显示,信息包的输出将一直继续,直到接收到中断信号(Ctrl-C)。
《AIX 5L V5.2 系统管理指南:通信与网络》中的『网络概述』。