[CentOS] Re: Fwd: How to add a route to a network via 2 gateways.

Fri Dec 29 21:34:05 UTC 2006
Scott Silva <ssilva at sgvwater.com>

Indunil Jayasooriya spake the following on 12/29/2006 3:11 AM:
> Hi ,
> I have a network to reach which is
> . It is a branch of the company. I have currently
> added a route to that network via one gateway (
>  in following way.
> ip route add  via
> Now, We got another gateway which is
> < Now I want to add a route to the same network 
> which is  via this gateway (
> ) as well.
> Then I will have 2 paths to the same network. One path should be primary
> and the other path  should be backup. everything should go via primary
> path.
> if the primary  path goes down, the backup path should be active.
> That is the purpose of doing this.
> Pls let me know whether it is possible or not?
> if possible, How can I achieve this goal.
When you create a route there is a metric number that does this. But you will
need a routing daemon running to use it. Another possibility would be to have
a script run every 5 minutes in cron that pings the first gateway, and if the
ping fails, change the route. It would also need logic to fix the first route
when the primary gateway starts answering pings again.


MailScanner is like deodorant...
You hope everybody uses it, and
you notice quickly if they don't!!!!