The tracert command tests the gateways that datagram pass along from sending host to the destination. This command is mainly used to check whether the network connection is reachable and locate failures that have occurred in the network.
tracert [ -a source-ip-address | -f first-ttl | -m max-ttl | -name | -p port | -q nqueries | -s byte-number | -vpn-instance vpn-instance-name [ pipe ] | -w timeout ] * host
| Parameter | Description | Value |
|---|---|---|
-a source-ip-address |
Indicates the source address of the packets configured for the current tracert command. It is in dotted decimal notation and should be the address of a local interface. |
- |
-f first-ttl |
Indicates the initial TTL. |
It ranges from 1 to max-ttl. By default, it is 1. |
-m max-ttl |
Indicates the maximum TTL. |
It ranges from first-ttl to 255. By default, it is 30. |
-name |
Displays the host name of each hop. |
- |
-p port |
Indicates the port number of the destination host. |
The value ranges from 0 to 65535. By default, it is 33434. |
-q nqueries |
Indicates the number of packets tracert packets sent each time. |
The value ranges from 1 to 65535. By default, it is 3. |
-s byte-number |
Indicates the number of data bytes to be sent. |
The value is an integer ranging from 12 to 9600, in byte, and the default value is 12 bytes. |
-vpn-instance vpn-instance-name |
Sets the VPN instance name the destination tracert host belongs to. |
It is a string of 1 to 31 in characters. |
pipe |
Indicates the TTL mode of vpn-instance is pipe. |
- |
-w timeout |
Indicates the timeout time for waiting the response packets, in milliseconds. |
It ranges from 0 to 65535. By default, it is 5000 milliseconds. |
host |
Specifies the domain name or the IP address of the destination host. |
The value is a string of 1 to 255 case-sensitive characters with spaces not supported. Alternatively, the value can be a legal IPv4 address in dotted decimal notation. |
Applicable Environment
You can run the ping command to check the connectivity of the network, and then run the tracert command to locate the fault and provide reference for fault diagnosis.
You can specify different parameters in the tracert command for different test scenarios:
Prerequisite
Procedure
When receiving a packet, each destination hop cannot find the port specified in the packet, and thus returns an ICMP Port Unreachable packet, indicating that the destination port is unreachable and the tracert test ends. In this manner, the result of each probe is displayed on the source, according to which you can find the path from the source to the destination.
Effect
Note
By default, each hop sends three probe packets. If load balancing is implemented, the same hop may correspond to different nodes. In this case, if the IP address in a probe packet is different from that in the previous probe packet, information about the IP address and MPLS label in the later probe packet is displayed. If the IP address in a probe packet is the same as that in the previous probe packet, information about the IP address and MPLS label in the previous probe packet is displayed.
# Display the gateway along the path between the local hosts to 10.26.0.115.
<sysname> tracert 10.26.0.115 traceroute to 10.26.0.115 (10.26.0.115), 30 hops max 1 172.16.112.1 0 ms 0 ms 0 ms 2 172.17.216.1 19 ms 19 ms 19 ms 3 172.17.216.1 39 ms 19 ms 19 ms 4 172.17.136.23 19 ms 39 ms 39 ms 5 172.17.168.22 20 ms 39 ms 39 ms 6 172.17.197.4 59 ms 119 ms 39 ms 7 192.168.2.5 59 ms 59 ms 39 ms 8 192.168.70.13 80 ms 79 ms 99 ms 9 192.168.71.6 139 ms 139 ms 159 ms 10 192.168.81.7 199 ms 180 ms 300 ms 11 192.168.72.17 300 ms 239 ms 239 ms 12 * * * 13 172.20.54.72 59 ms 499 ms 279 ms 14 * * * 15 * * * 16 * * * 17 * * * 18 10.26.0.115 (10.26.0.115) 339 ms 279 ms 279 ms