• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

mtr Command Examples in Linux

by admin

The mtr utility is a combination of ping and traceroute, with additional improvements to enable testing of the quality of a network connection. Ping packets are sent to the destination in large groups, with mtr noting how long responses take to the packets.

The mtr command also takes note of lost packets, a symptom of a problem called packet drop or packet loss. This occurs when one or more packets sent from a source are unable to reach their intended destination. Packet loss can cause latency if the packets are queued for retransmission, or the data may not be successfully transmitted at all. A large number of lost packets are a strong indicator of a network issue along the path. By identifying that the issue exists, as well as where in the path it exists, mtr enables an administrator to find potentially failed networking components. The output of mtr identifies the percentage of packets along the path that are dropped, and one or more nodes in that path experiencing a high percentage of packet loss may be at fault.

Syntax

The syntax of the mtr command is:

# mtr [options] [hostname]

On some Linux systems, you will need to run this as the root user or in conjunction with sudo, but whatever method you use, the syntax of this command is very simple and it works in the following way:

# mtr google.com

The output may look similar to traceroute, but the display is in real-time, thereby enabling you to monitor trends and averages to reflect how network performance changes over time.

mtr Command Examples

1. Traceroute to a host and continuously ping all intermediary hops:

# mtr host

2. Disable IP address and host name mapping:

# mtr -n host

3. Generate output after pinging each hop 10 times:

# mtr -w host

4. Force IP IPv4 or IPV6:

# mtr -4 host

5. Wait for a given time (in seconds) before sending another packet to the same hop:

# mtr -i seconds host

6. Display the Autonomous System Number (ASN) for each hop:

# mtr --aslookup hostname

Conclusion

The mtr utility is a network diagnostic tool which combines aspects of ping and traceroute. The name mtr is actually short for “my traceroute. ” Instead of sending a single set of packets like traceroute, mtr continuously sends additional packets after the previous is received (similar to ping).

Filed Under: Linux

Some more articles you might also be interested in …

  1. “git stamp” Command Examples
  2. cargo test: Execute the unit and integration tests of a Rust package
  3. certbot: command not found
  4. CentOS / RHEL : How to block incoming and outgoing ports using iptables
  5. convert: ImageMagick image conversion tool
  6. lpq Command Examples in Linux
  7. arp: command not found
  8. login: command not found
  9. gox Command Examples
  10. st Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright