Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

ping

Syntax

Syntax (QFX Series)

Syntax (Junos OS Evolved)

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 ce-ip option is based on the LSP ping infrastructure, where the ping utility is extended to use the CE device IP address as the target host and the PE device loopback address as the source for a specific VPLS or EVPN routing instance.

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 1 through 2,000,000,000. The default value is an unlimited number of requests.

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 ping does not have do-not-fragment support. The ping command is identified as IPv6 Ping when destination is IPv6 address or inet6 option is used.

For Junos OS IPv6 packets, this option disables fragmentation.

Note:

In Junos OS Release 11.1 and later, when issuing the ping command for an IPv6 route with the do-not-fragment option, the maximum ping packet size is calculated by subtracting 48 bytes (40 bytes for the IPV6 header and 8 bytes for the ICMP header) from the MTU. Therefore, if the ping packet size (including the 48-byte header) is greater than the MTU, the ping operation might fail.

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 1 through infinity. The default value is 1.

logical-system logical-system-name

(Optional) Name of logical system from which to send the ping requests.

Alternatively, enter the set cli logical-system logical-system-name command and then run the ping command. To return to the main router or switch, enter the clear cli logical-system command.

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 count option.

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 routing-instance option supports only mgmt_junos.

size bytes

(Optional) Size of ping request packets. The range of values, in bytes, is 0 through 65,468. The default value is 56, which is effectively 64 bytes because 8 bytes of ICMP header data are added to the packet.

source source-address

(Optional) IP address of the outgoing interface. This address is sent in the IP source address field of the ping request. If this option is not specified, the default address is usually the loopback interface (lo.0).

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 0 through 255.

If the device configuration includes the dscp-code-point value statement at the [edit class-of-service host-outbound-traffic] hierarchy level, the configured DSCP value overrides the value specified in this command option. In this case, the ToS field of ICMP echo request packets sent on behalf of this command carries the DSCP value specified in the dscp-code-point configuration statement instead of the value you specify in this command option.

ttl value

(Optional) Time-to-live (TTL) value to include in the ping request (IPv6). The range of values is 0 through 255.

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 10 seconds. If this option is used without the count option, a default count of 5 packets is used.

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

Output for Junos OS Evolved:

Output for Junos OS:

ping hostname rapid

Output for Junos OS Evolved:

Output for Junos OS:

ping hostname size count

ping hostname count size (No route to host)

Output for Junos OS Evolved:

Output for Junos OS:

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.