Linux "mtr" Command Line Options and Examples
a network diagnostic tool

mtr combines the functionality of the traceroute and ping programs in a single network diagnostic tool. As mtr starts, it investigates the network connection between the host mtr runs on and HOSTNAME by sending packets with purposely low TTLs. It continues to send packets with low TTL, noting the response time of the intervening routers.


Usage:

mtr [-4|-6] [-F FILENAME] [--report] [--report-wide] [--xml] [--gtk] [--curses] [--displaymode MODE] [--raw] [--csv] [--json]
[--split] [--no-dns] [--show-ips] [-o FIELDS] [-y IPINFO] [--aslookup] [-i INTERVAL] [-c COUNT] [-s PACKETSIZE] [-B BITPATTERN]
[-G GRACEPERIOD] [-Q TOS] [--mpls] [-a ADDRESS] [-f FIRST-TTL] [-m MAX-TTL] [-U MAX-UNKNOWN] [--udp] [--tcp] [--sctp] [-P PORT]
[-L LOCALPORT] [-Z TIMEOUT] [-M MARK] HOSTNAME






Command Line Options:

-h
Print the summary of command line argument options.
mtr -h ...
-v
Print the installed version of mtr.
mtr -v ...
-6
Use IPv6 only. (IPV4 may be used for DNS lookups.)
mtr -6 ...
-F
Reads the list of hostnames from the specified file.
mtr -F ...
-r
This option puts mtr into report mode. When in this mode, mtr will run for the number of cycles specified by the -c option,and then print statistics and exit.This mode is useful for generating statistics about network quality. Note that each running instance of mtr generates a sig‐nificant amount of network traffic. Using mtr to measure the quality of your network may result in decreased network perfor‐mance.
mtr -r ...
-w
This option puts mtr into wide report mode. When in this mode, mtr will not cut hostnames in the report.
mtr -w ...
-x
Use this option to tell mtr to use the xml output format. This format is better suited for automated processing of the mea‐surement results.
mtr -x ...
-t
Use this option to force mtr to use the curses based terminal interface (if available). In case the list of hops exceeds theheight of your terminal, you can use the + and - keys to scroll up and down half a page.Ctrl-L clears spurious error messages that may overwrite other parts of the display.
mtr -t ...
--displaymode
Use this option to select the initial display mode: 0 (default) selects statistics, 1 selects the stripchart without latencyinformation, and 2 selects the stripchart with latency information.
mtr --displaymode ...
-g
Use this option to force mtr to use the GTK+ based X11 window interface (if available). GTK+ must have been available on thesystem when mtr was built for this to work. See the GTK+ web page at ⟨http://www.gtk.org/⟩ for more information about GTK+.
mtr -g ...
-l
Use the raw output format. This format is better suited for archival of the measurement results. It could be parsed to bepresented into any of the other display methods.Example of the raw output format:h 0 10.1.1.1p 0 339h 1 46.149.16.4p 1 530h 2 172.31.1.16p 2 531h 3 82.221.168.236p 3 1523h 5 195.130.211.8p 5 1603h 6 193.4.58.17p 6 1127h 7 193.4.58.17d 7 www.isnic.is
mtr -l ...
-C
Use the Comma-Separated-Value (CSV) output format. (Note: The separator is actually a semi-colon ';'.)Example of the CSV output format:MTR.0.86+git:16e39fc0;1435562787;OK;nic.is;1;r-76520-PROD.greenqloud.internal;288MTR.0.86+git:16e39fc0;1435562787;OK;nic.is;2;46.149.16.4;2086MTR.0.86+git:16e39fc0;1435562787;OK;nic.is;3;172.31.1.16;600MTR.0.86+git:16e39fc0;1435562787;OK;nic.is;4;82.221.168.236;1163MTR.0.86+git:16e39fc0;1435562787;OK;nic.is;5;???;0MTR.0.86+git:16e39fc0;1435562787;OK;nic.is;6;rix-k2-gw.isnic.is;1654MTR.0.86+git:16e39fc0;1435562787;OK;nic.is;7;www.isnic.is;1036
mtr -C ...
-j
Use this option to tell mtr to use the JSON output format. This format is better suited for automated processing of the mea‐surement results.
mtr -j ...
-p
Use this option to set mtr to spit out a format that is suitable for a split-user interface.
mtr -p ...
-n
Use this option to force mtr to display numeric IP numbers and not try to resolve the host names.
mtr -n ...
-b
Use this option to tell mtr to display both the host names and numeric IP numbers. In split mode this adds an extra field tothe output. In report mode, there is usually too little space to add the IPs, and they will be truncated. Use the widereport (-w) mode to see the IPs in report mode.
mtr -b ...
-o
Use this option to specify which fields to display and in which order. You may use one or more space characters to separatefields.Available fields:┌──┬─────────────────────┐│L │ Loss ratio │├──┼─────────────────────┤│D │ Dropped packets │├──┼─────────────────────┤│R │ Received packets │├──┼─────────────────────┤│S │ Sent Packets │├──┼─────────────────────┤│N │ Newest RTT(ms) │├──┼─────────────────────┤│B │ Min/Best RTT(ms) │├──┼─────────────────────┤│A │ Average RTT(ms) │├──┼─────────────────────┤│W │ Max/Worst RTT(ms) │├──┼─────────────────────┤│V │ Standard Deviation │├──┼─────────────────────┤│G │ Geometric Mean │├──┼─────────────────────┤│J │ Current Jitter │├──┼─────────────────────┤│M │ Jitter Mean/Avg. │├──┼─────────────────────┤│X │ Worst Jitter │├──┼─────────────────────┤│I │ Interarrival Jitter │└──┴─────────────────────┘Example: -o "LSD NBAW X"
mtr -o ...
-y
Displays information about each IP hop. Valid values for n are:0 Display AS number (equivalent to -z)1 Display IP prefix2 Display country code of the origin AS3 Display RIR (ripencc, arin, ...)4 Display the allocation date of the IP prefixIt is possible to cycle between these fields at runtime (using the y key).
mtr -y ...
-z
Displays the Autonomous System (AS) number alongside each hop. Equivalent to --ipinfo 0.Example (columns to the right not shown for clarity):1. AS??? r-76520-PROD.greenqloud.internal2. AS51969 46.149.16.43. AS??? 172.31.1.164. AS30818 82.221.168.2365. ???6. AS??? rix-k2-gw.isnic.is7. AS1850 www.isnic.is
mtr -z ...
-i
Use this option to specify the positive number of seconds between ICMP ECHO requests. The default value for this parameter isone second. The root user may choose values between zero and one.
mtr -i ...
-c
Use this option to set the number of pings sent to determine both the machines on the network and the reliability of thosemachines. Each cycle lasts one second.
mtr -c ...
-s
This option sets the packet size used for probing. It is in bytes, inclusive IP and ICMP headers.If set to a negative number, every iteration will use a different, random packet size up to that number.
mtr -s ...
-B
Specifies bit pattern to use in payload. Should be within range 0 - 255. If NUM is greater than 255, a random pattern isused.
mtr -B ...
-G
Use this option to specify the positive number of seconds to wait for responses after the final request. The default value isfive seconds.
mtr -G ...
-Q
Specifies value for type of service field in IP header. Should be within range 0 - 255.
mtr -Q ...
-e
Use this option to tell mtr to display information from ICMP extensions for MPLS (RFC 4950) that are encoded in the responsepackets.
mtr -e ...
-a
Use this option to bind the outgoing socket to ADDRESS, so that all packets will be sent with ADDRESS as source address. NOTEthat this option doesn't apply to DNS requests (which could be and could not be what you want).
mtr -a ...
-f
Specifies with what TTL to start. Defaults to 1.
mtr -f ...
-m
Specifies the maximum number of hops (max time-to-live value) traceroute will probe. Default is 30.
mtr -m ...
-U
Specifies the maximum unknown host. Default is 5.
mtr -U ...
-u
Use UDP datagrams instead of ICMP ECHO.
mtr -u ...
-T
Use TCP SYN packets instead of ICMP ECHO. PACKETSIZE is ignored, since SYN packets can not contain data.
mtr -T ...
-S
Use Stream Control Transmission Protocol packets instead of ICMP ECHO.
mtr -S ...
-P
The target port number for TCP/SCTP/UDP traces.
mtr -P ...
-L
The source port number for UDP traces.
mtr -L ...
-Z
The number of seconds to keep probe sockets open before giving up on the connection. Using large values for this, especiallycombined with a short interval, will use up a lot of file descriptors.
mtr -Z ...
-M
Set the mark for each packet sent through this socket similar to the netfilter MARK target but socket-based. MARK is 32unsigned integer. See socket(7) for full description of this socket option.ENVIRONMENTmtr recognizes a few environment variables.MTR_OPTIONSThis environment variable allows to specify options, as if they were passed on the command line. It is parsed before readingthe actual command line options, so that options specified in MTR_OPTIONS are overridden by command-line options.Example:MTR_OPTIONS="-4 -c 1" mtr -6 localhostwould send one probe (because of -c 1) towards ::1 (because of -6, which overrides the -4 passed in MTR_OPTIONS).MTR_PACKETA path to the mtr-packet executable, to be used for sending and receiving network probes. If MTR_PACKET is unset, the PATHwill be used to search for an mtr-packet executable.DISPLAYSpecifies an X11 server for the GTK+ frontend.BUGSSome modern routers give a lower priority to ICMP ECHO packets than to other network traffic. Consequently, the reliability of theserouters reported by mtr will be significantly lower than the actual reliability of these routers.CONTACT INFORMATIONFor the latest version, see the mtr web page at ⟨http://www.bitwizard.nl/mtr/⟩For patches, bug reports, or feature requests, please open an issue on GitHub at: ⟨https://github.com/traviscross/mtr⟩.
mtr -M ...