Skip to main content
HandyWeb

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 method

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.

go install github.com/radestsam/nwrk/cmd/nw@latest

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

  1. Type a domain or an IP address.
  2. Pick a method. ICMP lists the routers and needs sudo.
  3. 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.

Source code of this tool (opens in a new tab)Report a problem on GitHub (opens in a new tab)