📜  traceroute cmd (1)

📅  最后修改于: 2023-12-03 15:20:40.295000             🧑  作者: Mango

TraceRoute Cmd

traceroute is a command-line utility that allows you to trace the path that internet traffic takes from your computer to a specified destination.

Syntax

The syntax of traceroute is as follows:

traceroute [options] [hostname or IP address]
Options

traceroute has several options that you can use to customize its behavior:

  • -d: Use the ICMP ECHO protocol instead of UDP datagrams. This can be useful if the destination blocks UDP traffic.
  • -f: Set the initial TTL (time-to-live) value. The default value is 1.
  • -i: Set the network interface to use for sending traffic.
  • -N: Set the number of probes per hop. The default value is 3.
  • -p: Set the UDP port number. The default value is 33434.
  • -q: Set the number of queries per hop. The default value is 1.
  • -t: Set the maximum number of hops to allow before giving up. The default value is 30.
Example Usage

Here is an example traceroute command:

traceroute -q 1 -w 1 -m 25 google.com

This command will send one query per hop (-q 1) with a timeout of one second (-w 1) and a maximum of 25 hops (-m 25) to the Google.com server.

Output

The output of traceroute is displayed in columns and rows, with each row representing a different hop. The columns contain information about each router or server that the traffic passes through.

The first column shows the hop number, while the second column shows the IP address of the router or server. The remaining columns show the latency (in milliseconds) of each probe that was sent.

Conclusion

traceroute is a powerful tool that can help you diagnose network issues and determine the route that your traffic takes to reach its destination. By using the various options and interpreting the output, you can gain valuable insight into the workings of the internet.