Sobes.tech
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 -n shows the routing table with IP addresses without attempting to resolve names.
  • ip route — a modern tool from the iproute2 package, which replaces route. The command ip route show displays the current routes.
  • netstat -r — shows the routing table, although in newer systems, netstat is 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.