Persistent Static Routes on CentOS or RedHat RHEL

How to persistent Static Routes on CentOS or RedHat RHEL

This topic will help you to set persistent statics when we reboot or restart network, these routes will keep in our Server.

Example:  You want to route 192.168.4.0 and 192.168.5.0 to gateway 192.168.0.111

[root@Centos6 ~]# vi /etc/sysconfig/network-scripts/route-eth0
ADDRESS0=192.168.4.0
NETMASK0=255.255.255.0
GATEWAY0=192.168.0.111
ADDRESS1=192.168.5.0
NETMASK1=255.255.255.0
GATEWAY1=192.168.0.111

Checking your routing tables

[root@Centos6 ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.5.0 192.168.0.111 255.255.255.0 UG 0 0 0 eth0
192.168.4.0 192.168.0.111 255.255.255.0 UG 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
[root@Centos6 ~]#

That’s all. Thanks for using IThelpblog.com

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>