Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Junos CLI Reference
Table of Contents Expand all
list Table of Contents

traceroute

date_range 19-Nov-23

Syntax

content_copy zoom_out_map
traceroute             
<host>
<as-number-lookup> 
<bypass-routing> 
<ce-ip ip address>
<clns>
<ethernet host>
<extension>
<gateway address>
<inet> 
<inet6>
<interface interface-name>
<logical-system logical-system-name> 
<monitor host> 
<mpls (ldp FEC address | rsvp label-switched-path-name | bgp FEC address)>
<next-hop next-hop address>
<no-resolve host> 
<overlay>
<port>
<propagate-ttl host>
<routing-instance routing-instance-name> 
<tenant tenant-name> 
<source source-address> 
<tos value> 
<ttl value>
<wait seconds>

Syntax (QFX Series and OCX Series)

content_copy zoom_out_map
traceroute 
<host>
<as-number-lookup> 
<bypass-routing> 
<gateway address>
<inet> 
<inet6> 
<interface interface-name>
<monitor host> 
<mpls (ldp FEC address | rsvp label-switched-path-name | bgp FEC address)>
<next-hop next-hop address>
<no-resolve host> 
<overlay>
<port>
<propagate-ttl host>
<routing-instance routing-instance-name> 
<source source-address> 
<tos value> 
<ttl value>
<wait seconds>

Description

Display the route that packets take to a specified network host. Use traceroute as a debugging tool to locate points of failure in a network.

Note:

The Junos OS Evolved traceroute command parses data in the same way as the Linux traceroute command, so the output is different compared to Junos OS. See the Sample Output section for more details.

Options

host

IP address or name of remote host.

as-number-lookup

(Optional) Display the autonomous system (AS) number of each intermediate hop on the path from the host to the destination.

bypass-routing

(Optional) Bypass the normal routing tables and send 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 display a route to a local system through an interface that has no route through it.

ce-ip IPv4 or IPv6 address

(MX Series routers with MPC and MIC interfaces only) (Optional) Check the route to a customer edge (CE) IP address in a virtual private LAN service (VPLS) and Ethernet VPN (EVPN) network.

clns

(Optional) Trace the route belonging to Connectionless Network Service (CLNS).

ethernet host

(Optional) Trace the route to an Ethernet host using unicast MAC address.

extension

(Optional) Trace ICMP extensions

gateway address

(Optional) Address of a router or switch through which the route transits.

inet | inet6

(Optional) Trace the route belonging to IPv4 or IPv6, respectively.

interface interface-name

(Junos OS only) (Optional) Name of the interface over which to send packets.

logical-system (all | logical-system-name)

(Optional) This option is not supported for Junos OS Evolved Release 18.3R1. Perform this operation on all logical systems or on a particular logical system.

tenant tenant-name

(Optional) Name of a particular tenant system for traceroute attempt.

monitor host

(Optional) Display real-time monitoring information for the specified host.

mpls (ldp FEC address | rsvp label-switched-path name)

(Optional) See traceroute mpls ldp and traceroute mpls rsvp.

next-hop

The next-hop through which to send packets to a destination.

no-resolve

(Optional) Do not attempt to determine the hostname that corresponds to the IP address.

overlay

(Optional) Traceroute overlay path.

port

(Optional) Base port number to use in traceroute probes.

propagate-ttl

(Optional) On the PE routing device, use this option to view locally generated Routing Engine transit traffic. This is applicable for MPLS L3VPN traffic only.

Use for troubleshooting, when you want to view hop-by-hop information from the local provider router to the remote provider router, when TTL decrementing is disabled on the core network using the no-proagate-ttl configuration statement.

Note:

Using propagate-ttl with traceroute on the CE router does not show hop-by-hop information.

routing-instance routing-instance-name

(Optional) Name of the routing instance for the traceroute attempt.

source source-address

(Optional) Source address of the outgoing traceroute packets.

