Master Traceroute: Step‑by‑Step Guide to Network Path Diagnosis
This comprehensive guide explains how to use the traceroute (or tracert) command on Linux, macOS, and Windows, covering installation, syntax, basic execution, output interpretation, advanced options, common use cases, troubleshooting tips, and related tools such as ping, mtr, and pathping.
What is Traceroute?
Traceroute is a network diagnostic tool that shows the route and latency of packets from your computer to a target host.
Step 1: Open Terminal or Command Prompt
Linux/macOS: open the terminal application.
Windows: open Command Prompt (cmd) or PowerShell.
Step 2: Syntax
Linux/macOS: traceroute [options] <target> Windows: tracert [options] <target> The <target> can be a domain name (e.g., example.com) or an IP address (e.g., 8.8.8.8).
Step 3: Run a Basic Traceroute
Linux/macOS: traceroute example.com Windows: tracert example.com This displays a list of intermediate hops and the round‑trip time for each hop.
Step 4: Analyze the Output
Each line typically contains:
Hop number : sequence of the hop.
Router IP or hostname : address of the hop.
RTT : three round‑trip time measurements.
Example output:
1 192.168.1.1 1.123 ms 0.567 ms 0.456 ms
2 10.0.0.1 10.456 ms 9.876 ms 8.123 ms
3 93.184.216.34 30.567 ms 29.876 ms 28.123 ms
4 example.com 50.345 ms 48.567 ms 49.234 msIf you see * * *, the packet was blocked or experienced high latency at that hop.
Step 5: Advanced Options
Linux/macOS Options
-m <max_hops>: set maximum number of hops (default 30). Example:
traceroute -m 20 example.com -q <queries>: set number of probes per hop (default 3). Example:
traceroute -q 5 example.com -I: use ICMP instead of UDP. Example:
traceroute -I example.com -T: use TCP instead of UDP. Example:
traceroute -T example.com -p <port>: set destination UDP port. Example:
traceroute -p 8080 example.comWindows Options
-h <max_hops>: set maximum hops. Example:
tracert -h 15 example.com -w <timeout>: set timeout in milliseconds. Example:
tracert -w 500 example.com -d: disable hostname resolution, show only IP addresses. Example:
tracert -d example.comStep 6: Common Use Cases
Diagnose network problems – locate where packets are delayed or lost.
Analyze performance – measure latency of each hop to identify bottlenecks.
Bypass firewalls – use -T (TCP) or -I (ICMP) to avoid UDP blocks.
Test specific ports (Linux/macOS) – traceroute -p 443 example.com.
Step 7: Troubleshooting
If you see * * *, the router may block traceroute packets or the hop has high latency. Try -I or -T to use a different protocol.
If the command is not found, install it (e.g., sudo apt install traceroute on Debian/Ubuntu or sudo yum install traceroute on Red Hat/CentOS).
Tips
Combine with ping to test stability of a specific hop: ping <IP>.
Use mtr on Linux for real‑time statistics (combines traceroute and ping).
On Windows, pathping provides traceroute plus packet‑loss analysis.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
