tracert

Syntax

tracert [ -a source-ip | -f first-ttl | -m max-ttl | -p port | -q packet-number | -tos tos | -w timeout ] * host

View

Any view

Default level

0: Visit level

Parameters

-a source-ip: Specifies the source IP address of a tracert packet. It must be a legal IP address configured on the device. If this option is not specified, the source IP address of an ICMP echo request is the primary IP address of the outbound interface of the tracert packet.

-f first-ttl: Specifies the first TTL (the allowed number of hops for the first packet). It is in the range of 1 to 255 and defaults to 1, and must be less than the maximum TTL.

-m max-ttl: Specifies the maximum TTL, or, the maximum allowed number of hops for a packet. It is in the range of 1 to 255 and defaults to 30, and must be greater than the first TTL.

-p port: Specifies the UDP port number of the destination, which is in the range of 1 to 65535 and defaults to 33434.

-q packet-number: Specifies the number of probe packets sent each time, which is in the range of 1 to 65535 and defaults to 3.

-tos tos: Specifies the ToS value for a tracert packet, which is in the range of 0 to 255 and defaults to 0.

-w timeout: Specifies the timeout time of the reply packet of a probe packet, which is in the range of 1 to 65535 milliseconds and defaults to 5000 milliseconds.

host: Specifies the IP address or host name (a string of 1 to 255 characters) for the destination.

Description

Use tracert to trace the path that the packets traverse from source to destination.

In the event of network failure, you can use the tracert command to determine the failed nodes.

The output from the tracert command includes IP addresses of all the Layer 3 devices that the packets traverse from source to destination. Asterisks (* * *) are displayed if the device cannot reply with an ICMP error message (probably because the destination is unreachable or sending ICMP timeout/destination unreachable packets is disabled).

To abort the tracert operation during the execution of the command, press Ctrl+C.

Examples

# Display the path that the packets traverse from source to destination with an IP address of 1.1.2.2.

<Sysname> tracert 1.1.2.2
 traceroute to 1.1.2.2(1.1.2.2) 30 hops max,40 bytes packet, press CTRL_C to break
 1  1.1.1.2 673 ms 425 ms 30 ms
 2  1.1.2.2 580 ms 470 ms 80 ms

# Trace the path to destination 192.168.0.46 over an MPLS network.

<Sysname> tracert 192.168.0.46
 traceroute to 192.168.0.46(192.168.0.46) 30 hops max,40 bytes packet, press CTRL_C to break
 1  192.0.2.13 (192.0.2.13)  0.661 ms  0.618 ms  0.579 ms
 2  192.0.2.9 (192.0.2.9)  0.861 ms  0.718 ms  0.679 ms
    MPLS Label=100048 Exp=0 TTL=1 S=1
 3  192.0.2.5 (192.0.2.5)  0.822 ms  0.731 ms  0.708 ms
    MPLS Label=100016 Exp=0 TTL=1 S=1
 4  192.0.2.1 (192.0.2.1)  0.961 ms  8.676 ms  0.875 ms

Table 2: Command output

Field

Description

traceroute to 1.1.2.2(1.1.2.2)

Display the route that the IP packets traverse from the current device to the device whose IP address is 1.1.2.2.

hops max

Maximum number of hops of the probe packets, which can be set through the -m keyword.

bytes packet

Number of bytes of a probe packet.

press CTRL_C to break

During the execution of the command, you can press Ctrl+C to abort the tracert operation.

1 1.1.1.2 673 ms 425 ms 30 ms

Probe result of the probe packets whose TTL is 1, including the IP address of the first hop and the roundtrip time of three probe packets.

The number of packets that can be sent in each probe can be set through the -q keyword.

MPLS Label=100048 Exp=0 TTL=1 S=1

ICMP timeout packets on an MPLS network, carry MPLS label information:

  • Label—Label value that is used to identify a forwarding equivalence class (FEC).

  • Exp—Reserved, usually used for class of service (CoS).

  • TTL—TTL value.

  • S—MPLS supports multiple levels of labels. Value 1 indicates that the label is at the bottom of the label stack, and value 0 indicates that the label is not at the bottom of the label stack.