Network and remote access

Command mtr

Diagnosing a route with packet loss

Linux · Bash examples · commands run on the selected server

When to use mtr

Use mtr to sample a network path across multiple probes. Interpret intermediate-hop loss cautiously: routers can rate-limit diagnostic responses while forwarding application traffic normally.

Syntax

mtr [PARAMETERS] NODE

Square brackets mark optional arguments; an ellipsis means repetition. Replace example file names, user names and server addresses with your own values.

Common options and arguments

-r
Print the report and finish.
-c N
Limit the number of cycles.
-n
Do not perform reverse DNS resolution.

Usage examples

Collect a short report

mtr -rn -c 10 example.com

A bounded numeric report is collected over ten probe cycles.

Trace the route with TCP packets

mtr -T -P 443 -rn -c 10 example.com

TCP probes target the HTTPS port, which can follow policy different from ICMP probes.

Open interactive diagnostics

mtr example.com

The interactive view refreshes until you stop it.

Notes and limitations

  • Some modes require additional permissions or capabilities.
  • Loss at an intermediate node does not prove loss of transit traffic: routers can limit diagnostic responses.

Common questions and troubleshooting

Does loss at one intermediate hop prove a fault there?

No. If later hops answer normally, the router may simply deprioritize its own probe replies. Correlate end-to-end behaviour and repeated measurements.

Why do probes need extra permissions?

Some probe types require raw-socket capabilities or a privileged helper. Follow the distribution's supported configuration rather than broadening permissions arbitrarily.

Further help

Options vary by version and distribution. Check the installed documentation with this command: man mtr.