Linux MTR Command: Combining Ping and Traceroute

The mtr (My Traceroute) command is a powerful network diagnostic tool for Linux that unifies the capabilities of ping and traceroute into a single utility. While traditional tools provide static snapshots of network health, mtr continuously probes the entire network path to a destination host, offering real-time performance statistics for every intermediate hop. This article explains how mtr functions, why it bridges the gap between individual network utilities, and how to utilize it effectively for network troubleshooting.

The Limitations of Ping and Traceroute

To understand the value of mtr, it helps to examine the individual tools it replaces:

How MTR Combines Both Tools

The mtr utility integrates the route-discovery mechanism of traceroute with the continuous polling behavior of ping.

Upon execution, mtr first determines the route to the target host by sending packets with incrementing Time to Live (TTL) values. Once the path is established, it continuously sends ICMP, UDP, or TCP packets to every router along that path simultaneously.

Instead of exiting after one pass, mtr dynamically refreshes an interactive terminal interface, updating metrics for each hop in real time. This ongoing polling allows administrators to correlate packet loss or latency spikes at a specific intermediate node with downstream performance degradation.

Key Metrics Provided by MTR

When running an mtr query, the output displays a detailed statistical breakdown for each network hop:

Common Usage and Practical Commands

The mtr tool offers several command-line flags to adapt to different operational needs:

  1. Interactive Mode: Running mtr <destination> launches the default real-time curses interface, which updates continuously until terminated.
  2. Report Mode: Running mtr -r -c 100 <destination> sends 100 packets to each hop and prints a clean, static summary table suitable for pasting into support tickets or documentation.
  3. Displaying IP Addresses: The -n flag prevents reverse DNS resolution, speeding up query times and displaying pure IP addresses.
  4. Alternative Protocols: By default, mtr uses ICMP, but it can use TCP (--tcp -P <port>) or UDP (--udp) to bypass firewalls or test specific application ports.

By presenting a continuous, hop-by-hop evaluation of a network route, mtr eliminates the guesswork of network diagnostics and provides a comprehensive view of latency and packet loss across Linux environments.