[CentOS] Centos 6 - Persistant static routes

Fri Mar 13 00:52:38 UTC 2015
Robert Moskowitz <rgm at htt-consult.com>


On 03/12/2015 08:46 PM, Scott Robbins wrote:
> On Thu, Mar 12, 2015 at 01:43:27PM -0400, Robert Moskowitz 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?
>>
> Are you using NetworkManager?  I think you have to specifically remove it
> although I am not quite sure when RH made it the default (nor am I sure if
> it would override routes, but it frequently seems to cause issues.)

No NetworkManager on these systems.

> Also, the article doesn't say add the lineifcfg-eth0. The article says add it
> to route-eth0.  Was that just a typo on your part?

Misread on my part.  My dyslexia at work (have to have something to blame!).