< Home

tracert

Function

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.

Format

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

Parameters

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.

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

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:

  • To check information about nodes between the source and the destination, run the tracert host command.
  • To check information about nodes between the source and the destination on an L3VPN, run the tracert -vpn-instance vpn-instance-name host command. On an L3VPN, devices may not have each other's routing information, and thus you cannot use the tracert host command to check whether the peer is reachable. In this case, you can run the tracert -vpn-instance vpn-instance-name host command to check information about nodes between the source and the destination in a specified VPN instance.
  • To check information about nodes between the source and the destination in the case of poor network quality, run the tracert -q nqueries -w timeout host command. In the case of unreliable networks, you are recommended to set -q and -w to larger values so that you can obtain accurate information.
  • To check information about nodes along a segment of a path, run the tracert -f first-TTL -m max-TTL host command carrying the specified initial TTL and maximum TTL.

Prerequisite

  • Ensure that the UDP module of each node works properly; otherwise, the tracert operation fails.
  • If vpn-instance is configured, ensure that the VPN module of each node works properly.
  • Ensure that the ICMP module of each node works properly; otherwise, " * * * " is displayed.

Procedure

The execution process of the tracert command is as follows:
  1. The source sends a packet with the TTL being 1. After the TTL times out, the first hop sends an ICMP Error packet to the source, indicating that the packet cannot be forwarded.
  2. The source sends a packet with the TTL being 2. After the TTL times out, the first hop sends an ICMP Error packet to the source, indicating that the packet cannot be forwarded.
  3. The source sends a packet with the TTL being 3. After the TTL times out, the first hop sends an ICMP Error packet to the source, indicating that the packet cannot be forwarded.
  4. The preceding process proceeds until the packet reaches the destination.

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

If a fault occurs when you run the tracert command, the following information may be displayed:
  • !H: The host is unreachable.
  • !N: The network is unreachable.
  • !: The port is unreachable.
  • !P: The protocol type is incorrect.
  • !F: The packet is incorrectly fragmented.
  • !S: The source route is incorrect.

Note

Once -r is configured, both the tracert and ping command outputs display information about nodes between the source and the destination. Differences between the tracert and ping command outputs are as follows:
  • If the ping command times out on an intermediate node, a timeout packet is returned and the command output displays no path information.
  • If the tracert command times out on an intermediate node, the command output displays " * * * " indicating that the tracert times out on the node, and the tracert test is not interrupted.

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.

Example

# 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
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >