The Wayback Machine - https://web.archive.org/web/20210215151133/https://www.geeksforgeeks.org/traceroute-command-in-linux-with-examples/
Skip to content
Related Articles

Related Articles

traceroute command in Linux with Examples
  • Last Updated : 27 May, 2019

traceroute command in Linux prints the route that a packet takes to reach the host. This command is useful when you want to know about the route and about all the hops that a packet takes. Below image depicts how traceroute command is used to reach the Google(172.217.26.206) host from the local machine and it also prints detail about all the hops that it visits in between.

Image

The first column corresponds to the hop count. The second column represents the address of that hop and after that, you see three space-separated time in milliseconds. traceroute command sends three packets to the hop and each of the time refers to the time taken by the packet to reach the hop.

Syntax:

traceroute [options]  host_Address [pathlength]

Options:



  • -4 Option: Use ip version 4 i.e. use IPv4

    Syntax:

    $ traceroute -4 10 google.com

    Image

  • -6 Option: Use ip version 6 i.e. use IPv6

    Syntax:

    $ traceroute -6 10 google.com

    Image

  • -F Option: Do not fragment packet.

    Syntax:

    $ traceroute -F google.com

    Image

  • -f first_ttl Option: Start from the first_ttl hop (instead from 1).

    Syntax:

    $ traceroute -f 10 google.com

    Image

  • -g gate Option: Route the packet through gate.

    Syntax:

    $ traceroute -g 192.168.43.45 google.com

    Image

  • -m max_ttl Option: Set the max number of hops for the packet to reach the destination.Default value is 30.

    Syntax:

    $traceroute  -m 5 google.com

    Image

  • -n Option: Do not resolve IP addresses to their domain names.

    Syntax:

    $traceroute -n google.com

    Image

  • -p port Option: Set the destination port to use. Default is 33434.

    Syntax:

    $traceroute  -p 20292 google.com

    Image

  • -q nqueries Option: Set the number of probes per each hop. Default is 3.

    Syntax:

    $traceroute -q 1 google.com

    Image

  • packetlen Option: The full packet length. Default len is 60 byte packets.

    Syntax:

    $traceroute  google.com 100

    Image

  • –help: Display help messages and exit.

    Syntax:

    $traceroute --help

    Image

    Image

My Personal Notes arrow_drop_up
Recommended Articles
Page :