traceroute command in Linux with Examples

Posted in

traceroute command in Linux with Examples
sangeeta.gulia

Sangeeta Gulia
Last updated on December 5, 2024

    Configuring and debugging your networking setups can become easy with tracing routes of your data. In Linux, we have a number of useful utilities for this purpose. traceroute is one of the most often used utilities. We'll go over the traceroute command, its arguments, and several examples in this article.

    What is ICMP?

    ICMP stands for Internet Control Message Protocol. When network difficulties hinder IP packet delivery, network devices such as routers employ the ICMP error-reporting protocol to generate error messages to the source IP address. ICMP produces and transmits messages to the source IP address indicating that a router, service, or host for packet delivery cannot be accessed. ICMP echo messages can be sent, received, and processed by any IP network device.

    What is the traceroute Command in Linux?

    By sending ICMP Echo Request messages to the destination and providing feedback on reachability, this command line utility measures the speed and path data takes to a destination server. It aids in identifying the source of the issue. Most platforms include traceroute as a tool, such as TRACERT for Windows or TRACEROUTE for Linux and Mac. These programs display the path that data takes from a network node to a certain IP server.

    Traceroute is a handy tool for diagnosing network faults. The hop count is represented in the first column. The address of the hop is represented in the second column, followed by three space-separated times in milliseconds. The syntax of the Linux command is:

    $ traceroute [options] host_Address [pathlength]

    Options with traceroute Command

    1. -4 option

    We specify the IP address as IPv4

    $ traceroute -4 10 google.com

    2. -6 option

    We specify the IP address as IPv6

    $ traceroute -6 10 google.com

    3. -F option

    We specify this option to avoid fragmentation of the packets

    $ traceroute -F google.com

    4. -g option

    We use this option to route the packet through a gate

    $ traceroute -g 192.168.43.45 google.com

    5. -h option

    We use this option to specify the maximum number of hops to search for the target

    $ traceroute -h google.com

    6. -p option

    We use this option to specify the destination port that we must use. The default port for the destination is 33434

    $ traceroute -p 1000 google.com

    Conclusion

    We went through the description of the traceroute command in Linux in this article, which allows us to track the path of our packets. This command also has a number of arguments that we can use to change the command's default behavior.

    People are also reading:

    Leave a Comment on this Post

    0 Comments