Sunday, July 20, 2014

Add and Change default gateway / route in Linux

Routing information is very important in network for the connectivity. This defines path to next network.Mostly we are using this for getting internet connection.

If there any network which we wants to route there should be a router. Mostly a gateway system will have capability to work as a router.Either it will contain proxy software or else it will forward the traffic to desired network.

In linux we can define the routing information with "route" command. To display current routing information following command can use.

             route -n 

For adding new route the following command will help.Here assumes is the network and is the gateway system.

            route add default gw
            ip route add default via

Here is the command for  changing default route.

        ip route change default via  

1 comment:

  1. Very good site for Linux and Unix programmers and system admins.


Which operating system you like most?