mtr
networkingLinux/Unix
The mtr command is one of the most frequently used commands in Linux/Unix-like operating systems. mtr Network diagnostic tool combining ping and traceroute
Quick Reference
Command Name:
mtr
Category:
networking
Platform:
Linux/Unix
Basic Usage:
mtr [options] [arguments]
Common Use Cases
Syntax
mtr [options] hostname
Options
Option | Description |
---|---|
-4 |
Use IPv4 only |
-6 |
Use IPv6 only |
-c COUNT |
Set the number of pings sent to each hop |
-f FIRST_TTL |
Set the first TTL to use, default is 1 |
-m MAX_TTL |
Set the maximum number of hops (TTL to use), default is 30 |
-s PACKETSIZE |
Set the packet size used for probing |
-B NUM |
Set the socket buffer size used for probing |
-i INTERVAL |
Set the probe interval in seconds, default is 1 second |
-G GRACETIME |
Set the number of seconds to wait for responses after the final request |
-Q TOS |
Set the Type of Service (TOS) value in IPv4 packets |
-e |
Display both IP numbers and host names |
-n |
Do not resolve hostnames, show IP addresses only |
-b |
Show both hostname and IP address |
-u |
Use UDP instead of ICMP packets |
-T |
Use TCP instead of ICMP packets |
-P PORT |
Set the target port number for TCP/UDP scans |
-Z TIMEOUT |
Set the initial probe timeout in seconds |
-r |
Bypass normal routing tables and send directly to a host |
-w |
Use wide report format showing both hostnames and IP addresses |
-z |
Display packets with timestamps |
--report |
Output a report after the specified number of pings |
--report-cycles COUNT |
Set the number of pings for the report |
--json |
Output results in JSON format |
--csv |
Output results in CSV format |
--xml |
Output results in XML format |
--aslookup |
Display the AS number (Autonomous System) |
--displaymode MODE |
Set the display mode (0 for terminal, 1 for curses) |
-o FIELDS |
Specify which fields to display (e.g., "LSD NBAW") |
Field Specifiers for -o Option:
Letter | Field |
---|---|
L |
Loss ratio |
D |
Dropped packets |
R |
Received packets |
S |
Sent packets |
N |
Newest RTT (last packet) |
B |
Best (minimum) RTT |
A |
Average RTT |
W |
Worst (maximum) RTT |
V |
Standard deviation |
G |
Geometric mean |
J |
Current jitter |
M |
Jitter mean (average) |
X |
Jitter standard deviation |
I |
Interarrival jitter |
Examples
How to Use These Examples
The examples below show common ways to use the mtr
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
mtr google.com