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
- Route discovery
- Network debugging
- Latency analysis
- Path verification
- 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
Quick trace:
traceroute host
Maximum hops:
traceroute -m 15 host
Fast trace:
traceroute -n -q 1 host
Output Interpretation
- Hop number
- Router address
- Response time
- Timeouts
- Error messages
Additional Resources
Best Practices
- Use timeouts
- Check permissions
- Verify results
- Document paths
- Monitor changes
Security Considerations
- ICMP blocking
- Firewall rules
- Route hiding
- Access control
- Information exposure
Troubleshooting
- No response
- Timeouts
- Route changes
- DNS issues
- Protocol blocks
Common Symbols
Symbol | Meaning |
---|---|
* |
No response |
!H |
Host unreachable |
!N |
Network unreachable |
!P |
Protocol unreachable |
!X |
Communication blocked |