Traceroute Linux: traceroute vs mtr for Linux Network Troubleshooting

Use traceroute when you need a quick snapshot of the route, and use mtr when you need proof over time. On Linux, both tools show the hops between your machine and a target, but they answer different questions. traceroute says, “Where does this traffic appear to go right now?” mtr says, “Which hop looks bad after repeated tests?”

TLDR: traceroute is best for a fast, one-time route check, while mtr is better for spotting packet loss, jitter, and intermittent slowdowns. For example, if users report that an app “freezes” every few minutes, a 100-packet mtr test may reveal 18% loss at hop 7 while a single traceroute looks clean. In many Linux troubleshooting cases, start with traceroute, then run mtr for 2–5 minutes before blaming DNS, the server, or your ISP.

What traceroute does on Linux

traceroute maps the route from your Linux host to a destination. It works by sending packets with increasing TTL values. Each router along the way returns a response when the TTL expires. That response tells you the router’s IP address and the time it took to get there.

A basic command looks like this:

traceroute example.com

You may see output like this:

1  192.168.1.1      1.2 ms   1.0 ms   1.1 ms
2  10.20.0.1        8.4 ms   8.9 ms   8.6 ms
3  203.0.113.14    24.1 ms  25.0 ms  24.8 ms
4  * * *
5  198.51.100.22   41.3 ms  40.7 ms  41.0 ms

Each row is a hop. The three times are round-trip measurements. Asterisks mean no reply came back before the timeout. That does not always mean the hop is broken. Some routers dislike replying to diagnostic probes. Honestly, it feels like half the internet is configured to make clean troubleshooting slightly annoying.

What mtr does differently

mtr combines ping and traceroute. Instead of checking each hop once, it keeps testing. This makes it much better for catching issues that appear for a few seconds, vanish, then return right after you tell everyone the network is fine.

Install it if needed:

sudo apt install mtr
sudo dnf install mtr
sudo pacman -S mtr

Run it like this:

mtr example.com

For a clean report that you can paste into a ticket, use report mode:

mtr -rwzc 100 example.com
  • -r creates a report instead of the live screen.
  • -w gives wider output with full hostnames.
  • -z shows autonomous system numbers when supported.
  • -c 100 sends 100 probes.

The key fields are usually Loss%, Avg, Best, Wrst, and StDev. Packet loss near the final destination matters most. Loss on one middle hop can be harmless if later hops show 0% loss. Many routers rate-limit diagnostic replies but still forward traffic normally.

Traceroute vs mtr: the practical difference

traceroute is fast. It is also easy to explain. If a route suddenly goes through a strange provider or stops before reaching the destination, traceroute can show that in seconds.

mtr is slower, but more useful for real user complaints. It builds a small history. That matters because packet loss and latency spikes are often brief. A single traceroute can miss them completely.

  • Use traceroute to confirm reachability, routing path, and where replies stop.
  • Use mtr to compare loss and latency over many probes.
  • Use both when an ISP or hosting provider asks for evidence.

The catch is that neither tool tells the full story by itself. Firewalls, ICMP filtering, MPLS networks, NAT, and cloud routing can all make output weird. A scary-looking hop is not always the guilty hop.

When traceroute is the better choice

Choose traceroute when time matters and you need a route picture now. It is great during outages, DNS checks, firewall tests, and migration work.

Common examples include:

  • A server is unreachable: check where the route stops.
  • A new VPN route was added: confirm traffic takes the expected path.
  • A provider changed routing: compare the old and new hop list.
  • IPv6 testing: run traceroute6 or traceroute -6.

Useful Linux options:

traceroute -I example.com
traceroute -T -p 443 example.com
traceroute -n example.com

-I uses ICMP echo probes. -T -p 443 uses TCP probes to port 443, which can be helpful when ICMP is blocked but HTTPS works. -n skips DNS lookups, making output faster and less messy.

When mtr is the better choice

Choose mtr when the complaint includes words like sometimes, randomly, laggy, or only during calls. Those words usually mean a one-shot test will not be enough.

Run a sample size that matches the problem. For a quick check, 50 packets may be fine. For a stubborn issue, use 200 or more. If the issue happens every few minutes, let mtr run long enough to catch it.

mtr -rwzc 200 api.example.com
Image not found in postmeta

Read from the bottom up. If the final destination has 0% loss, middle-hop loss may not matter. If the final destination has 12% loss and every hop after hop 5 also shows loss, hop 5 or the link after it becomes suspicious. That is the pattern you want.

A short troubleshooting scenario

Imagine a Linux admin gets reports that SSH to a cloud server stalls every afternoon. A quick traceroute at 10:00 shows 14 hops and no obvious issue. At 14:30, users complain again. This time the admin runs:

mtr -rwzc 300 cloud.example.net

The report shows 0% loss through hop 6, then 9–14% loss from hop 7 through the destination. Average latency rises from 38 ms to 122 ms, and worst-case latency hits 870 ms. That is useful evidence. It points away from the local LAN and toward an upstream provider path.

With a single traceroute, the admin might only see one slow probe and shrug. With mtr, the pattern becomes hard to ignore.

Common mistakes that waste time

  • Blaming the first hop with loss: only blame it if later hops show the same loss pattern.
  • Ignoring the destination row: the final row matters most.
  • Testing by hostname only: DNS changes can confuse results. Test the IP too.
  • Running tests for five seconds: intermittent problems need longer samples.
  • Forgetting protocol differences: ICMP, UDP, and TCP may take different treatment through firewalls.

Best workflow for Linux network troubleshooting

Start simple. Confirm the target resolves:

dig example.com

Then check basic reachability:

ping -c 5 example.com

Next, run traceroute for the route snapshot:

traceroute -n example.com

Finally, run mtr for evidence:

mtr -rwzc 100 example.com

If HTTPS users are affected, test TCP port 443 too:

traceroute -T -p 443 example.com

The best answer is not traceroute or mtr. It is knowing when each one fits. Use traceroute for speed and route visibility. Use mtr for trends, loss, and proof. Together, they turn vague complaints like “the network is slow” into data you can act on.