# mtr

> Network diagnostic tool that combines traceroute and ping, showing running per-hop statistics along the path to a destination host.

Stars: 3.4k · Language: C · License: GPL-2.0 · Categories: Network

- Repository: https://github.com/traviscross/mtr
- Website: http://www.bitwizard.nl/mtr/
- Page: https://www.trmn.sh/tools/mtr

## Install

- apt (WSL on Windows): `sudo apt-get -y install mtr`
- Build from git: `./bootstrap.sh && ./configure && make`
- Build from tarball: `./configure && make`

## Overview

mtr is a network diagnostic tool that combines the functionality of traceroute and ping in a single program. Given a destination hostname or IP address, it investigates the network connection between the local host and that destination.

It sends probes with successively larger time-to-live values and uses the responses from intervening routers to discover and measure the path. While running, it prints continuously updated statistics for each hop. The README notes that routers may be configured to never send these ICMP responses or to rate-limit them, so apparent loss at an intermediate hop does not always mean forwarded traffic is being lost there.

Usage is `sudo ./mtr <host>` after building. The helper binary mtr-packet must be suid-root because it needs raw IP sockets. Builds from git use `./bootstrap.sh && ./configure && make`; release tarballs use `./configure && make`. A GTK front end is optional (`./configure --without-gtk`). Solaris requires GNU make, and macOS needs no special steps. On Windows, mtr runs under WSL, or it can be built under Cygwin. It is aimed at network administrators, SREs, and developers troubleshooting latency and packet loss along a route. It is licensed under GPL v2.

### Installation

```bash
# via apt (WSL on Windows)
sudo apt-get -y install mtr
```

```bash
# via Build from git
./bootstrap.sh && ./configure && make
```

```bash
# via Build from tarball
./configure && make
```

## Alternatives

- [weechat](https://www.trmn.sh/tools/weechat.md): Terminal-based chat client with modular plugin architecture and multi-protocol support, primarily for IRC (C, 3.4k stars)
- [irssi](https://www.trmn.sh/tools/irssi.md): Terminal-based IRC client with modular architecture and support for multiple chat protocols (C, 3.2k stars)
- [elinks](https://www.trmn.sh/tools/elinks.md): Text-based web browser with frame/table support, scripting, and extensive customization options (C, 647 stars)
- [ttyd](https://www.trmn.sh/tools/ttyd.md): Command-line tool that shares a terminal command over the web, served via libuv and rendered in the browser with WebGL2, with SSL and basic auth. (C, 12.7k stars)
- [Nmap](https://www.trmn.sh/tools/nmap.md): Network scanner for host discovery, port scanning, service and OS detection, with a scripting engine (NSE) for extra checks. (C, 14.0k stars)

---

Canonical: https://www.trmn.sh/tools/mtr
