How to use TRACERT to solve TCP/IP problems in Windows

How to use TRACERT to solve TCP/IP problems in Windows

Applies to: Windows Server 2019


For the Microsoft Windows 2000 version of this article, see  162326 .
 

Summary


This article introduces the command-line utility TRACERT (Trace Route), which can be used to trace the path taken by an Internet Protocol (IP) packet to its destination.


This article discusses the following topics:

  • How to use the TRACERT utility
  • How to use TRACERT to troubleshoot
  • How to use the TRACERT option

More information


How to use the TRACERT utility

The TRACERT diagnostic utility determines the route to the target address by sending Internet Control Message Protocol (ICMP) echo packets to the target address. In these packets, TRACERT uses different IP "time to live" (TTL) values. Since routers along the way are required to reduce the TTL by at least 1 before forwarding packets, TTL is actually a hop counter. When the TTL of a data packet reaches zero (0), the router sends an ICMP "timeout" message to the source computer.


TRACERT will send the first echo packet with a TTL of 1, and increase the TTL by 1 on each subsequent transmission until the target address responds or reaches the maximum value of TTL. The ICMP "timeout" message sent back by the intermediate router shows the route. Please note that some routers will discard packets with invalid TTL without sending out messages. These packets are not visible to TRACERT.


TRACERT will display a sequential list of intermediate routers that return ICMP "timeout" messages. When using the tracert command with the d option, TRACERT will not perform a DNS lookup for each IP address, so TRACERT will report the IP address of the router's near-end interface.


In the following tracert command and output example, the packet passes through two routers (157.54.48.1 and 11.1.0.67) before reaching host 11.1.0.1. In this example, the default gateway is 157.54.48.1, and the IP address of the router in network 11.1.0.0 is 11.1.0.67.

command:

C:\tracert 11.1.0.1

The output of the command:

   Tracing route to 11.1.0.1 over a maximum of 30 hops
   ---------------------------------------------------
   1      2 ms       3 ms       2 ms      157.54.48.1
   2     75 ms      83 ms      88 ms      11.1.0.67
   3     73 ms      79 ms      93 ms      11.1.0.1

   Trace complete.
 

How to use TRACERT to troubleshoot

You can use TRACERT to find out where the packet stops in the network. In the following example, the default gateway found that there is no valid path to the host in 22.110.0.1. There may be a problem with the router configuration, or the 22.110.0.0 network does not exist, so the wrong IP address is reflected.

command:

C:\tracert 22.110.0.1

The output of the command:

   Tracing route to 22.110.0.1 over a maximum of 30 hops
   -----------------------------------------------------
   1  157.54.48.1  reports: Destination net unreachable.

   Trace complete.
 

TRACERT is very useful when solving problems in large networks where several paths can reach the same point or involve many intermediate components (routers or bridges).
 

How to use the TRACERT option

There are some command-line options that can be used with TRACERT, although these options are usually not needed during standard troubleshooting.


The following example of command line syntax shows all possible options:

tracert -d -h maximum_hops -j host-list -w timeout target_host

The role of parameters:

   -d 
      Specifies to not resolve addresses to host names

   -h maximum_hops
      Specifies the maximum number of hops to search for the target

   -j host-list
      Specifies loose source route along the host-list

   -w timeout
      Waits the number of milliseconds specified by timeout for each
      reply

   target_host
      Specifies the name or IP address of the target host
 

Last Updated: November 30, 2018

Guess you like

Origin blog.csdn.net/allway2/article/details/109264818