[CentOS] Centos 6 - Persistant static routes

Thu Mar 12 18:21:40 UTC 2015
Robert Moskowitz <rgm at htt-consult.com>


On 03/12/2015 01:50 PM, Earl A Ramirez wrote:
> On 12 March 2015 at 13:43, Robert Moskowitz <rgm at htt-consult.com> wrote:
>
>> I know how to use 'ip' to set up a static route, e.g.:
>>
>> ip route add 192.168.128.0/17 via 40.53.24.3 dev eth0
>>
>> But if you reboot or restart network, you loose this.  Thus you have to
>> make it persistant.  I found:
>>
>> http://www.cyberciti.biz/tips/configuring-static-routes-in-
>> debian-or-red-hat-linux-systems.html
>>
>> where it says to add to ifcfg-eth0:
>>
>> 192.168.128.0/17 via 40.53.24.3
>>
>> But this did not work after the interface was restarted.  So what is the
>> proper to set up persistant static routes?
>>
>>
>> _______________________________________________
>> CentOS mailing list
>> CentOS at centos.org
>> http://lists.centos.org/mailman/listinfo/centos
>>
> I have used this document [0] in the past and it worked for me, let me know
> if it works for you.
>
> [0]
> https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-networkscripts-static-routes-network-netmask-directives.html

Yes it did.  Brings back some really old memories of doing this way some 
10 years ago.  Back when I built a firewall on Centos4 with lots of 
ethernets and Shorewall and stuff.

thanks