ping
Syntax
ping host <bypass-routing> <ce-ip destination-ip-address instance routing-instance-name source-ip source-ip-address> <count requests> <do-not-fragment> <inet | inet6> <interface source-interface> <interval seconds> <no-resolve> <pattern string> <rapid> <record-route> <routing-instance routing-instance-name> <logical-system logical-system-name> <tenant tenant-name> <size bytes> <source source-address> <tos type-of-service> <ttl value> <verbose> <wait seconds>
Syntax (QFX Series)
ping host <bypass-routing> <count requests> <detail> <do-not-fragment> <inet> <interface source-interface> <interval seconds> <logical-system logical-system-name> <loose-source value> <mac-address mac-address> <no-resolve> <pattern string> <rapid> <record-route> <routing-instance routing-instance-name> <size bytes> <source source-address> <strict> < strict-source value> <tos type-of-service> <ttl value> <verbose> <wait seconds>
Syntax (Junos OS Evolved)
ping host <bypass-routing> <ce-ip destination-ip-address instance routing-instance-name source-ip source-ip-address> <count requests> <do-not-fragment> <inet | inet6> <interface source-interface> <interval seconds> <no-resolve> <pattern string> <rapid> <record-route> <routing-instance routing-instance-name> <size bytes> <source source-address> <tos type-of-service> <ttl value> <verbose> <wait seconds>
Description
Check host reachability and network connectivity.
The ping
command sends Internet Control Message Protocol
(ICMP) ECHO_REQUEST messages to elicit ICMP ECHO_RESPONSE messages
from the specified host. Press Ctrl+c to interrupt a ping command.
Options
host | IP address or hostname of the remote system to ping. |
||
bypass-routing | (Optional) Bypass the normal routing tables and send ping requests directly to a system on an attached network. If the system is not on a directly attached network, an error is returned. Use this option to ping a local system through an interface that has no route through it. |
||
ce-ip destination-ip-address instance routing-instance-name source-ip source-ip-address | (MX Series
routers with MPC and MIC interfaces only) (Optional) Check the connectivity
information of customer edge (CE) devices, such as reachability, attachment
points, and MAC addresses, from a provider edge (PE) device in a virtual
private LAN service (VPLS), hierarchical VPLS (H-VPLS), and Ethernet
VPN (EVPN) network. The |
||
destination-ip-address | IPv4 address of the CE device to ping. |
||
instance routing-instance-name | Name of the VPLS or EVPN routing instance. The command output displays the connectivity information of the CE device based on the configured routing instance type. |
||
source-ip source-ip-address | Loopback address of the PE device. |
||
count requests | (Optional) Number of ping requests to send. The range
of values is |
||
detail | (Optional) This option is not supported for Junos OS Evolved Release 18.3R1. Include in the output the interface on which the ping reply was received. |
||
do-not-fragment | (Optional) Set the do-not-fragment (DF) flag in the IP header of the ping packets. For Junos OS Evolved Release 18.3R1, IPv6 For Junos OS IPv6 packets, this option disables fragmentation. Note:
In Junos OS Release 11.1 and later, when issuing the |
||
inet | (Optional) Ping Packet Forwarding Engine IPv4 routes. |
||
inet6 | (Optional) Ping Packet Forwarding Engine IPv6 routes. |
||
interface source-interface | (Optional) Interface to use to send the ping requests. |
||
interval seconds | (Optional) How often to send ping requests. The range
of values, in seconds, is |
||
logical-system logical-system-name | (Optional) Name of logical system from which to send the ping requests. Alternatively, enter the |
||
tenant tenant-name | (Optional) Name of tenant system from which to send the ping requests. |
||
loose-source value | (Optional) Intermediate loose source route entry (IPv4). Open a set of values. |
||
mac-address mac-address | (Optional) Ping the physical or hardware address of the remote system you are trying to reach. |
||
no-resolve | (Optional) Do not attempt to determine the hostname that corresponds to the IP address. |
||
pattern string | (Optional) Specify a hexadecimal fill pattern to include in the ping packet. |
||
rapid | (Optional) Send
ping requests rapidly. The results are reported in a single message,
not in individual messages for each ping request. By default, five
ping requests are sent before the results are reported. To change
the number of requests, include the |
||
record-route | (Optional) Record and report the packet’s path (IPv4). |
||
routing-instance routing-instance-name | (Optional) Name of the routing instance
for the ping attempt. For Junos OS Evolved, the |
||
size bytes | (Optional) Size of ping request packets. The range
of values, in bytes, is |
||
source source-address |
(Optional) IP address to be set in source ip address field of outgoing echo request. If this option is not specified, the outgoing interface IP is selected as source ip , lo0 otherwise. |
||
strict | (Optional) Use the strict source route option (IPv4). |
||
strict-source value | (Optional) Intermediate strict source route entry (IPv4). Open a set of values. |
||
tos type-of-service | (Optional) Set the type-of-service (ToS) field in
the IP header of the ping packets. The range of values is If the device configuration
includes the |
||
ttl value | (Optional) Time-to-live (TTL) value to include in the ping request
(IPv6). The range of values is |
||
verbose | (Optional) Display detailed output. |
||
vpls instance-name | (Optional) Ping the instance to which this VPLS belongs. |
||
wait seconds | (Optional) Maximum wait time, in seconds, after the
final packet is sent. If this option is not specified, the default
delay is |
Required Privilege Level
network
Output Fields
When you enter this command, you are provided
feedback on the status of your request. An exclamation point (!
) indicates that an echo reply was received. A period (.
) indicates that an echo reply was not received within the
timeout period. An x
indicates that an echo reply was
received with an error code. These packets are not counted in the
received packets count. They are accounted for separately.
When pinging a nonexistant
route, the display output of ping
command does not print
the number of packets sent or received or the packet loss.
Sample Output
- ping ce-ip destination-ip-address instance routing-instance-name source-ip source-ip-address (EVPN)
- ping ce-ip destination-ip-address instance routing-instance-name source-ip source-ip-address (VPLS)
- ping hostname
- ping hostname rapid
- ping hostname size count
- ping hostname count size (No route to host)
ping ce-ip destination-ip-address instance routing-instance-name source-ip source-ip-address (EVPN)
user@host> ping ce-ip 10.0.0.4 instance foo source-ip 127.0.0.1 ! -> PE5|foo|evpn|ge-0/0/2.100, 00:11:22:33:44:55:66:77:88:99|12:23:ab:98:34:05 ! -> PE5|foo|evpn|ge-0/0/2.100, 00:11:22:33:44:55:66:77:88:99|12:23:ab:98:34:05 ! -> PE5|foo|evpn|ge-0/0/2.100, 00:11:22:33:44:55:66:77:88:99|12:23:ab:98:34:05 ! -> PE5|foo|evpn|ge-0/0/2.100, 00:11:22:33:44:55:66:77:88:99|12:23:ab:98:34:05 ! -> PE5|foo|evpn|ge-0/0/2.100, 00:11:22:33:44:55:66:77:88:99|12:23:ab:98:34:05 --- ce-ip ping statistics --- 5 packets transmitted, 5 packets received, 0% packet loss
ping ce-ip destination-ip-address instance routing-instance-name source-ip source-ip-address (VPLS)
user@host> ping ce-ip 10.0.0.4 instance foo source-ip 127.0.0.1 ! -> PE2|foo|vpls|ge-0/0/2.100|12:23:ab:98:34:02 ! -> PE2|foo|vpls|ge-0/0/2.100|12:23:ab:98:34:02 ! -> PE2|foo|vpls|ge-0/0/2.100|12:23:ab:98:34:02 ! -> PE2|foo|vpls|ge-0/0/2.100|12:23:ab:98:34:02 ! -> PE2|foo|vpls|ge-0/0/2.100|12:23:ab:98:34:02 --- ce-ip ping statistics --- 5 packets transmitted, 5 packets received, 0% packet loss
ping hostname
Output for Junos OS Evolved:
user@host> ping device1.example.com PING device1.example.com (192.0.2.0): 56(84) bytes of data. 64 bytes from 192.0.2.0: icmp_seq=1 ttl=64 time=44.7 ms 64 bytes from 192.0.2.0: icmp_seq=2 ttl=64 time=3.76 ms ^C --- device1.example.com ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 3.765/24.235/44.705/20.470 ms
Output for Junos OS:
user@host> ping device1.example.com PING device1.example.com (192.0.2.0): 56 data bytes 64 bytes from 192.0.2.0: icmp_seq=0 ttl=253 time=1.028 ms 64 bytes from 192.0.2.0: icmp_seq=1 ttl=253 time=1.053 ms 64 bytes from 192.0.2.0: icmp_seq=2 ttl=253 time=1.025 ms 64 bytes from 1192.0.2.0: icmp_seq=3 ttl=253 time=1.098 ms 64 bytes from 192.0.2.0: icmp_seq=4 ttl=253 time=1.032 ms 64 bytes from 192.0.2.0: icmp_seq=5 ttl=253 time=1.044 ms ^C --- device1.example.com ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.492/0.641/0.789/0.148 ms
ping hostname rapid
Output for Junos OS Evolved:
user@host> ping device1.example.com rapid PING device1.example.com (192.0.2.0): 56(84) bytes of data. .. --- device1.example.com ping statistics --- 5 packets transmitted, 3 received, 40% packet loss, time 505ms rtt min/avg/max/mdev = 0.026/0.081/0.137/0.044 ms, ipg/ewma 126.258/0.112 ms
Output for Junos OS:
user@host> ping device1.example.com rapid PING device1.example.com (192.0.2.0): 56 data bytes !!!!! --- device1.example.com ping statistics --- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.956/0.974/1.025/0.026 ms
ping hostname size count
user@host> ping device1.example.com size 200 count 5 PING device1.example.com (192.0.2.0): 200 data bytes 208 bytes from 192.0.2.0: icmp_seq=0 ttl=253 time=1.759 ms 208 bytes from 192.0.2.0: icmp_seq=1 ttl=253 time=2.075 ms 208 bytes from 192.0.2.0: icmp_seq=2 ttl=253 time=1.843 ms 208 bytes from 192.0.2.0: icmp_seq=3 ttl=253 time=1.803 ms 208 bytes from 192.0.2.0: icmp_seq=4 ttl=253 time=17.898 ms --- device1.example.com ping statistics --- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max = 1.759/5.075/17.898 ms
ping hostname count size (No route to host)
Output for Junos OS Evolved:
user@host> ping 40.0.0.2 count 20 size 500 connect: No route to host
Output for Junos OS:
user@host> ping 40.0.0.2 count 20 size 500 Aug 02 12:56:56 [INFO ] Step 2: Host and Transit ping has to fail Aug 02 12:56:56 [TRACE] [R0 evo-ptx-b] [cmd] run ping 40.0.0.2 rapid count 50 size 500 Aug 02 12:57:21 [TRACE] [R0 evo-ptx-b] PING 40.0.0.2 (40.0.0.2): 500 data bytes Aug 02 12:57:21 [TRACE] [R0 evo-ptx-b] ping: sendto: No route to host Aug 02 12:57:21 [TRACE] [R0 evo-ptx-b] .ping: sendto: No route to host Aug 02 12:57:21 [TRACE] [R0 evo-ptx-b] ping: sendto: No route to host Aug 02 12:57:21 [TRACE] [R0 evo-ptx-b] .ping: .sendto: No route to host Aug 02 12:57:21 [TRACE] [R0 evo-ptx-b] ping: sendto: No route to host ug 02 12:57:21 [TRACE] [R0 evo-ptx-b] .. Aug 02 12:57:21 [TRACE] [R0 evo-ptx-b] --- 40.0.0.2 ping statistics --- Aug 02 12:57:21 [TRACE] [R0 evo-ptx-b] 50 packets transmitted, 0 packets received, 100% packet loss
Release Information
Command introduced before Junos OS Release 7.4.
ce-ip
option introduced in Junos OS Release 17.3
for MX Series routers with MPC and MIC interfaces.
The following options are deprecated
for Junos OS Evolved Release 18.3R1: detail
, logical-system
, loose-source
, mac-address
, strict
, strict-source
, and vpls
.
The command tenant
option is introduced in Junos
OS Release 19.2R1 for SRX Series.