Junior — Middle
What commands or tools can be used to view routing tables in the Linux operating system?
sobes.tech AI
Answer from AI
In Linux, the most commonly used commands and tools for viewing routing tables are:
route— a classic command for displaying routes. For example,route -nshows the routing table with IP addresses without attempting to resolve names.ip route— a modern tool from the iproute2 package, which replacesroute. The commandip route showdisplays the current routes.netstat -r— shows the routing table, although in newer systems,netstatis considered deprecated.
Example usage:
ip route show
route -n
netstat -r
ip route is considered the preferred and more functional tool for working with routes in modern Linux distributions.