linux poison RSS
linux poison Email

How to view Routing Table and Change your default Gateway

The netstat -nr command will provide the contents of the touting table. Networks with a gateway of are usually directly connected to the interface. No gateway is needed to reach your own directly connected interface, so a gateway address of seems appropriate. The route with a destination address of is your default gateway.

Example below:

# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface   U         0 0          0 eth0     U         0 0          0 eth0         UG        0 0          0 eth0

Change Your Default Gateway

you'll need to update your /etc/sysconfig/network file to reflect the change. This file is used to configure your default gateway each time Linux boots.



Post a Comment

Related Posts with Thumbnails