- Priya
- November 27, 2021
Steps to Setup MTR Network Diagnostic Tool on Ubuntu 20.04 LTS
Mtr(my traceroute) is a free & open source command line network diagnostic tool. It helps to provide the functionality of both the ping and traceroute commands. It is a simple tool that display the information about the network packets. Using MTR, we can easily get the network & domain-name information.
There are few steps to setup MTR on ubuntu:
Step 1: Update the System.
apt-get update
Step 2: Install the MTR on system.
apt-get install mtr
- Here is the command output.
- Check the MTR version.
mtr -v
- Here is the command output.
root@ip-172-31-38-125:/home/ubuntu# mtr -v
mtr 0.93
Step 3: MTR Syntax & Examples:
- To display the traceroute report.
mtr
- Here is the command output.
- To view the hostnames in the traceroute report.
Syntax:
mtr [domainName/IP]
Example:
mtr google.com
- Here is the command output.
- To show the numeric IP addresses instead of the hostnames in the traceroute report.
Syntax:
mtr -g [domainName/IP]
Example:
mtr -g google.com
- Here is the command output.
- To view both the numeric IP addresses and the hostnames in the traceroute report.
Syntax:
mtr -b [domainName/IP]
Example:
mtr -b google.com
- Here is the command output.
- To exit after printing the traceroute report for a specific number of pings.
Syntax:
mtr -c [n] “domainname/IP”
Example:
mtr -c 10 google.com
- Here is the command output.
- To save trace-route report into a file.
Syntax:
mtr -r -c [n] “domainname/IP” >”report-name”
Example:
mtr -r -c 10 google.com >mtr-report-google
- To delete the traceroute report.
Syntax:
mtr –rw -c [n] “domainname/IP” >”report-name”
Example:
mtr -rw -c 10 google.com >mtr-report-google
- To Specify a Time Interval between ICMP ECHO requests.By default is 1 second.
Syntax:
mtr -i [time-in-seconds] “domainName/IP”
Example:
mtr -i 10 google.com
- Here is the command output.
- To use TCP SYN packets or UDP datagrams.
Syntax:
mtr –tcp “domainName/IP”
mtr –udp “domainName/IP”
Example:
mtr --tcp google.com
- Here is the command output.
Example:
mtr --udp google.com
- Here is the command output.
- To list all available options of MTR.
man mtr
or
mtr -h
- Here is the command output.