Networking
traceroute & mtr CLI
traceroute and mtr commands for network route tracing.
30 commands
Windows
MacOS
Linux
#route-tracing
#diagnostics
Basic Traceroute
Trace route to destination
traceroute example.com
Trace without resolving hostnames
traceroute -n example.com
Set maximum number of hops
traceroute -m 20 example.com
Set timeout to 3 seconds per hop
traceroute -w 3 example.com
Send 1 probe per hop instead of 3
traceroute -q 1 example.com
MTR Usage
Interactive route trace with statistics
mtr example.com
MTR without DNS resolution
mtr -n example.com
Generate report mode output
mtr -r example.com
Report after 100 cycles
mtr -r -c 100 example.com
Wide report with full hostnames
mtr -w example.com
Show AS numbers for each hop
mtr -z example.com
Protocol Options
Use ICMP ECHO instead of UDP
traceroute -I example.com
Use TCP SYN for traceroute
traceroute -T example.com
TCP traceroute on port 443
traceroute -T -p 443 example.com
MTR using TCP
mtr --tcp example.com
MTR using UDP
mtr --udp example.com
MTR using TCP on port 80
mtr --tcp -P 80 example.com
Output Formatting
Output as CSV format
mtr -r -c 50 --csv example.com
Output as JSON format
mtr -r -c 50 --json example.com
Output as XML format
mtr -r -c 50 --xml example.com
Show AS number for each hop
traceroute -A example.com
Custom field order in output
mtr -o "LSRABW" example.com
Troubleshooting
Set source IP address
traceroute -s 192.168.1.100 example.com
Use specific network interface
traceroute -i eth0 example.com
Bind to specific source address
mtr -a 192.168.1.100 example.com
Set interval between probes to 0.5s
mtr -i 0.5 example.com
Extended report without DNS
mtr -r -c 200 -n example.com
Quick Commands
Generate MTR report after 100 cycles
mtr -r -c 100 example.com
TCP traceroute on port 443
traceroute -T -p 443 example.com
MTR report output in JSON format
mtr -r -c 50 --json example.com