[CentOS] Is there a way to save the routing table permanently?

Fri Aug 22 19:13:51 UTC 2008
Rob Townley <rob.townley at gmail.com>

On Fri, Aug 22, 2008 at 12:44 PM, Les Mikesell <lesmikesell at gmail.com>wrote:

> Florin Andrei wrote:
>> ABBAS KHAN wrote:
>>> I'm adding the default gateway to the route through "route add default gw
>>> <>" which is also shown in "route -n" but
>>> the problem is that as soon as I restart the network through
>>> /etc/init.d/network restart; the route sets to default one...!
>>> SO, my question is there any way to save the modified route permanently
>>> by hardcoding the changes?
>> It would be very nice if the init.d script would allow the sysadmin to do
>> something like "service network saveroutes". I always thought that would be
>> a neat feature.
> Routes only work when you can reach the next hop.  That is,  if you try to
> add a route through an interface that is not up, the command will fail and
> the route will not be added.  If you want a route to be added when an
> interface comes up, there is already a place to do that. However, as others
> have pointed out you shouldn't expect multiple concurrent default routes to
> do something useful - but if you have multiple interfaces you can configure
> them both to add default routes and bring only one up at a time.
> --
>  Les Mikesell
>   lesmikesell at gmail.com
;Are you suggesting the following?
;assume eth1 is a better ISP than eth0
ifdown eth0
ifup eth1
ISP on eth1 goes down
automagically detect down ISP on eth1, so
ifdown eth1
ifup eth0
automagically detect ISP back up on eth1, so
ifdown eth0 again
;That isn't gonna fly.

Looks like nate pointed out the right journal article and looks very
promising.  Will let you know how it goes.

"Source-based routing capabilities are common on high end networking gear,
but they rarely are seen or utilized in server environments. Linux has
excellent but poorly understood source-based routing support. The whole
universe of advanced Linux routing and traffic shaping is well described at

ip rules and ip route priority are key.

> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos/attachments/20080822/9f977c40/attachment-0004.html>