# mtr — Real-Time Network Path Diagnostics

> Practical guide to mtr – diagnose network paths and packet loss in real time, report mode for tickets, TCP/UDP probes for firewalled networks.

Source: https://www.jpkc.com/db/en/cheatsheets/networking/mtr/

<!-- PROSE:intro -->
mtr combines ping and traceroute into a single tool: instead of delivering one-off snapshots, it continuously refreshes statistics for every hop along the path to a destination – so you pinpoint packet loss and latency spikes exactly where they occur. Whether you are troubleshooting a flaky connection or backing up a support ticket with hard measurement data, mtr gives you a complete diagnostic picture within seconds.
<!-- PROSE:intro:end -->

## Basic Usage

`mtr HOST` — Start an interactive, continuously updating traceroute to a host.

```bash
mtr 8.8.8.8
```

`mtr HOSTNAME` — Trace to a hostname with live updating display.

```bash
mtr google.com
```

`mtr -n HOST` — Numeric output — skip DNS resolution for faster display.

```bash
mtr -n 8.8.8.8
```

`mtr -b HOST` — Show both hostnames and IP addresses.

```bash
mtr -b 8.8.8.8
```

`mtr -w HOST` — Wide report mode. Show full hostnames without truncation.

```bash
mtr -w 8.8.8.8
```

## Report Mode

`mtr -r HOST` — Report mode — send 10 probes and print a summary. Non-interactive.

```bash
mtr -r 8.8.8.8
```

`mtr -r -c COUNT HOST` — Report mode with a specific number of probes.

```bash
mtr -r -c 100 8.8.8.8
```

`mtr -r -w HOST` — Wide report with full hostnames.

```bash
mtr -r -w google.com
```

`mtr -r -n -c 50 HOST` — Numeric report with 50 cycles. Clean output for scripting.

```bash
mtr -r -n -c 50 8.8.8.8
```

`mtr -rw -c 100 HOST > mtr_report.txt` — Save a detailed report to a file.

```bash
mtr -rw -c 100 8.8.8.8 > mtr_report.txt
```

`mtr --json HOST` — Output results in JSON format.

```bash
mtr --json -c 10 8.8.8.8
```

`mtr --xml HOST` — Output results in XML format.

```bash
mtr --xml -c 10 8.8.8.8
```

`mtr --csv HOST` — Output results in CSV format.

```bash
mtr --csv -c 10 8.8.8.8
```

## Probe Options

`mtr -c COUNT HOST` — Set the number of pings per hop (cycles).

```bash
mtr -c 50 8.8.8.8
```

`mtr -i INTERVAL HOST` — Set the interval between probes in seconds (default: 1).

```bash
mtr -i 0.5 8.8.8.8
```

`mtr -s SIZE HOST` — Set the packet size in bytes.

```bash
mtr -s 1000 8.8.8.8
```

`mtr -m MAX_TTL HOST` — Set the maximum number of hops (default: 30).

```bash
mtr -m 20 8.8.8.8
```

`mtr -f FIRST_TTL HOST` — Start with a specific TTL value.

```bash
mtr -f 5 8.8.8.8
```

`mtr --timeout SECONDS HOST` — Set the timeout for each probe.

```bash
mtr --timeout 3 8.8.8.8
```

## Protocol Options

`mtr --udp HOST` — Use UDP probes instead of ICMP.

```bash
mtr --udp 8.8.8.8
```

`mtr --tcp HOST` — Use TCP SYN probes. Good for firewalled networks.

```bash
sudo mtr --tcp 8.8.8.8
```

`mtr --tcp -P PORT HOST` — Use TCP SYN probes on a specific port.

```bash
sudo mtr --tcp -P 443 8.8.8.8
```

`mtr --sctp HOST` — Use SCTP probes.

```bash
sudo mtr --sctp 8.8.8.8
```

`mtr -4 HOST` — Force IPv4.

```bash
mtr -4 google.com
```

`mtr -6 HOST` — Force IPv6.

```bash
mtr -6 google.com
```

## Interface & Source

`mtr -a SOURCE_IP HOST` — Bind to a specific source IP address.

```bash
mtr -a 10.0.0.5 8.8.8.8
```

`mtr -I INTERFACE HOST` — Use a specific network interface.

```bash
mtr -I eth0 8.8.8.8
```

## Interactive Keyboard Shortcuts

`d` — Switch display mode (default, jitter, or both).

`n` — Toggle DNS resolution on/off.

`r` — Reset all statistics.

`o` — Change the order of the output fields.

`j` — Toggle jitter display.

`p` — Pause/resume.

`q` — Quit mtr.

## Reading the Output

`Loss%` — Percentage of packets lost at this hop. At the destination hop, >0% indicates a problem; at intermediate hops, ICMP rate-limiting may be the cause.

`Snt` — Number of probes sent to this hop.

`Last` — Round-trip time of the last probe in ms.

`Avg` — Average round-trip time in ms.

`Best` — Minimum (best) round-trip time in ms.

`Wrst` — Maximum (worst) round-trip time in ms.

`StDev` — Standard deviation of RTT. High values indicate jitter/instability.

## Common Patterns

`mtr -rw -c 100 -n HOST` — Generate a detailed report: 100 cycles, wide output, no DNS.

```bash
mtr -rw -c 100 -n 8.8.8.8
```

`mtr --tcp -P 443 -rw HOST` — TCP report on HTTPS port — works through most firewalls.

```bash
sudo mtr --tcp -P 443 -rw google.com
```

`mtr -s 1400 -r -c 20 HOST` — Test with large packets to detect MTU issues.

```bash
mtr -s 1400 -r -c 20 8.8.8.8
```

`mtr --json -c 50 HOST | python3 -m json.tool` — Generate JSON report with pretty printing.

```bash
mtr --json -c 50 8.8.8.8 | python3 -m json.tool
```

<!-- PROSE:outro -->
## Conclusion

mtr is the first tool to reach for when a connection issue is not immediately obvious. Report mode (`-r`) produces reproducible measurements for tickets and post-mortems; interactive mode shows in real time exactly where packets stall. Anyone still running ping and traceroute separately tends to switch permanently after their first mtr session.

## Further Reading

- [mtr – official project site](https://www.bitwizard.nl/mtr/) – source code and background
- [mtr(8) – manual page](https://linux.die.net/man/8/mtr) – complete option reference
- [mtr – Wikipedia](https://en.wikipedia.org/wiki/MTR_(software)) – background and history
<!-- PROSE:outro:end -->

## Related Commands

- [traceroute](https://www.jpkc.com/db/en/cheatsheets/networking/traceroute/) – trace the network path to a host hop by hop
- [ping](https://www.jpkc.com/db/en/cheatsheets/networking/ping/) – measure reachability and latency to a host
- [dig](https://www.jpkc.com/db/en/cheatsheets/networking/dig/) – query DNS resolution and name server responses

