Overview
traceroute visually displays the network path from a source to a destination using ICMP or UDP packets. It helps identify network latency or path issues by showing the IP address and response time of each hop (router).
Key Features
- Identifies each hop (router) in the network path
- Measures the round-trip time (RTT) to each hop
- Pinpoints network bottlenecks or points of failure
- Supports various protocols like ICMP, UDP, and TCP
Key Options
Basic Operation and Protocols
Limits and Queries
Generated command:
Try combining the commands.
Description:
`traceroute` Executes the command.
Combine the above options to virtually execute commands with AI.
Usage Examples
Various usage examples of the traceroute command.
Basic Path Tracing
traceroute google.com
Traces the network path to google.com.
Using ICMP Probes
traceroute -I google.com
Traces the path using ICMP probes instead of UDP.
Tracing with IP Addresses Only
traceroute -n 8.8.8.8
Displays only IP addresses and skips hostname lookups for faster results.
Specifying Maximum Hops
traceroute -m 15 google.com
Limits the trace to a maximum of 15 hops.
Tracing to TCP Port 80
sudo traceroute -T -p 80 example.com
Uses TCP SYN packets to trace the path to port 80 of the destination. Useful for checking paths to web servers behind firewalls.
Installation
traceroute is included by default in most Linux distributions, but may need to be installed separately in some minimal environments.
Debian/Ubuntu
sudo apt update && sudo apt install traceroute
Installs traceroute using the apt package manager.
CentOS/RHEL/Fedora
sudo yum install traceroute
# or
sudo dnf install traceroute
Installs traceroute using the yum or dnf package manager.
Tips & Notes
Useful tips and points to note when using traceroute.
Firewalls and '*' Display
Some routers or firewalls may block ICMP or UDP traffic. In such cases, if there is no response from a hop, it may be displayed as '*'. You can try using other protocols with the `-I` (ICMP) or `-T` (TCP) options.
- '* * *' indicates no response from that hop.
- Packets may be blocked due to firewall configurations.
- Try different protocols (ICMP, TCP) to diagnose issues.
Permission Issues
On some systems, running traceroute may require root privileges (sudo) because it uses raw sockets.
- If you encounter permission errors, try running with `sudo`.
IPv6 Path Tracing
To trace the path on an IPv6 network, use the `traceroute6` command or the `traceroute -6` option.
- `traceroute6 google.com`
- `traceroute -6 google.com`