man-pages/man8/mtr.8.html
2021-03-31 01:06:50 +01:00

602 lines
17 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of MTR</TITLE>
</HEAD><BODY>
<H1>MTR</H1>
Section: System Administration (8)<BR>Updated: 0.93<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
mtr - a network diagnostic tool
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>mtr</B>
[<B>-4</B>|<B>-6</B>]
[<B>-F</B><I>&nbsp;FILENAME</I>]
[<B>--report</B>]
[<B>--report-wide</B>]
[<B>--xml</B>]
[<B>--gtk</B>]
[<B>--curses</B>]
[<B>--displaymode</B><I>&nbsp;MODE</I>]
[<B>--raw</B>]
[<B>--csv</B>]
[<B>--json</B>]
[<B>--split</B>]
[<B>--no-dns</B>]
[<B>--show-ips</B>]
[<B>-o</B><I>&nbsp;FIELDS</I>]
[<B>-y</B><I>&nbsp;IPINFO</I>]
[<B>--aslookup</B>]
[<B>-i</B><I>&nbsp;INTERVAL</I>]
[<B>-c</B><I>&nbsp;COUNT</I>]
[<B>-s</B><I>&nbsp;PACKETSIZE</I>]
[<B>-B</B><I>&nbsp;BITPATTERN</I>]
[<B>-G</B><I>&nbsp;GRACEPERIOD</I>]
[<B>-Q</B><I>&nbsp;TOS</I>]
[<B>--mpls</B>]
[<B>-I</B><I>&nbsp;NAME</I>]
[<B>-a</B><I>&nbsp;ADDRESS</I>]
[<B>-f</B><I>&nbsp;FIRST-TTL</I>]
[<B>-m</B><I>&nbsp;MAX-TTL</I>]
[<B>-U</B><I>&nbsp;MAX-UNKNOWN</I>]
[<B>--udp</B>]
[<B>--tcp</B>]
[<B>--sctp</B>]
[<B>-P</B><I>&nbsp;PORT</I>]
[<B>-L</B><I>&nbsp;LOCALPORT</I>]
[<B>-Z</B><I>&nbsp;TIMEOUT</I>]
[<B>-M</B><I>&nbsp;MARK</I>]
<I>HOSTNAME</I>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>mtr </B>
combines the functionality of the
<B>traceroute</B>
and
<B>ping</B>
programs in a single network diagnostic tool.
<P>
As
<B>mtr </B>
starts, it investigates the network connection between the host
<B>mtr</B>
runs on and
<B>HOSTNAME</B>
by sending packets with purposely low TTLs. It continues to send
packets with low TTL, noting the response time of the intervening
routers. This allows
<B>mtr </B>
to print the response percentage and response times of the internet
route to
<B>HOSTNAME</B>.
A sudden increase in packet loss or response time is often an indication
of a bad (or simply overloaded) link.
<P>
The results are usually reported as round-trip-response times in milliseconds
and the percentage of packetloss.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<DL COMPACT>
<DT id="1"><B>-h</B>, <B>--help</B>
<DD>
Print the summary of command line argument options.
<DT id="2"><B>-v</B>, <B>--version</B>
<DD>
Print the installed version of mtr.
<DT id="3"><B>-4</B>
<DD>
Use IPv4 only.
<DT id="4"><B>-6</B>
<DD>
Use IPv6 only. (IPV4 may be used for DNS lookups.)
<DT id="5"><B>-F </B><I>FILENAME</I>, <B>--filename </B><I>FILENAME</I>
<DD>
Reads the list of hostnames from the specified file.
<DT id="6"><B>-r</B>, <B>--report</B>
<DD>
This option puts
<B>mtr</B>
into
<B>report</B>
mode. When in this mode,
<B>mtr</B>
will run for the number of cycles specified by the
<B>-c</B>
option, and then print statistics and exit.
<DT id="7"><DD>This mode is useful for generating statistics about network quality.
Note that each running instance of
<B>mtr</B>
generates a significant amount of network traffic. Using
<B>mtr</B>
to measure the quality of your network may result in decreased
network performance.
<DT id="8"><B>-w</B>, <B>--report-wide</B>
<DD>
This option puts
<B>mtr</B>
into
<B>wide report</B>
mode. When in this mode,
<B>mtr</B>
will not cut hostnames in the report.
<DT id="9"><B>-x</B>, <B>--xml</B>
<DD>
Use this option to tell
<B>mtr</B>
to use the xml output format. This format is better suited for
automated processing of the measurement results.
<DT id="10"><B>-t</B>, <B>--curses</B>
<DD>
Use this option to force
<B>mtr </B>
to use the curses based terminal
interface (if available).
In case the list of hops exceeds the
height of your terminal, you can use the
<B>+</B>
and
<B>-</B>
keys to scroll up and down half a page.
<P>
<B>Ctrl</B>-L
clears spurious error messages that may overwrite other parts of the display.
<P>
<DT id="11"><B>--displaymode </B><I>MODE</I>
<DD>
Use this option to select the initial display mode: 0 (default)
selects statistics, 1 selects the stripchart without latency
information, and 2 selects the stripchart with latency
information.
<DT id="12"><B>-g</B>, <B>--gtk</B>
<DD>
Use this option to force
<B>mtr </B>
to use the GTK+ based X11 window interface (if available).
GTK+ must have been available on the system when
<B>mtr </B>
was built for this to work. See the GTK+ web page at
for more information about GTK+.
<DT id="13"><B>-l</B>, <B>--raw</B>
<DD>
Use the raw output format. This format is better suited for
archival of the measurement results. It could be parsed to
be presented into any of the other display methods.
<DT id="14"><DD>
Example of the raw output format:
<PRE>
h 0 10.1.1.1
p 0 339
h 1 46.149.16.4
p 1 530
h 2 172.31.1.16
p 2 531
h 3 82.221.168.236
p 3 1523
h 5 195.130.211.8
p 5 1603
h 6 193.4.58.17
p 6 1127
h 7 193.4.58.17
d 7 <A HREF="http://www.isnic.is">www.isnic.is</A>
</PRE>
<DT id="15"><B>-C</B>, <B>--csv</B>
<DD>
Use the Comma-Separated-Value (CSV) output format.
(Note: The separator is actually a semi-colon ';'.)
<DT id="16"><DD>
Example of the CSV output format:
<PRE>
MTR.0.86+git:16e39fc0;1435562787;OK;nic.is;1;r-76520-PROD.greenqloud.internal;288
MTR.0.86+git:16e39fc0;1435562787;OK;nic.is;2;46.149.16.4;2086
MTR.0.86+git:16e39fc0;1435562787;OK;nic.is;3;172.31.1.16;600
MTR.0.86+git:16e39fc0;1435562787;OK;nic.is;4;82.221.168.236;1163
MTR.0.86+git:16e39fc0;1435562787;OK;nic.is;5;???;0
MTR.0.86+git:16e39fc0;1435562787;OK;nic.is;6;rix-k2-gw.isnic.is;1654
MTR.0.86+git:16e39fc0;1435562787;OK;nic.is;7;<A HREF="http://www.isnic.is">www.isnic.is</A>;1036
</PRE>
<DT id="17"><B>-j</B>, <B>--json</B>
<DD>
Use this option to tell
<B>mtr</B>
to use the JSON output format. This format is better suited for
automated processing of the measurement results.
<DT id="18"><B>-p</B>, <B>--split</B>
<DD>
Use this option to set
<B>mtr </B>
to spit out a format that is suitable for a split-user interface.
<DT id="19"><B>-n</B>, <B>--no-dns</B>
<DD>
Use this option to force
<B>mtr </B>
to display numeric IP numbers and not try to resolve the
host names.
<DT id="20"><B>-b</B>, <B>--show-ips</B>
<DD>
Use this option to tell
<B>mtr</B>
to display both the host names and numeric IP numbers. In split mode
this adds an extra field to the output. In report mode, there is usually
too little space to add the IPs, and they will be truncated. Use the
wide report (-w) mode to see the IPs in report mode.
<DT id="21"><B>-o </B><I>FIELDS</I>, <B>--order </B><I>FIELDS</I>
<DD>
Use this option to specify which fields to display and in which order.
You may use one or more space characters to separate fields.
<BR>
Available fields:
<CENTER><TABLE BORDER>
<TR VALIGN=top><TD>L</TD><TD>Loss ratio<BR></TD></TR>
<TR VALIGN=top><TD>D</TD><TD>Dropped packets<BR></TD></TR>
<TR VALIGN=top><TD>R</TD><TD>Received packets<BR></TD></TR>
<TR VALIGN=top><TD>S</TD><TD>Sent Packets<BR></TD></TR>
<TR VALIGN=top><TD>N</TD><TD>Newest RTT(ms)<BR></TD></TR>
<TR VALIGN=top><TD>B</TD><TD>Min/Best RTT(ms)<BR></TD></TR>
<TR VALIGN=top><TD>A</TD><TD>Average RTT(ms)<BR></TD></TR>
<TR VALIGN=top><TD>W</TD><TD>Max/Worst RTT(ms)<BR></TD></TR>
<TR VALIGN=top><TD>V</TD><TD>Standard Deviation<BR></TD></TR>
<TR VALIGN=top><TD>G</TD><TD>Geometric Mean<BR></TD></TR>
<TR VALIGN=top><TD>J</TD><TD>Current Jitter<BR></TD></TR>
<TR VALIGN=top><TD>M</TD><TD>Jitter Mean/Avg.<BR></TD></TR>
<TR VALIGN=top><TD>X</TD><TD>Worst Jitter<BR></TD></TR>
<TR VALIGN=top><TD>I</TD><TD>Interarrival Jitter<BR></TD></TR>
</TABLE></CENTER>
<BR>
<P>
Example:
-o &quot;LSD NBAW X&quot;
<DT id="22"><B>-y </B><I>n</I>, <B>--ipinfo </B><I>n</I>
<DD>
Displays information about each IP hop. Valid values for <I>n</I> are:
<TABLE>
<TR VALIGN=top><TD>0</TD><TD>Display AS number (equivalent to <B>-z</B>)<BR></TD></TR>
<TR VALIGN=top><TD>1</TD><TD>Display IP prefix<BR></TD></TR>
<TR VALIGN=top><TD>2</TD><TD>Display country code of the origin AS<BR></TD></TR>
<TR VALIGN=top><TD>3</TD><TD>Display RIR (ripencc, arin, ...)<BR></TD></TR>
<TR VALIGN=top><TD>4</TD><TD>Display the allocation date of the IP prefix<BR></TD></TR>
</TABLE>
<BR>
<P>
It is possible to cycle between these fields at runtime (using the <B>y</B> key).
<DT id="23"><B>-z</B>, <B>--aslookup</B>
<DD>
Displays the Autonomous System (AS) number alongside each hop. Equivalent to <B>--ipinfo 0</B>.
<DT id="24"><DD>
Example (columns to the right not shown for clarity):
<PRE>
1. AS??? r-76520-PROD.greenqloud.internal
2. AS51969 46.149.16.4
3. AS??? 172.31.1.16
4. AS30818 82.221.168.236
5. ???
6. AS??? rix-k2-gw.isnic.is
7. AS1850 <A HREF="http://www.isnic.is">www.isnic.is</A>
</PRE>
<DT id="25"><B>-i </B><I>SECONDS</I>, <B>--interval </B><I>SECONDS</I>
<DD>
Use this option to specify the positive number of seconds between ICMP
ECHO requests. The default value for this parameter is one second. The
root user may choose values between zero and one.
<DT id="26"><B>-c </B><I>COUNT</I>, <B>--report-cycles </B><I>COUNT</I>
<DD>
Use this option to set the number of pings sent to determine
both the machines on the network and the reliability of
those machines. Each cycle lasts one second.
<DT id="27"><B>-s </B><I>PACKETSIZE</I>, <B>--psize </B><I>PACKETSIZE</I>
<DD>
This option sets the packet size used for probing. It is in bytes,
inclusive IP and ICMP headers.
<P>
If set to a negative number, every iteration will use a different, random
packet size up to that number.
<DT id="28"><B>-B </B><I>NUM</I>, <B>--bitpattern </B><I>NUM</I>
<DD>
Specifies bit pattern to use in payload. Should be within range 0 - 255. If
<I>NUM</I>
is greater than 255, a random pattern is used.
<DT id="29"><B>-G </B><I>SECONDS</I>, <B>--gracetime </B><I>SECONDS</I>
<DD>
Use this option to specify the positive number of seconds to wait for responses
after the final request. The default value is five seconds.
<DT id="30"><B>-Q </B><I>NUM</I>, <B>--tos </B><I>NUM</I>
<DD>
Specifies value for type of service field in IP header. Should be within range 0
- 255.
<DT id="31"><B>-e</B>, <B>--mpls</B>
<DD>
Use this option to tell
<B>mtr </B>
to display information from ICMP extensions for MPLS (RFC 4950)
that are encoded in the response packets.
<DT id="32"><B>-I </B><I>NAME</I>, <B>--interface </B><I>NAME</I>
<DD>
Use the network interface with a specific name for sending network probes.
This can be useful when you have multiple network interfaces with routes
to your destination, for example both wired Ethernet and WiFi, and wish
to test a particular interface.
<DT id="33"><B>-a </B><I>ADDRESS</I>, <B>--address </B><I>ADDRESS</I>
<DD>
Use this option to bind the outgoing socket to
<I>ADDRESS</I>,
so that all packets will be sent with
<I>ADDRESS</I>
as source address. NOTE that this option doesn't apply to DNS requests
(which could be and could not be what you want).
<DT id="34"><B>-f </B><I>NUM</I>, <B>--first-ttl </B><I>NUM</I>
<DD>
Specifies with what TTL to start. Defaults to 1.
<DT id="35"><B>-m </B><I>NUM</I>, <B>--max-ttl </B><I>NUM</I>
<DD>
Specifies the maximum number of hops (max time-to-live value) traceroute will
probe. Default is 30.
<DT id="36"><B>-U </B><I>NUM</I>, <B>--max-unknown </B><I>NUM</I>
<DD>
Specifies the maximum unknown host. Default is 5.
<DT id="37"><B>-u</B>, <B>--udp</B>
<DD>
Use UDP datagrams instead of ICMP ECHO.
<DT id="38"><B>-T</B>, <B>--tcp</B>
<DD>
Use TCP SYN packets instead of ICMP ECHO.
<I>PACKETSIZE</I>
is ignored, since SYN packets can not contain data.
<DT id="39"><B>-S</B>, <B>--sctp</B>
<DD>
Use Stream Control Transmission Protocol packets instead of ICMP ECHO.
<DT id="40"><B>-P </B><I>PORT</I>, <B>--port </B><I>PORT</I>
<DD>
The target port number for TCP/SCTP/UDP traces.
<DT id="41"><B>-L </B><I>LOCALPORT</I>, <B>--localport </B><I>LOCALPORT</I>
<DD>
The source port number for UDP traces.
<DT id="42"><B>-Z </B><I>SECONDS</I>, <B>--timeout </B><I>SECONDS</I>
<DD>
The number of seconds to keep probe sockets open before giving up on
the connection. Using large values for this, especially combined with
a short interval, will use up a lot of file descriptors.
<DT id="43"><B>-M </B><I>MARK</I>, <B>--mark </B><I>MARK</I>
<DD>
Set the mark for each packet sent through this socket similar to the
netfilter MARK target but socket-based.
<I>MARK</I>
is 32 unsigned integer. See
<B><A HREF="/cgi-bin/man/man2html?7+socket">socket</A></B>(7)
for full description of this socket option.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>ENVIRONMENT</H2>
<B>mtr</B>
recognizes a few environment variables.
<DL COMPACT>
<DT id="44"><B>MTR_OPTIONS</B>
<DD>
This environment variable allows one to specify options, as if they
were passed on the command line. It is parsed before reading the
actual command line options, so that options specified in
<B>MTR_OPTIONS</B>
are overridden by command-line options.
<P>
Example:
<P>
<B>MTR_OPTIONS</B><I>=-4&nbsp;-c&nbsp;1</I>
<B>mtr</B>
<I>-6&nbsp;localhost</I>
<P>
would send one probe (because of
<I>-c&nbsp;1</I>) towards
<B>::1</B>
(because of
<I>-6</I>,
which overrides the
<I>-4</I>
passed in
<B>MTR_OPTIONS</B>).
<DT id="45"><B>MTR_PACKET</B>
<DD>
A path to the
<I>mtr-packet</I>
executable, to be used for sending and receiving network probes. If
<B>MTR_PACKET</B>
is unset, the
<B>PATH</B>
will be used to search for an
<I>mtr-packet</I>
executable.
<DT id="46"><B>DISPLAY</B>
<DD>
Specifies an X11 server for the GTK+ frontend.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>INTERACTIVE CONTROL</H2>
<B>mtr</B>
can be controlled while it is running with the following keys:
<BR>&nbsp;&nbsp;?|h&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;help
<BR>&nbsp;&nbsp;p&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pause&nbsp;(SPACE&nbsp;to&nbsp;resume)
<BR>&nbsp;&nbsp;d&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switching&nbsp;display&nbsp;mode
<BR>&nbsp;&nbsp;e&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;toggle&nbsp;MPLS&nbsp;information&nbsp;on/off
<BR>&nbsp;&nbsp;n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;toggle&nbsp;DNS&nbsp;on/off
<BR>&nbsp;&nbsp;r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reset&nbsp;all&nbsp;counters
<BR>&nbsp;&nbsp;o&nbsp;str&nbsp;&nbsp;&nbsp;set&nbsp;the&nbsp;columns&nbsp;to&nbsp;display,&nbsp;default&nbsp;str='LRS&nbsp;N&nbsp;BAWV'
<BR>&nbsp;&nbsp;j&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;toggle&nbsp;latency(LS&nbsp;NABWV)/jitter(DR&nbsp;AGJMXI)&nbsp;stats
<BR>&nbsp;&nbsp;c&nbsp;&lt;n&gt;&nbsp;&nbsp;&nbsp;report&nbsp;cycle&nbsp;n,&nbsp;default&nbsp;n=infinite
<BR>&nbsp;&nbsp;i&nbsp;&lt;n&gt;&nbsp;&nbsp;&nbsp;set&nbsp;the&nbsp;ping&nbsp;interval&nbsp;to&nbsp;n&nbsp;seconds,&nbsp;default&nbsp;n=1
<BR>&nbsp;&nbsp;f&nbsp;&lt;n&gt;&nbsp;&nbsp;&nbsp;set&nbsp;the&nbsp;initial&nbsp;time-to-live(ttl),&nbsp;default&nbsp;n=1
<BR>&nbsp;&nbsp;m&nbsp;&lt;n&gt;&nbsp;&nbsp;&nbsp;set&nbsp;the&nbsp;max&nbsp;time-to-live,&nbsp;default&nbsp;n=&nbsp;#&nbsp;of&nbsp;hops
<BR>&nbsp;&nbsp;s&nbsp;&lt;n&gt;&nbsp;&nbsp;&nbsp;set&nbsp;the&nbsp;packet&nbsp;size&nbsp;to&nbsp;n&nbsp;or&nbsp;random(n&lt;0)
<BR>&nbsp;&nbsp;b&nbsp;&lt;c&gt;&nbsp;&nbsp;&nbsp;set&nbsp;ping&nbsp;bit&nbsp;pattern&nbsp;to&nbsp;c(0..255)&nbsp;or&nbsp;random(c&lt;0)
<BR>&nbsp;&nbsp;Q&nbsp;&lt;t&gt;&nbsp;&nbsp;&nbsp;set&nbsp;ping&nbsp;packet's&nbsp;TOS&nbsp;to&nbsp;t
<BR>&nbsp;&nbsp;u&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switch&nbsp;between&nbsp;ICMP&nbsp;ECHO&nbsp;and&nbsp;UDP&nbsp;datagrams
<BR>&nbsp;&nbsp;y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switching&nbsp;IP&nbsp;info
<BR>&nbsp;&nbsp;z&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;toggle&nbsp;ASN&nbsp;info&nbsp;on/off
<BR>&nbsp;&nbsp;q&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit
<A NAME="lbAH">&nbsp;</A>
<H2>BUGS</H2>
Some modern routers give a lower priority to ICMP ECHO packets than
to other network traffic. Consequently, the reliability of these
routers reported by
<B>mtr</B>
will be significantly lower than the actual reliability of
these routers.
<A NAME="lbAI">&nbsp;</A>
<H2>CONTACT INFORMATION</H2>
<P>
For the latest version, see the mtr web page at
<P>
For patches, bug reports, or feature requests, please open an issue on
GitHub at:
<A NAME="lbAJ">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?8+mtr-packet">mtr-packet</A></B>(8),
<B><A HREF="/cgi-bin/man/man2html?8+traceroute">traceroute</A></B>(8),
<B><A HREF="/cgi-bin/man/man2html?8+ping">ping</A></B>(8),
<B><A HREF="/cgi-bin/man/man2html?7+socket">socket</A></B>(7),
TCP/IP Illustrated (Stevens, ISBN 0201633469).
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="47"><A HREF="#lbAB">NAME</A><DD>
<DT id="48"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="49"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="50"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="51"><A HREF="#lbAF">ENVIRONMENT</A><DD>
<DT id="52"><A HREF="#lbAG">INTERACTIVE CONTROL</A><DD>
<DT id="53"><A HREF="#lbAH">BUGS</A><DD>
<DT id="54"><A HREF="#lbAI">CONTACT INFORMATION</A><DD>
<DT id="55"><A HREF="#lbAJ">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:06:14 GMT, March 31, 2021
</BODY>
</HTML>