Have a network problem? Don't panic! MTR will help you.
MTR is a powerful network diagnostic tool that allows system administrators to diagnose and locate network errors and provide network status reports to upstream providers. Mtr combines the functions of traceroute and ping programs in a single network diagnostic tool.
When mtr is started, it investigates the network connection between the hosts mtr and HOSTNAME that are running it by sending packets with deliberately low TTL. It continues to send low-TTL packets and notes the response time of the intermediate router. This allows mtr to print the response percentage and response time of Internet routes to HOSTNAME. Packet loss or a sudden increase in response time usually indicates a bad link (or just overload).
The results are usually reported as round trip response time (in milliseconds) and as a percentage of packet loss.
Install mtr
Ubuntu/Debian
Sudo apt install mtr
CentOS
Sudo yum install mtr
Arch Linux
Pacman-S mtr
MacOS
Brew install mtr uses [root@ecs-0bca0b85-450b ~] # mtr-husage: mtr [- BfhvrwctglxspQomniuT46] [--help] [--version] [--report] [--report-wide] [--report-cycles=COUNT] [--gtk] [--csv |-- C] [--raw] [--xml] [--split] [--mpls] [-- -no-dns] [--show-ips] [--filename=FILE |-F] [--ipinfo=item_no |-y item_no] [--aslookup |-z] [--psize=bytes/-s bytes] [--order fields] [--report-wide |-w] [--inet] [-- -inet6] [--max-ttl=NUM] [--first-ttl=NUM] [--bitpattern=NUM] [--tos=NUM] [--udp] [--tcp] [--port=PORT] [--timeout=SECONDS] [--interval=SECONDS] HOSTNAME
After installing MTR on Linux or MacOS, you can generate MTR reports using the following syntax:
Mtr-rw [destination_host]
For example, to test the quality of routes and network connections to host meterpreter.org, execute the following command on the source host:
Mtr-rw www.linuxidc.comStart: 2020-03-26T09:23:10+0800HOST: linux Loss% Snt Last Avg Best Wrst StDev 1. |-- _ gateway 0.0% 10 0.3 0.3 0.2 0.5 0.1 2. |--?? 100.0 100.0 0.0 0.0 0.0
In this way, we can get the delay and packet loss rate of the network equipment and destination, and the analysis of the packet loss rate on the path can help us to judge the network problem.
Original address: https://www.linuxprobe.com/network-mtr-tool.html