Use net-tools netstat to display the IPv4 routing table without name resolution.
Which command is appropriate?
netstat -rn uses -r for the routing table and -n for numeric output. ip route show is preferred on current systems.
Detailed explanation
netstat -lntIncorrect. -lnt lists listening TCP sockets.
netstat -iIncorrect. -i displays interface statistics.
netstat -rnCorrect. It displays the routing table numerically.
netstat -sIncorrect. -s displays protocol statistics.
Try it yourself
An example you can run in a temporary verification environment.
netstat -rn 2>/dev/null | sed -n '1,5p' || printf '%s
' 'netstat is not installed'Expected result
Kernel IP routing tableと数値の経路一覧、または未導入メッセージKey points
- -r selects routes
- -n is numeric
- Different from socket listings
Notes
- Environment: net-tools netstat / 読み取り専用
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Interface counters
Kernel-maintained counts of packets, errors, and drops at an interface.
Socket
A local or remote endpoint associated with a transport protocol and process.
Path tracing
A diagnostic method that observes hops and path limits toward a destination.