Tracing the Network Path with the Linux Traceroute Command

📆 · ⏳ 3 min read · ·


The Linux traceroute command is a network diagnostic tool used to trace the path of packets from a source to a destination. It works by sending packets with increasing time-to-live (TTL) values and analyzing the responses from the intermediate network devices.

By analyzing these responses, traceroute can determine the path packets take to reach their destination.

Using the Linux Traceroute Command

Traceroute for Network Path Analysis

The basic syntax of the traceroute command is as follows:

Terminal window
traceroute [options] [host]

In this syntax, host is the IP address or domain name of the destination server. If you omit the host name, traceroute will use your default gateway.

For example, the following command will trace the path to Google’s DNS server at IP address

Terminal window

When you run this command, traceroute will send packets with increasing TTL values and display the intermediate network devices along with their response times. The output will look something like this:

Terminal window
1 ( 0.500 ms 0.300 ms 0.400 ms
2 ( 5.000 ms 5.200 ms 5.100 ms
3 ( 10.000 ms 10.200 ms 10.100 ms
4 ( 20.000 ms 20.200 ms 20.100 ms
5 ( 25.000 ms 25.200 ms 25.100 ms
6 ( 30.000 ms 30.200 ms 30.100 ms
7 ( 35.000 ms 35.200 ms 35.100 ms

In this output, each line represents a network device along the path to the destination server, and the numbers in parentheses are the IP addresses of those devices.

The three response times represent the round-trip time it took for the packet to reach that device and come back.

Traceroute Command with Options:

The traceroute command also supports several options that can modify its behavior. For example, you can use the -n option to display the IP addresses instead of the domain names of the intermediate devices:

Terminal window
traceroute -n

You can also use the -m option to set the maximum number of hops before traceroute gives up:

Terminal window
traceroute -m 10


The Linux traceroute command is a valuable tool for network path analysis, allowing you to determine the path your network traffic takes to reach its destination.

By analyzing the intermediate devices and response times displayed by traceroute, you can identify any potential bottlenecks or issues that might be slowing down your network traffic.

Whether you’re a network administrator, a developer, or just a curious Linux user, the traceroute command can help you better understand how your network works.

By using the traceroute command with various options, you can customize its behavior to suit your needs and gain a deeper understanding of your network infrastructure.

You may also like

  • Setup Jellyfin with Hardware Acceleration on Orange Pi 5 (Rockchip RK3558)

    Recently I moved my Jellyfin to an Orange Pi 5 Plus server. The Orange Pi 5 has a Rockchip RK3558 SoC with integrated ARM Mali-G610. This guide will show you how to set up Jellyfin with hardware acceleration on the Orange Pi 5.

  • HTTPS with self-signed certificates for your Homelab services

    In this article we will deep dive into understanding how we can setup HTTPS with self-signed certificates for our Homelab services.This is often required when you are running your own services and you want to access them over HTTPS.

  • Setup Shareable Drive with Samba in Linux

    In this article we will setup a shareable drive in Linux with SMB. We will learn how to setup the share directory using Samba on server and how to mount it on client.