Config Server Firewall

How to Show Routing Table in Ubuntu Server

Ubuntu maintains a routing table, which contains route entries detailing how to get to various networks. When Forwarding IP packets toward their destinations, Ubuntu determines which interface to use to forward the packet to the destination based on the information in its routing table.

To show the routing table, use the ip route show command:

ip route show

The most important entry is the first line. It shows the default route (default gateway) which is used to send the packets if none of the other entries in the routing table matches with the destination IP address of the packet.

To show the routing table, use the ip route show command

Alternatively, you can also use the netstat -r command to show the routing table:

netstat -r

Again the first line is the default gateway.

ubuntu routing table