How to Diagnose Network Issues Using the mtr Command in Linux

When you are troubleshooting a severe network latency issue on a Linux server, you typically rely on two classic tools: ping (to test raw connectivity) and traceroute (to map the physical path the data takes). However, bouncing between these two commands is inefficient. The traceroute command only maps the path once, meaning it completely misses intermittent, wildly fluctuating latency spikes. To continuously monitor a network path in real-time, you must upgrade to the mtr (My Traceroute) command.

How the mtr Command Works

The mtr utility elegantly combines the functionality of both ping and traceroute into a single, continuously updating, interactive terminal dashboard.

Because it must manipulate raw ICMP network sockets, it generally requires administrative privileges to run. (You can install it on Debian/Ubuntu systems using sudo apt install mtr).

To begin a live trace to a remote destination (like Google’s public DNS server), open your terminal and run:

sudo mtr 8.8.8.8

Unlike standard traceroute, which prints a static list and exits, mtr takes over your entire terminal screen. It maps every single router (hop) between your server and the destination, and then it immediately begins firing a rapid, continuous stream of ping packets at every single hop simultaneously.

How to Read the mtr Dashboard

The dashboard updates its statistics every single second, allowing you to watch the network degrade or recover in real-time. Here is how to interpret the columns:

  • Host: The IP address or hostname of the specific router at that point in the path.
  • Loss%: This is the most critical column. It shows the percentage of packets completely dropped by that specific router. If you see 0% all the way down, the connection is flawless. If hop number 4 suddenly shows 25% loss, you have instantly identified the exact piece of hardware causing your network outage.
  • Snt: The total number of packets sent so far.
  • Last / Avg / Best / Wrst: This is a real-time statistical breakdown of the latency (in milliseconds). The “Wrst” (Worst) column is excellent for catching intermittent latency spikes that a standard, one-off ping command would have completely missed.

Generating Static Reports

While the live dashboard is perfect for real-time troubleshooting, you cannot easily copy and paste a moving target to your ISP’s support team. You can force mtr to run in a static “report” mode.

sudo mtr --report --report-cycles 10 8.8.8.8

This command will run silently in the background. It will fire exactly 10 packets at every single hop, compile the data, print a single, clean statistical table to the terminal, and then exit.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.