tos value

(Optional) Value to include in the IP type-of-service (ToS) field. The range of values is 0 through 255.

ttl value

(Optional) Maximum time-to-live value to include in the traceroute request. The range of values is 0 through 128.

wait seconds

(Optional) Maximum time to wait for a response to the traceroute request.

The remaining statements are explained separately. See CLI Explorer.

Required Privilege Level

network

Output Fields

Table 1 describes the output fields for the traceroute command. Output fields are listed in the approximate order in which they appear.

Table 1: traceroute Output Fields

Field Name

Field Description

traceroute to

IP address of the receiver.

hops max

Maximum number of hops allowed.

byte packets

Size of packets being sent.

number-of-hops

Number of hops from the source to the named router or switch.

router-name

Name of the router or switch for this hop.

address

Address of the router or switch for this hop.

Round trip time

Average round-trip time, in milliseconds (ms).

Sample Output

traceroute

content_copy zoom_out_map
user@host> traceroute santacruz             
traceroute to host1.example.com (10.156.169.254), 30 hops max, 40 byte packets
 1  blue23 (10.168.1.254)    2.370 ms  2.853 ms  0.367 ms
 2  red14  (10.168.255.250)  0.778 ms  2.937 ms  0.446 ms
 3  yellow (10.156.169.254)  7.737 ms  89.905 ms  0.834 ms

traceroute as-number-lookup host

content_copy zoom_out_map
user@host> traceroute as-number-lookup 10.100.1.1
traceroute to 10.100.1.1 (10.100.1.1), 30 hops max, 40 byte packets
 1  10.39.1.1 (10.39.1.1)  0.779 ms  0.728 ms  0.562 ms
 2  10.39.1.6 (10.39.1.6) [AS  32]  0.657 ms  0.611 ms  0.617 ms
 3  10.100.1.1 (10.100.1.1) [AS  10, 40, 50]  0.880 ms  0.808 ms  0.774 ms


user@host> traceroute as-number-lookup 1::1
traceroute6 to 1::1 (1::1) from 2001:b8::7, 64 hops max, 12 byte packets
user@host> traceroute 2001:b8::7 as-number-lookup 
traceroute6 to 2001:b8::7 (2001:b8::7) from 2001:db8::9, 64 hops max, 12 byte packets
 1  2001:db8::10 (2001:db8::10) [AS 18] 0.657 ms  17.319 ms  0.504 ms
 2  2001:b8::7 (2001:b8::7)  0.949 ms  0.930 ms  0.739 ms

traceroute no-resolve

content_copy zoom_out_map
user@host> traceroute santacruz no-resolve             
traceroute to host1.example.com (10.156.169.254), 30 hops max, 40 byte packets
 1  10.168.1.254  0.458 ms  0.370 ms  0.365 ms
 2  10.168.255.250  0.474 ms  0.450 ms  0.444 ms
 3  10.156.169.254  0.931 ms  0.876 ms  0.862 ms

traceroute propogate-ttl

content_copy zoom_out_map
user@host> traceroute propagate-ttl 100.200.2.2 routing-instance VPN-A             
traceroute to 100.200.2.2 (100.200.2.2) from 1.1.0.2, 30 hops max, 40 byte packets
 1  1.2.0.2 (1.2.0.2)  2.456 ms  1.753 ms  1.672 ms
     MPLS Label=299776 CoS=0 TTL=1 S=0
     MPLS Label=299792 CoS=0 TTL=1 S=1
 2  1.3.0.2 (1.3.0.2)  1.213 ms  1.225 ms  1.166 ms
     MPLS Label=299792 CoS=0 TTL=1 S=1
 3  100.200.2.2 (100.200.2.2)  1.422 ms  1.521 ms  1.443 ms

traceroute (Between CE Routers, Layer 3 VPN)

