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

Sat Dec 30 05:19:14 UTC 2006
Indunil Jayasooriya <indunil75 at gmail.com>

HI Peter,

Interesting in deed. You say that  You can add a second route and weight it
as follows:

ip route add equalize scope global nexthop via dev eth0 weight 1 nexthop via dev eth0 weight 1

I want to know whether I can use the above command , when the below command
exists .

ip route add via

Then I want to know about your second answer which is "To achieve the goal
of primary path only, you can heavily weight one path over the other, some
traffic will still spill into the other, you
can remove the equalize parameter to disable this behaviour "

herein,  what is this "you can heavily weight one path over the other"

When weight 1 and weight 1 , Both paths are equal. If I use weight 1 and
weight 100 , what would be the primary path ? Is it weight 1 ?

Is it the lower number which becomes primary ?

Then , in my case, is the following coomad is right?

ip route add scope global nexthop via dev eth0 weight 1 nexthop via dev eth0 weight

I guess with the above command that traffc will flow via primary, when it
fails , traffic will flow via secondary.

That is what I need.

 Am I right ? Then can I acheive this goal ?


---------- Forwarded message ----------
From: Aleksandar Milivojevic <alex at milivojevic.org>
Date: Dec 30, 2006 3:37 AM
Subject: Re: [CentOS] Fwd: How to add a route to a network via 2 gateways.
To: centos at centos.org

Quoting Indunil Jayasooriya <indunil75 at gmail.com>:

> 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
> 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.

One possible solution is to enable one of the routing protocols on
your routers, instead of using static routing.  For example BGP or
OSPF.  The routers will than discover which paths to every of the
networks you have exist and will dynamically change routing rules
(instead of using static set of rules) as the network connections go
up and down.  In the way you requested in your question.  It might be
an overkill for simple network.  But if your network becomes more
complex in the future, you'll have infrastructure to handle it.
Another advantage of using standard routing protocol is that they tend
to be platform independent.  You want to replace that Cisco router
with Linux router or Linux router with Cisco router.  Guess what, you
can use BGP or OSPF on both Linux and Cisco based router and your
configuration is not specific to single type of router anymore.

CentOS mailing list
CentOS at centos.org

Thank you
Indunil Jayasooriya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos/attachments/20061230/afd24593/attachment-0005.html>