Network Monitoring  «Prev  Next»

Lesson 5Determining the status of the routing table
ObjectiveUse netstat command to read the routing table.

Determining Status of Routing table

The netstat command can read the routing table using the -r option. As always, the -n option means to use numeric IP addresses:
View the diagram below to view the routing table.

routing table
routing table

Rouing Table Output

The output obtained here is identical to that obtained from the route command. Each row shows a network address and the appropriate gateway to be used to reach that network. The address means the default gateway (in the first column) or the local network (in the Gateway column). For example, the first row of the above output says information destined for the network should be sent to the local network; the last row says the default route for other information is to be directed to machine
The other information obtained from netstat -nr varies from machine to machine; consult your manual for details.
Note: If netstat hangs when you try to view the routing table, it is probably because name service is broken. Use netstat -nr instead of netstat -r.