Purpose
This topic provides examples of how to use the ping command to check the reachability of various routers in a network topology, and how to use the traceroute command to check the path that packets travel between routers. The topology shown in Figure 17 illustrates these commands.
Figure 17: Topology for ping and traceroute Command Examples

The network in Figure 17 consists of two autonomous systems (ASs). AS 65001 includes two routers, and AS 65002 includes three routers. The border router (R1) in AS 65001 announces aggregated prefixes 100.100/24 to the AS 65002 network.
To check the reachability of routers and the path to the routers, follow these steps:
You can ping one router from another router by specifying the other router's loopback address as the IP address in the ping and traceroute commands. In this step, R6 and R5 both ping and traceroute each other.
To ping and traceroute between R5 and R6, enter the following JUNOS command-line interface (CLI) operational mode commands:
The following sample output is from R6 to R5, as shown in the network topology in Figure 17:
user@R6> ping 10.0.0.5 count 3 PING 10.0.0.6 (10.0.0.6): 56 data bytes 64 bytes from 10.0.0.6: icmp_seq=0 ttl=255 time=0.298 ms 64 bytes from 10.0.0.6: icmp_seq=1 ttl=255 time=0.237 ms 64 bytes from 10.0.0.6: icmp_seq=2 ttl=255 time=0.273 ms --- 10.0.0.6 ping statistics --- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.237/0.269/0.298/0.025 ms user@R6> traceroute 10.0.0.5 traceroute to 10.0.0.5 (10.0.0.5), 30 hops max, 40 byte packets 1 10.1.26.1 (10.1.26.1) 0.626 ms 0.530 ms 0.489 ms 2 10.1.12.1 (10.1.12.1) 0.546 ms 0.534 ms 0.507 ms 3 10.0.0.5 (10.0.0.5) 0.749 ms 0.694 ms 0.686 ms user@R5> ping 10.0.0.6 count 3 PING 10.0.0.6 (10.0.0.6): 56 data bytes 64 bytes from 10.0.0.6: icmp_seq=0 ttl=253 time=0.875 ms 64 bytes from 10.0.0.6: icmp_seq=1 ttl=253 time=0.815 ms 64 bytes from 10.0.0.6: icmp_seq=2 ttl=253 time=0.819 ms --- 10.0.0.6 ping statistics --- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.815/0.836/0.875/0.027 ms user@R5> traceroute 10.0.0.6 traceroute to 10.0.0.6 (10.0.0.6), 30 hops max, 40 byte packets 1 10.1.15.1 (10.1.15.1) 0.635 ms 39.951 ms 0.526 ms 2 10.1.12.2 (10.1.12.2) 0.555 ms 0.535 ms 0.515 ms 3 10.0.0.6 (10.0.0.6) 0.769 ms 0.720 ms 0.674 ms
The sample output shows a successful ping and traceroute between the R6 and R5 loopback (lo0) addresses. The ping is successful because the loopback addresses of both routers are advertised to their directly connected neighbors.
The output for the traceroute command shows the path from R6 to R5, which is through R2.
![]() |
Note: A ping command might lose packets due to rate limiting of Internet Message Control Protocol (ICMP) packets on the specified host. |
You can ping interfaces on remote routers.
To ping and traceroute between R5 and R6, enter the following JUNOS CLI operational mode commands:
user@R6> ping 10.1.15.2 count 3 PING 10.1.15.2 (10.1.15.2): 56 data bytes 64 bytes from 10.1.15.2: icmp_seq=0 ttl=253 time=2.738 ms 64 bytes from 10.1.15.2: icmp_seq=1 ttl=253 time=0.858 ms 64 bytes from 10.1.15.2: icmp_seq=2 ttl=253 time=0.849 ms --- 10.1.15.2 ping statistics --- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.849/1.482/2.738/0.888 ms user@R6> traceroute 10.1.15.2 traceroute to 10.1.15.2 (10.1.15.2), 30 hops max, 40 byte packets 1 10.1.26.1 (10.1.26.1) 0.617 ms 0.534 ms 0.500 ms 2 10.1.12.1 (10.1.12.1) 3.500 ms 0.543 ms 0.508 ms 3 10.1.15.2 (10.1.15.2) 0.699 ms 0.700 ms 0.672 ms user@R5> ping 10.1.36.2 count 3 PING 10.1.36.2 (10.1.36.2): 56 data bytes 64 bytes from 10.1.36.2: icmp_seq=0 ttl=253 time=0.890 ms 64 bytes from 10.1.36.2: icmp_seq=1 ttl=253 time=0.857 ms 64 bytes from 10.1.36.2: icmp_seq=2 ttl=253 time=3.264 ms --- 10.1.36.2 ping statistics --- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.857/1.670/3.264/1.127 ms user@R5> traceroute 10.1.36.2 traceroute to 10.1.36.2 (10.1.36.2), 30 hops max, 40 byte packets 1 10.1.15.1 (10.1.15.1) 0.636 ms 7.979 ms 0.497 ms 2 10.1.12.2 (10.1.12.2) 0.544 ms 0.547 ms 0.512 ms 3 10.1.36.2 (10.1.36.2) 0.729 ms 0.696 ms 0.672 ms
The sample output shows a successful ping and traceroute between the interfaces on R6 and R5. The ping is successful because the interface addresses of both routers are advertised to their directly connected neighbors.
The output for the traceroute command shows the path from R6 to R5, which is through R2.
![]() |
Note: A ping command might loose packets due to rate limiting of ICMP packets on the specified host. |