ping tells you whether a destination answers. traceroute shows the path there, one router at a time, which helps you see where things slow down or stop.
How it works
traceroute uses the Time To Live (TTL) field in the IP header. It first sends probes with a TTL of 1. The first router lowers it to zero, drops the probe and returns an ICMP "time exceeded" message, revealing its address. Then it sends probes with TTL 2, which reach the second router, and so on until the destination answers or the hop limit is reached.
Running it
It may not be installed by default. On Debian and Ubuntu the package is traceroute.
traceroute -n 203.0.113.50traceroute to 203.0.113.50 (203.0.113.50), 30 hops max, 60 byte packets
1 192.0.2.1 0.521 ms 0.488 ms 0.470 ms
2 198.51.100.1 8.102 ms 8.044 ms 7.998 ms
3 * * *
4 203.0.113.50 14.310 ms 14.201 ms 14.188 msEach line is one hop. By default there are three probes per hop, so you see three round-trip times. -n shows addresses without looking up names, which is often faster.
Stars are not always trouble
A * means no reply arrived for that probe in time. In the example, hop 3 is silent but hop 4 answers, so traffic is clearly passing through. Some routers are set not to send these messages, or limit how often they do.
Worry more when every hop after a certain point is silent and the destination never answers. Even then, a firewall dropping the probes is possible.
The same care applies to timing. If one middle hop is slow but later hops are fast, that router is probably just slow to answer probes, not slow to forward traffic.
Choosing the probe type
Linux traceroute sends UDP probes by default. If a firewall drops them, try another type. These usually need root:
sudo traceroute -I 203.0.113.50
sudo traceroute -T -p 443 203.0.113.50-I uses ICMP echo requests. -T uses TCP SYN packets, and -p 443 aims them at the HTTPS port. Windows calls its tool tracert and uses ICMP echo requests.
Related tools
tracepath does a similar job without root. mtr, if installed, repeats the trace continuously and shows loss per hop. Remember that the return path can differ from the outward path, and a trace only shows the outward one.
Useful options include -m to set the maximum number of hops and -q to set how many probes go to each hop.
Try it
Run traceroute -n example.com, then repeat it with tracepath -n example.com. Compare the number of hops and note any lines with stars.
Check your understanding
traceroute
All 5 sections ยท no timer
Unlimited retries
Questions from every section are combined into one assessment. Answer them all correctly to complete the article.
Your completion saves in this browser. Sign in to sync it to your account.