Methods of payment Abuse

Using the mtr utility on macOS: installation and network diagnostics

29.11.2024, 20:27

mtr (My Traceroute) is a powerful network utility that combines the functions of ping and traceroute to diagnose network problems. It allows you to identify delays, packet loss, and failures in the data transmission route between your device and the server.

MTR capabilities:

  1. Route diagnostics: analyzes the path of packet transmission to the destination server.

  2. Delay measurement: determines the response time of each node on the route.

  3. Packet loss detection: identifies nodes with data loss.

Installing mtr on macOS

Step 1. Installing Homebrew

Homebrew is a package manager that simplifies the installation of utilities on macOS. To install it, run the following command in Terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Enter the administrator password.

Confirm the installation by pressing Enter.

 

After completion, verify the installation:

brew -v

Step 2. Installing mtr

Install mtr via Homebrew:

brew install mtr

 

Then copy the utility to the system directory for correct operation:

sudo cp $(brew --prefix mtr)/sbin/mtr /usr/local/bin && sudo cp $(brew --prefix mtr)/sbin/mtr-packet /usr/local/bin

How to use mtr?

Start testing

Run the following command to test the connection:

sudo mtr <IP_or_url>

 

Example of mtr output:

Host — host name or IP address.

Loss % — percentage of lost packets.

Snt — sent packages.

Last/Avg/Best/Wrst — delay metrics (last, average, minimum, and maximum).

StDev — standard deviation of delay.

Useful parameters:

-r: report output without interactive updating.

-c N: number of packets to send (e.g., -c 10 for 10 packets).

-i X: interval between requests (default is 1 second).

-4 or -6: use of only IPv4 or IPv6.

-T: sending TCP packets (useful for service diagnostics).

-u: sending UDP packets (if ICMP is blocked).

Example usage scenario

You want to find out why the connection to the server is unstable. Perform the following:

sudo mtr example.com

Check Loss % and Avg to find nodes with losses or delays.

Use the -r flag to get a report that you can send to tech support:

sudo mtr -r -c 10 example.com

Important: The mtr results will help you find network failures and identify problematic nodes. If you encounter problems on the route to our servers, you can send the diagnostic results to technical support for prompt resolution.