How to Configure Static Routes on CentOS 6.2

Share this Article :

Routing is the process of selecting paths in a network along which to send network traffic. It’s not necessary to configure Static Routes on Red Hat Enterprise Linux servers or CentOS servers since routing will be configured on routing devices such as routers, bridges, gateways, firewalls and switches. However, if static routes are required they can be configured for each interface. This can be useful when you have multiple network interfaces in different subnets such as eth0, eth1 and eth2. The following static route commands has been tested on Linux CentOS 6.2 server.

Also Read :   How to Start Blogging with Blogspot

Display routing table using the following command :

[[email protected] ~]# netstat -rn

This command will add the Static Routes on CentOS 6.2 server. For example network available via on device eth1 :

[[email protected] ~]# ip route add via dev eth1

Alternatively, you can use this command :

[[email protected] ~]# route add -net netmask gw dev eth1

Note : The drawback of using these two commands is it will forget the static routes when server rebooted.

Leave a Reply