content_copy zoom_out_map
user@host> traceroute vpn09             
traceroute to host2.example.com (10.255.14.179), 30 hops max, 40 
      byte packets 
       1  10.39.10.21 (10.39.10.21)  0.598 ms  0.500 ms  0.461 ms 
       2  10.39.1.13 (10.39.1.13)  0.796 ms  0.775 ms  0.806 ms 
           MPLS Label=100006 CoS=0 TTL=1 S=1 
       3  host2.example.com (10.255.14.179)  0.783 ms  0.716 ms  0.686

traceroute (Through an MPLS LSP)

content_copy zoom_out_map
user@host> traceroute mpls1              
traceroute to 10.168.1.224 (10.168.1.224), 30 hops max, 40 byte packets
 1  mpls1-sr0.company.net (10.168.200.101)  0.555 ms  0.393 ms  0.367 ms
     MPLS Label=1024 CoS=0 TTL=1
 2  mpls5-lo0.company.net (10.168.1.224)  0.420 ms  0.394 ms  0.401 ms

traceroute routing-instance no-resolve (Through an MPLS LSP)

content_copy zoom_out_map
user@host> traceroute routing-instance VRF-1 198.51.100.1 no-resolve
traceroute to 198.51.100.1 (198.51.100.1), 30 hops max, 40 byte packets
 1  198.51.100.20  20.243 ms  13.256 ms  24.194 ms
     MPLS Label=299792 CoS=0 TTL=1 S=0
     MPLS Label=16 CoS=0 TTL=1 S=1
 2  198.51.100.21  14.126 ms  13.090 ms  29.082 ms
     MPLS Label=16 CoS=0 TTL=1 S=0
     MPLS Label=16 CoS=0 TTL=2 S=1
 3  198.51.100.22  16.419 ms  11.564 ms  17.068 ms
     MPLS Label=16 CoS=0 TTL=1 S=1
 4  198.51.100.1  12.794 ms  12.939 ms  17.123 ms

traceroute (Junos OS Evolved, Through an MPLS LSP)

The Junos OS Evolved traceroute command parses MPLS data in the same way as the Linux traceroute command: L=label, E=exp_use, S=stack_bottom, and T=TTL. In the example below, T=1/L=16 indicates the TTL with label 16.

content_copy zoom_out_map
user@host> traceroute 192.0.2.50 ttl 255
traceroute to 192.0.2.50 (192.0.2.50), 255 hops max, 60 byte packets
 1  192.0.2.60 (192.0.2.60)  13.565 ms  11.696 ms  11.448 ms
 2  192.0.2.61 (192.0.2.61) <MPLS:L=17,E=0,S=0,T=1/L=16,E=0,S=1,T=1>  34.034 ms  31.538 ms  27.697 ms
 3  192.0.2.62 (192.0.2.62) <MPLS:L=299776,E=0,S=0,T=1/L=16,E=0,S=1,T=2>  23.174 ms  24.393 ms  21.009 ms
 4  192.0.2.63 (192.0.2.63)  24.553 ms  19.698 ms  25.648 ms
 5  192.0.2.50 (192.0.2.50)  33.322 ms  29.514 ms  24.706 ms

traceroute no-resolve extension (QFX5100)

content_copy zoom_out_map
user@host> traceroute 48.1.1.2 no-resolve extension
traceroute to 10.255.255.255 (10.255.255.255), 30 hops max, 52 byte packets
1  10.168.1.254  7.776 ms  8.108 ms  8.131 ms
    rx intf ae1.0(560) 10.168.1.254 mtu 1500
    rx sub-ip intf xe-0/0/18:0(803) 10.168.1.254 mtu 1500
    fwd intf ae2.0(562) 10.255.255.254 mtu 1500
    next-hop intf ae2.0(562) 10.255.255.255 mtu 1500
    !
2  10.255.255.255  7.122 ms  8.599 ms  8.267 ms
    rx intf ae2.0(556) 10.255.255.255 mtu 1500
    !
footer-navigation