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.
Incorrect. -lnt lists listening TCP sockets.
netstat -iIncorrect. -i displays interface statistics.
Incorrect. -i displays interface statistics.
netstat -rnCorrect. It displays the routing table numerically.
Correct. It displays the routing table numerically.
netstat -sIncorrect. -s displays protocol statistics.
Incorrect. -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
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.