traceroute: Usage, Options & Common CI Errors
traceroute shows the sequence of routers a packet crosses to reach a host.
traceroute reveals where connectivity breaks along the path. In CI its output is noisy - firewalls that drop the probes show as * * * even when traffic actually flows - so read it as a diagnostic, not a pass/fail gate.
What it does
traceroute sends packets with increasing TTL so each router along the path replies, revealing the hops between you and a destination plus the latency to each. It is a path-diagnosis tool, not a reachability assertion.
Common usage
traceroute example.com
traceroute -n example.com # numeric, skip slow reverse DNS
traceroute -m 15 example.com # cap at 15 hops
traceroute -T -p 443 example.com # TCP probes to port 443
tracepath example.com # unprivileged alternativeOptions
| Flag | What it does |
|---|---|
| -n | Do not resolve hop names (faster) |
| -m <N> | Maximum number of hops (TTL) |
| -w <secs> | Wait time per probe |
| -T / -I / -U | Use TCP / ICMP / UDP probes |
| -p <port> | Destination port (with -T) |
Common errors in CI
"* * *" rows mean a hop did not reply - usually a firewall silently dropping probes, NOT necessarily a break (traffic may still pass). Use -n to avoid long stalls on reverse-DNS lookups. "traceroute: command not found" - install traceroute (or use tracepath, which needs no privilege). Raw-socket modes can fail with "Operation not permitted" in unprivileged containers; -T (TCP) or tracepath avoids that. Treat traceroute as a hint about where latency or loss appears, not a gate.