Introduction
traceroute
Command is a network diagnostic tool that tracks the path of data packets from the system to the target server. It helps identify network latency and routing issues.
Install
Debian/Ubuntu
sudo apt install traceroute -y
RHEL/CentOS
sudo yum install traceroute -y
Fedora
sudo dnf install traceroute -y
Example usage
Basic usage
Send with additionalTTL
(Survival Time) value packets to discover the path taken by the packet
traceroute
Example
traceroute 8.8.8.8
Sample output
traceroute to (142.250.190.78), 30 hops max, 60 byte packets 1 (192.168.1.1) 1.013 ms 0.986 ms 1.010 ms 2 192.168.0.1 (192.168.0.1) 2.105 ms 2.098 ms 2.100 ms 3 isp-gateway (203.0.113.1) 10.258 ms 10.302 ms 10.310 ms 4 core-router (203.0.113.2) 20.551 ms 20.564 ms 20.590 ms 5 (142.250.190.78) 30.759 ms 30.802 ms 30.820 ms
Field analysis
Hop Number
: The router sequence through which the packet passesHost
: The host name or IP address of the routerRound-Trip Times (ms)
: The response time of the router is three times
Common symbols
* * *
: No response (probably the packet was blocked or lost)!H
: The host cannot be accessed!N
: The Internet is unreachable!X
: Firewall block
Show only IP addresses
To avoid hostname resolution and only display IP
traceroute -n
Specify the maximum number of hops
By default,traceroute
Up to 30 jumps are allowed
traceroute -m 20
Change the number of detections per hop
By default,traceroute
3 packets are sent per hop
traceroute -q 1
Use ICMP instead of UDP
By default,traceroute
useUDP
packets, if certain networks blockUDP
, can be used insteadICMP
traceroute -I
Using TCP SYN packets
whenICMP
andUDP
Useful when blocked
traceroute -T
Set the packet size
Specify packet size (default: 60 bytes)
traceroute 100
traceroute vs. ping and mtr
Order | Function |
---|---|
ping |
Check if the host is accessible and measure the delay |
traceroute |
Shows the route of the packet to reach its destination |
mtr |
ping andtraceroute Real-time combination |
The above is the detailed content of Linux using traceroute for network diagnosis analysis. For more information about Linux traceroute network diagnosis, please follow my other related articles!