traceroute

Linux · Network · reference only

What it does

Shows the path of hops (routers) that packets follow to a destination, with each one's response time.

Syntax

traceroute [opciones] destino

Options and parameters

  • -n

    Does not resolve names: shows only IP addresses, faster.

  • -m saltos

    Maximum number of hops; 30 by default.

  • -q N

    Number of probes per hop; 3 by default.

  • -w segundos

    Wait time for each response.

  • -I

    Uses ICMP packets instead of UDP (usually requires root).

  • -T

    Uses TCP SYN packets, useful if a firewall blocks UDP and ICMP.

  • -p puerto

    Destination port of the probes.

Usage examples

  • traceroute example.com

    Shows the hops to example.com.

  • traceroute -n 8.8.8.8

    Traces the route without resolving names.

  • traceroute -m 15 example.com

    Limits the trace to 15 hops.

  • sudo traceroute -T -p 443 example.com

    Traces the route using TCP to port 443.

Notes and common mistakes

  • An asterisk (*) on a hop means that router did not answer, which is common and not always a fault.
  • On Debian you must install it: sudo apt install traceroute. tracepath is an alternative.

Related commands