Traceroute with nw
Build the nw path trace command for traceroute, ping, and MTU hints. Learn why a router sometimes shows a star, and when you need sudo.
Trace the path (path trace)
Runs ping, traceroute, and MTU hints for a destination.
How to read the result
- If a router gives no ICMP answer, it does not mean the router is broken. Many routers do not answer.
- To see the routers, run the command with sudo. Without sudo, the TCP method gives only the hop count.
Exit codes
0: the destination answered. 1: it did not. 2: wrong command, or the method is not allowed.
Install nw
If you have Go, this one command is enough. It puts the file in $(go env GOPATH)/bin, usually ~/go/bin.
Other ways to install are on the nwrk.ir install page: ready-made builds for Linux, macOS, and Windows, and install scripts.
The install scripts download a script and run it. Read the script before you run it.
nwrk.ir install page (opens in a new tab)This page only builds the command. You run nw yourself, on your own device.
How to Use It
- Type a domain or an IP address.
- Pick a method. ICMP lists the routers and needs sudo.
- Copy the command and run it.
Questions and Answers
Why do some hops show a star?
Many routers do not answer ICMP. No answer does not mean the router is broken.
Does it work on Windows?
No. path trace is not supported on Windows.
Good to Know
This page only builds the command. It runs no test. To run it, install nw on your own device. The commands come from the nwrk.ir docs for version 0.5.
Related Tools
- Diagnose Why a Website Won't Load with nwBuild the nw diagnose command. It tests DNS, TCP, TLS, and HTTP one by one and shows the first step that fails, so you know where the problem is.
- IP Subnet Calculator (CIDR)Work out the network, broadcast, mask, host range, and address count for IPv4 and IPv6, and see whether an address is private or reserved.
- nw Command BuilderBuild the exact nw command to test DNS, TCP, TLS, or HTTP, trace a path, or find why a connection fails. Learn how to read the result and the exit code.
Source code of this tool (opens in a new tab)Report a problem on GitHub (opens in a new tab)