To begin with, you should install this utility if it is not already on your server.
For Ubuntu / Debian
apt install mtr
For CentOS
yum install mtr
The structure of using the utility's commands is as follows:
mtr "arguments" "address"
List of valid arguments
-h: Get a brief help.
-v: Display the utility version.
--udp: Use UDP packets instead of standard ICMP.
--tcp: Use TCP packets instead of standard ICMP.
-4: Use IPv4 protocol.
-6: Use IPv6 protocol.
-c: The number of packets to be sent.
-r: Collect trace in the background and display a report when finished.
-w: Performs the same function as -r but in a more complete format.
-s: Specify the size of sent packets.
-f: Enter the initial TTL value.
-e: Display MPLS data.
-n: Do not use domain names for node names (only IP addresses will be used).
-o: Display only specific data categories.
-p: Output data in line-by-line format.
-l: Display information in an unformatted form.
-a: Specify the address of the interface from which packets will be sent during tracing.
Let's try to gather a trace in the standard way.
For example, if you want to send 7 TCP packets during tracing to the host wiki.spacecore.pro and get information about nodes in IP address format, you can use the following command:
mtr --tcp -c 7 -n wiki.spacecore.pro