Skip to main content

traceroute and mtr Cheatsheet

By Dejan Panovski •Updated on • Download PDF

Quick reference for traceroute, tracepath, and mtr: UDP, ICMP, and TCP probes, hop limits, output codes, mtr reports, and Windows tracert equivalents

The traceroute command shows the path packets take to a host and the round-trip time to each hop. This cheatsheet covers probe methods, hop and timing options, output codes, tracepath, and mtr for continuous loss and latency reports.

Basic Syntax

Core traceroute command forms.

CommandDescription
traceroute hostTrace the route with UDP probes
traceroute -n hostShow IP addresses only, skip reverse DNS
traceroute -4 hostForce IPv4
traceroute -6 hostForce IPv6
traceroute host 1400Set the full packet length to 1400 bytes (default 60 for IPv4, 80 for IPv6)
traceroute --versionCheck whether traceroute is installed

Install

Package names for traceroute and mtr.

CommandDescription
sudo apt install tracerouteInstall on Ubuntu, Debian, and derivatives
sudo dnf install tracerouteInstall on Fedora, RHEL, and derivatives
sudo apt install mtr-tinyInstall mtr without the GTK interface
sudo dnf install mtrInstall mtr on Fedora, RHEL, and derivatives
tracepath hostOften preinstalled with iputils; no root needed

Probe Methods

Switch protocols when the default UDP probes are filtered.

CommandDescription
traceroute hostUDP to port 33434, one port higher for each probe
traceroute -I hostICMP echo, the same method as Windows tracert
sudo traceroute -T hostTCP SYN to port 80; requires root
sudo traceroute -T -p 443 hostTCP SYN to port 443
traceroute -U hostUDP to the fixed port 53
traceroute -U -p 123 hostUDP to the fixed port 123
traceroute -p 40000 hostStart the default UDP probes at port 40000

Hops and Timing

Control how far the trace goes and how long it waits.

CommandDescription
traceroute -m 15 hostStop after 15 hops (default 30)
traceroute -f 5 hostStart at hop 5 and skip the local hops
traceroute -q 1 hostSend one probe per hop (default 3)
traceroute -w 2 hostWait up to 2 seconds for a reply (default 5)
traceroute -N 1 hostSend probes one at a time (default 16 at once)
traceroute -z 0.5 hostPause 0.5 seconds between probes; values above 10 are milliseconds

Source and Path Details

Pick the outgoing interface and collect extra data per hop.

CommandDescription
traceroute -i eth0 hostSend probes through eth0
traceroute -s 192.168.1.10 hostUse 192.168.1.10 as the source address
traceroute --mtu hostDiscover the path MTU, shown as F=1500
traceroute -F hostSet the Do Not Fragment bit
traceroute -A hostShow the AS number for each hop
traceroute -e hostShow ICMP extensions such as MPLS labels

Reading the Output

What the symbols after each hop mean.

OutputMeaning
* * *No reply within the wait time; the hop may filter or rate-limit probes
* 12.3 ms *Some probes lost or rate-limited at that hop
Several IPs on one hopProbes took different equal-cost paths
!HHost unreachable
!NNetwork unreachable
!PProtocol unreachable
!XCommunication administratively prohibited, usually a firewall
!FFragmentation needed

tracepath

Trace without root and report the path MTU.

CommandDescription
tracepath hostTrace with UDP and discover the MTU at each hop
tracepath -n hostSkip reverse DNS
tracepath -b hostShow both hostnames and IP addresses
tracepath -m 15 hostStop after 15 hops (default 30)
tracepath -p 40000 hostSet the initial destination port
tracepath -6 hostForce IPv6

mtr Live View

Combine ping and traceroute in a continuously updating screen.

CommandDescription
mtr hostShow live loss and latency for every hop
mtr -n hostSkip reverse DNS
mtr -b hostShow both hostnames and IP addresses
mtr -T -P 443 hostUse TCP SYN to port 443 instead of ICMP
mtr -u hostUse UDP instead of ICMP
mtr -i 2 hostSend a probe every 2 seconds (default 1)
mtr -z hostShow the AS number for each hop

mtr Reports

Run a fixed number of cycles and print the results.

CommandDescription
mtr -r hostRun 10 cycles, print a report, and exit
mtr -r -c 100 hostRun 100 cycles for steadier loss figures
mtr -rw hostWide report with full hostnames
mtr -rwn -c 50 host > mtr.txtSave a report to send to your ISP
mtr -j hostPrint the report as JSON
mtr -C hostPrint the report as CSV

mtr Keys

Keys for the interactive mtr screen.

KeyAction
qQuit
pPause; press Space to resume
dSwitch the display mode
nToggle DNS resolution
rReset all counters
jToggle between latency and jitter columns
zToggle AS number lookups
? or hShow help

Windows tracert Equivalents

Linux commands for the common tracert options.

CommandDescription
traceroute -I hostICMP probes, like tracert host
traceroute -I -n hostICMP probes without reverse DNS, like tracert /d host
traceroute -I -m 15 hostICMP probes with a 15-hop limit, like tracert /h 15 host
traceroute -I -w 3 hostICMP probes with a 3-second timeout, like tracert /w 3000 host
traceroute -I -4 hostICMP probes over IPv4, like tracert /4 host
mtr -r hostPer-hop loss statistics, similar to pathping host

Troubleshooting

Quick checks for common traceroute and mtr issues.

IssueCheck
traceroute: command not foundInstall the traceroute package or use tracepath
You do not have enough privileges to use this traceroute method.-T needs root, and -I may need it too; rerun with sudo
Every hop shows * * *Probes or replies may be filtered, or the destination may be unreachable; try -I or sudo traceroute -T -p 443 host
Replies stop after one hopLater devices may filter probes; test the service port with -T -p
High latency on one middle hop onlyThe router deprioritizes replies; ignore it unless the delay reaches the destination
Loss in mtr on a middle hop onlyICMP rate limiting; real loss continues through to the last hop

Use these guides for the full network troubleshooting workflow.

GuideDescription
traceroute Command in LinuxFull guide with an output walkthrough
ping cheatsheetReachability and latency checks
ip cheatsheetInterfaces, addresses, and routes
tcpdump cheatsheetCapture the probes and replies on the wire
nmap cheatsheetCheck whether a port is open, closed, or filtered