traceroute

Overview

The traceroute command prints the route packets trace to a network host. It shows the path and measuring transit delays of packets across an IP network.

Syntax

traceroute [options] host [packetlen]

Common Options

Option Description
-4 IPv4 only
-6 IPv6 only
-f first_ttl Start from hop
-m max_ttl Maximum hops
-n No DNS lookup
-p port Destination port
-q nqueries Number of probes
-w waittime Wait timeout
-I Use ICMP
-T Use TCP
-U Use UDP
-g gateway Route via gateway

Key Use Cases

  1. Route discovery
  2. Network debugging
  3. Latency analysis
  4. Path verification
  5. ISP monitoring

Examples with Explanations

Example 1: Basic Trace

traceroute google.com

Trace route to host

Example 2: No DNS

traceroute -n 8.8.8.8

Show IP addresses only

Example 3: TCP Mode

traceroute -T host

Use TCP packets

Common Usage Patterns

  1. Quick trace:

    traceroute host
  2. Maximum hops:

    traceroute -m 15 host
  3. Fast trace:

    traceroute -n -q 1 host

Output Interpretation

  1. Hop number
  2. Router address
  3. Response time
  4. Timeouts
  5. Error messages

Additional Resources

Best Practices

  1. Use timeouts
  2. Check permissions
  3. Verify results
  4. Document paths
  5. Monitor changes

Security Considerations

  1. ICMP blocking
  2. Firewall rules
  3. Route hiding
  4. Access control
  5. Information exposure

Troubleshooting

  1. No response
  2. Timeouts
  3. Route changes
  4. DNS issues
  5. Protocol blocks

Common Symbols

Symbol Meaning
* No response
!H Host unreachable
!N Network unreachable
!P Protocol unreachable
!X Communication blocked