$linuxjunkies
>

traceroute(8)

Traceroute prints the route packets take to reach a network host, showing each hop (gateway) along the path.

UbuntuDebianFedoraArch

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

FlagWhat it does
-m MAX_TTLSet maximum TTL (hops) to probe; default is 30
-nDisplay IP addresses numerically instead of looking up hostnames
-p PORTSet base UDP port for probes; default is 33434
-q QUERIESNumber of probes sent per hop; default is 3
-w TIMEOUTWait time in seconds for a response; default is 5
-IUse ICMP ECHO (ping) instead of UDP packets
-TUse TCP SYN packets instead of UDP
-4Force IPv4 (default)
-6Force IPv6
-f FIRST_TTLSet starting TTL value; default is 1

Examples

Basic trace to google.com, showing each hop with hostnames and latency times

traceroute google.com

Trace to Google's DNS server without reverse hostname lookups (faster)

traceroute -n 8.8.8.8

Trace with maximum 15 hops instead of default 30

traceroute -m 15 example.com

Use ICMP ECHO (ping-style) instead of UDP packets

traceroute -I destination.org

Quick trace with 2-second timeout and only 1 probe per hop

traceroute -w 2 -q 1 10.0.0.1

Trace IPv6 route to a destination

traceroute -6 ipv6.google.com

Related commands