traceroute(8)
Traceroute prints the route packets take to reach a network host, showing each hop (gateway) along the path.
Synopsis
traceroute [OPTION]... HOST [PACKETLEN]Description
Traceroute traces the path from your computer to a destination host by sending packets with increasing TTL (Time To Live) values and recording which routers respond. Each hop's round-trip time is measured, helping diagnose network connectivity issues and identify where packets are slowing down or getting blocked.
By default, traceroute uses UDP packets on port 33434 and above. Root privileges may be required depending on the implementation and options used.
Common options
| Flag | What it does |
|---|---|
-m MAX_TTL | Set maximum TTL (hops) to probe; default is 30 |
-n | Display IP addresses numerically instead of looking up hostnames |
-p PORT | Set base UDP port for probes; default is 33434 |
-q QUERIES | Number of probes sent per hop; default is 3 |
-w TIMEOUT | Wait time in seconds for a response; default is 5 |
-I | Use ICMP ECHO (ping) instead of UDP packets |
-T | Use TCP SYN packets instead of UDP |
-4 | Force IPv4 (default) |
-6 | Force IPv6 |
-f FIRST_TTL | Set starting TTL value; default is 1 |
Examples
Basic trace to google.com, showing each hop with hostnames and latency times
traceroute google.comTrace to Google's DNS server without reverse hostname lookups (faster)
traceroute -n 8.8.8.8Trace with maximum 15 hops instead of default 30
traceroute -m 15 example.comUse ICMP ECHO (ping-style) instead of UDP packets
traceroute -I destination.orgQuick trace with 2-second timeout and only 1 probe per hop
traceroute -w 2 -q 1 10.0.0.1Trace IPv6 route to a destination
traceroute -6 ipv6.google.com