ping

Syntax

ping  [data-fill <模式> |Datagram-Size  |间隔

Description

在带有或没有可选参数的情况下,指定的IPv4地址或主机名ping。

Command context

Operator (>)or Manager (

参数

Selects the IPv4 address to ping.

Selects the hostname to ping. Range: 1-256 characters

data-fill

指定要发送的十六进制数字中的数据模式。最多可以指定16个“垫”字节以填写ICMP数据包。默认值:ab

datagram-size

Specifies the ping datagram size. Range: 0-65399, default: 100.

interval

Specifies the interval between successive ping requests in seconds. Range: 1-60 seconds, default: 1 second.

重复<数字>

Specifies the number of packets to send. Range: 1-10000 packets, default: Five packets.

timeout

在几秒钟内指定ping超时。范围:1-60秒,默认值:2秒。

tos<数字>

指定要在Ping请求中使用的IP类型。范围:0-255

ip-option [include-timestamp | include-timestamp-and-address | record-route]

Specifies an IP option (record-routeortimestamp选项)。

include-timestamp

指定中间路由器时间戳。

include-timestamp-and-address

Specifies the intermediate router time stamp and IP address.

record-route

指定中间路由器地址。

vrf

Specifies the virtual routing and forwarding (VRF) to use. When VRF option is not given, the default VRF is used.

Authority

操作员或管理员或本地用户组成员具有此命令的执行权。操作员只能从操作员上下文(>)执行此命令。

Examples

Pinging an IPv4 address:

转变#PING 10.0.0.0PING 10.0.0.0(10.0.0.0)100(128)字节的数据。108 bytes from 10.0.0.0: icmp_seq=1 ttl=64 time=0.035 ms 108 bytes from 10.0.0.0: icmp_seq=2 ttl=64 time=0.034 ms 108 bytes from 10.0.0.0: icmp_seq=3 ttl=64 time=0.034MS 108字节从10.0.0.0:ICMP_SEQ = 4 ttl = 64 time = 0.034 ms 108字节108字节从10.0.0.0:icmp_seq = 5 ttl = 5 ttl = 64 time = 0.033 ms ---- 10.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 ping statistics ----- 5个ping statistics ----- 5个数据包---------------------0.0.05收到,0%数据包丢失,时间3999mms RTT最小/avg/max/mdev = 0.033/0.034/0.035/0.035/0.000 ms

ping ping localhost:

转变#ping localhostPing localhost(127.0.0.1)100(128)字节的数据。108个字节来自LocalHost(127.0.0.1):ICMP_SEQ = 1 TTL = 64 TIME = 0.060 MS 108 BYTES 108字节(127.0.0.1.1):ICMP_SEQ = 2 TTL = 2 TTL = 64 TIME = 0.035 ms 108 bytes = 0.035 ms 108 bytes bytes bytes bocalhost(127.0.0.0.0.0.0.0.0.0.0.bhost)ICMP_SEQ = 3 TTL = 64 TIME = 0.043 MS 108字节(127.0.0.1.1):ICMP_SEQ = 4 ttl = 64 TIME = 0.041 MS 108 BYTES来自LocalHost(localhost)--- Local-Host PING统计--- 5个传输的数据包,5个收到,0%数据包丢失,时间3998ms RTT min/avg/avg/max/mdev = 0.034/0.042/0.042/0.060/0.060/0.011 ms

使用数据模式ping服务器:

转变#ping 10.0.0.2数据填充1234123412341234ACDE123456789012模式:0x12341234123412341234ACDE123456789012PING 10.0.0.2(10.0.0.2)100(128)字节的数据。108字节从10.0.0.2:icmp_seq = 1 ttl = 64 time = 0.207 ms 108字节108个字节从10.0.0.2:icmp_seq = 2 ttl = 64 tim = 64 time = 0.187 ms 108 bytes 108 bytes bytes bytes ttl = 3 ttl = 3 ttl = 64 tim = 0.0.225MS 108字节从10.0.0.2:ICMP_SEQ = 4 ttl = 64 time = 0.197 ms 108字节108字节从10.0.0.2:icmp_seq = 5 ttl = 5 ttl = 64 time = 0.210 ms ---- 10.0.0.0.0.0.25收到,0%数据包丢失,时间3999mms RTT最小/avg/max/mdev = 0.187/0.205/0.225/0.225/0.015 ms

Pinging a server with a datagram size:

转变#PING 10.0.0.0datagram-size 200PING 10.0.0.0 (10.0.0.0) 200(228) bytes of data. 208 bytes from 10.0.0.0: icmp_seq=1 ttl=64 time=0.202 ms 208 bytes from 10.0.0.0: icmp_seq=2 ttl=64 time=0.194 ms 208 bytes from 10.0.0.0: icmp_seq=3 ttl=64 time=0.201 ms 208 bytes from 10.0.0.0: icmp_seq=4 ttl=64 time=0.200 ms 208 bytes from 10.0.0.0: icmp_seq=5 ttl=64 time=0.186 ms --- 10.0.0.0 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4000ms rtt min/avg/max/mdev = 0.186/0.196/0.202/0.016 ms

Pinging a server with an interval specified:

转变#ping 9.0.0.2 interval 2PING 9.0.0.2(9.0.0.2)100(128)字节的数据。108字节从9.0.0.2:icmp_seq = 1 ttl = 64 tim = 0.199 ms 108字节108字节从9.0.0.2:icmp_seq = 2 ttl = 64 ttl = 64 time = 0.192 ms 108 bytes 108字节108字节从9.0.0.0.0.0.2:icmp_seq = 3 ttl = 64 ttl = 64 ttl = 64 ttl = 64MS 108字节从9.0.0.2:ICMP_SEQ = 4 TTL = 64 TIME = 0.182 ms 108字节从9.0.0.2:ICMP_SEQ = 5 ttl = 5 ttl = 64 time = 0.194 ms ---- 9.0.0.0.0.0.25收到,0%数据包丢失,时间7999mms RTT最小/avg/max/mdev = 0.182/0.195/0.208/0.008/0.008 ms

Pinging a server with a specified number of packets to send:

转变#ping 9.0.0.2重复10PING 9.0.0.2(9.0.0.2)100(128)字节的数据。108bytes from 9.0.0.2: icmp_seq=1 ttl=64 time=0.213 ms 108 bytes from 9.0.0.2: icmp_seq=2 ttl=64 time=0.204 ms 108 bytes from 9.0.0.2: icmp_seq=3 ttl=64 time=0.201 ms 108 bytes from 9.0.0.2: icmp_seq=4 ttl=64 time=0.184 ms 108 bytes from 9.0.0.2: icmp_seq=5 ttl=64 time=0.202 ms 108 bytes from 9.0.0.2: icmp_seq=6 ttl=64 time=0.184 ms 108 bytes from 9.0.0.2: icmp_seq=7 ttl=64 time=0.193 ms 108 bytes from 9.0.0.2: icmp_seq=8 ttl=64 time=0.196 ms 108 bytes from 9.0.0.2: icmp_seq=9 ttl=64 time=0.193 ms 108 bytes from 9.0.0.2: icmp_seq=10 ttl=64 time=0.200 ms --- 9.0.0.2 ping statistics --- 10 packets transmitted, 10 received, 0% packet loss, time 8999ms rtt min/avg/max/mdev = 0.184/0.197/0.213/0.008 ms

Pinging a server with a specified timeout:

转变#ping 9.0.0.2超时3PING 9.0.0.2(9.0.0.2)100(128)字节的数据。108字节从9.0.0.2:icmp_seq = 1 ttl = 64 tim = 0.175 ms 108字节108字节从9.0.0.2:icmp_seq = 2 ttl = 64 ttl = 64 time = 0.192 ms 108 bytes 108字节108字节从9.0.0.0.0.0.2:icmp_seq = 3 ttl = 64 ttl = 64 tttl = 64 tttl = 64 TIM = 64 TIM = 64 = 64MS 108字节从9.0.0.2:ICMP_SEQ = 4 TTL = 64 TIME = 0.181 MS 108字节从9.0.0.2:ICMP_SEQ = 5 ttl = 5 ttl = 64 time = 0.197 ms ----- 9.0.0.0.0.0.25收到,0%数据包丢失,时间4000ms RTT最小值/AVG/MAX/MDEV = 0.175/0.187/0.197/0.197/0.007 ms

ping服务器指定的IP Ser的类型vice:

转变#ping 9.0.0.2 tos 2PING 9.0.0.2(9.0.0.2)100(128)字节的数据。108bytes from 9.0.0.2: icmp_seq=1 ttl=64 time=0.033 ms 108 bytes from 9.0.0.2: icmp_seq=2 ttl=64 time=0.034 ms 108 bytes from 9.0.0.2: icmp_seq=3 ttl=64 time=0.031 ms 108 bytes from 9.0.0.2: icmp_seq=4 ttl=64 time=0.034 ms 108 bytes from 9.0.0.2: icmp_seq=5 ttl=64 time=0.031 ms --- 9.0.0.2 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 3999ms rtt min/avg/max/mdev = 0.031/0.032/0.034/0.006 ms
Pinging a local host with the specified VRF.
转变#ping lochost vrf红色Ping localhost(127.0.0.1)100(128)字节的数据。108bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.048 ms 108 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.052 ms 108 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.044 ms 108 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.036 ms 108 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.055 ms --- localhost ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4005ms rtt min/avg/max/mdev = 0.036/0.047/0.055/0.006 ms
使用默认VRF ping local主机:
转变#ping localhost vrf mgmtPing localhost(127.0.0.1)100(128)字节的数据。108bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.085 ms 108 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.057 ms 108 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.047 ms 108 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.038 ms 108 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.059 ms --- localhost ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 3999ms rtt min/avg/max/mdev = 0.038/0.057/0.085/0.016 ms

Pinging a server with the intermediate router time stamp:

转变#PING 9.0.0.2 IP-OPTION包括Timestamp萍9.0.0.2(9.0.0.2)100(168)个字节的数据。108bytes from 9.0.0.2: icmp_seq=1 ttl=64 time=0.031 ms TS: 59909005 absolute 0 0 0 108 bytes from 9.0.0.2: icmp_seq=2 ttl=64 time=0.034 ms TS: 59910005 absolute 0 0 0 108 bytes from 9.0.0.2: icmp_seq=3 ttl=64 time=0.038 ms TS: 59911005 absolute 0 0 0 108 bytes from 9.0.0.2: icmp_seq=4 ttl=64 time=0.035 ms TS: 59912005 absolute 0 0 0 108 bytes from 9.0.0.2: icmp_seq=5 ttl=64 time=0.037 ms TS: 59913005 absolute 0 0 0 --- 9.0.0.2 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 3999ms rtt min/avg/max/mdev = 0.031/0.035/0.038/0.002 ms

Pinging a server with the intermediate router time stamp and address:

转变#PING 9.0.0.2 IP-OPTION包括Timestamp-and-address萍9.0.0.2(9.0.0.2)100(168)个字节的数据。108字节从9.0.0.2:icmp_seq = 1 ttl = 64 tim = 0.030 ms ts:9.0.0.2 60007355绝对9.0.0.0.2 0 9.0.0.0.0.0.2 0 9.0.0.0.0.2 0 108 108 108字节从9.0.0.0.0.2:icmp_seq = 64 Time = 64 Time = 64 Time = 64 TIME=0.037 ms TS: 9.0.0.2 60008355 absolute 9.0.0.2 0 9.0.0.2 0 9.0.0.2 0 108 bytes from 9.0.0.2: icmp_seq=3 ttl=64 time=0.037 ms TS: 9.0.0.2 60009355 absolute 9.0.0.2 09.0.0.2 0 9.0.0.2 0 108 bytes from 9.0.0.2: icmp_seq=4 ttl=64 time=0.038 ms TS: 9.0.0.2 60010355 absolute 9.0.0.2 0 9.0.0.2 0 9.0.0.2 0 108 bytes from 9.0.0.2:icmp_seq = 5 ttl = 64 time = 0.039 ms ts:9.0.0.2 60011355绝对9.0.0.0.2 0 9.0.0.0.0.0.2 0 9.0.0.0.0.2 0 --- 9.0.0.0.0.0.0.0.0.0.0.2数据包丢失,时间3999ms RTT最小/AVG/MAX/MDEV = 0.030/0.036/0.039/0.005 ms

Pinging a server with the intermediate router address:

转变#ping 9.0.0.2 ip-option record-route萍9.0.0.2(9.0.0.2)100(168)个字节的数据。108bytes from 9.0.0.2: icmp_seq=1 ttl=64 time=0.034 ms RR: 9.0.0.2 9.0.0.2 9.0.0.2 9.0.0.2 108 bytes from 9.0.0.2: icmp_seq=2 ttl=64 time=0.038 ms (same route) 108 bytes from 9.0.0.2: icmp_seq=3 ttl=64 time=0.036 ms (same route) 108 bytes from 9.0.0.2: icmp_seq=4 ttl=64 time=0.037 ms (same route) 108 bytes from 9.0.0.2: icmp_seq=5 ttl=64 time=0.035 ms (same route) --- 9.0.0.2 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 3999ms rtt min/avg/max/mdev = 0.034/0.036/0.038/0.001 ms