* More gateways in the same subnet
@ 2005-03-27 0:14 Kevin de Kok
2005-03-27 17:16 ` George Alexandru Dragoi
0 siblings, 1 reply; 3+ messages in thread
From: Kevin de Kok @ 2005-03-27 0:14 UTC (permalink / raw)
To: netfilter
Hi,
I have a linux router in my lan with two nic's to two isp's and i also
have two nic's for the lan. I have on eth0 the ip from ISP1 on eth2 the
ip from ISP2 on eth1 i have 192.168.1.1 and on eth3 i have 192.168.1.2.
What i'am trying to is when i give 192.168.1.1 as gateway on a client in
my lan then the traffic go's over ISP1 and when i give as gateway
192.168.1.2 that the traffic go's over ISP2. How can i manage this?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: More gateways in the same subnet
2005-03-27 0:14 More gateways in the same subnet Kevin de Kok
@ 2005-03-27 17:16 ` George Alexandru Dragoi
2005-03-28 6:13 ` Grant Taylor
0 siblings, 1 reply; 3+ messages in thread
From: George Alexandru Dragoi @ 2005-03-27 17:16 UTC (permalink / raw)
To: Kevin de Kok; +Cc: netfilter
echo 100 isp1 >> /etc/iproute2/rt_tables
echo 101 isp2 >> /etc/iproute2/rt_tables
ip ro add 192.168.1.0/24 dev eth1 table isp1
ip ro add 192.168.1.0/24 dev eth3 table isp2
ip ro add <isp1_subnet_link> dev eth0 table isp1
ip ro add <isp2_subnet_link> dev eth2 table isp2
if ISP1 gave you the 1.2.3.4ip, then <isp1_subnet_link> will be
1.2.3.0/24 , or whatever the netmask may be. Now do:
ip ro add default via <isp1_gw> table isp1
ip ro add default via <isp2_gw> table isp2
also
ip ro add default via <whatever_isp_gw_you_want> if you happen not to
have a default gateway
and last;
ip rule add from 192.168.1.0/24 iif dev eth1 table isp1
ip rule add from 192.168.1.0/24 iif dev eth3 table isp2
Hopefully it will work :)
One problem will be if both ethernet cards will reply to some ap
query, so even a client choose 192.168.1.1 as a gateway, the traffic
may come on eth3.
On Sun, 27 Mar 2005 01:14:57 +0100, Kevin de Kok <kevin@oom-killer.org> wrote:
> Hi,
>
> I have a linux router in my lan with two nic's to two isp's and i also
> have two nic's for the lan. I have on eth0 the ip from ISP1 on eth2 the
> ip from ISP2 on eth1 i have 192.168.1.1 and on eth3 i have 192.168.1.2.
> What i'am trying to is when i give 192.168.1.1 as gateway on a client in
> my lan then the traffic go's over ISP1 and when i give as gateway
> 192.168.1.2 that the traffic go's over ISP2. How can i manage this?
>
>
--
Bla bla
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: More gateways in the same subnet
2005-03-27 17:16 ` George Alexandru Dragoi
@ 2005-03-28 6:13 ` Grant Taylor
0 siblings, 0 replies; 3+ messages in thread
From: Grant Taylor @ 2005-03-28 6:13 UTC (permalink / raw)
To: George Alexandru Dragoi; +Cc: netfilter, Kevin de Kok
I would be tempted to add ISP2's gateway as a 2nd default route with a higher metric to ISP1's table, and vice versa. Thus having some sort of redundancy if either of the connections goes down. I think the line would be something like:
ip ro add default via <isp2_gw> table isp1 metric 2
ip ro add default via <isp1_gw> table isp2 metric 2
I have not done much work with routing via the new ip route command so my syntax could be a bit off so double check me. If any one does see any errors please let me know.
Something else you might consider playing with would be Equal Cost Multi Path (ECMP) routing. I have had limited success with ECMP routing in the past. Rather I had success with it but it sort of failed under high load in an extremely unique situation where I was (attempting to) pseudo load balancing across 8 cable modems each of which having a globally routable IP in the same subnet. All testing that I did seemed to work just fine until the system was under load and then it seemed as if some rare packets would go out a different interface than they started out. Thus the TCP connection was broken as the packets were then coming from a different IP than they started at. However I think that ECMP is a VERY good idea and I'm planing on doing some more testing with it. I also have plans of documenting my situation to this mail list at a later point in time for it's opinion. In short g
ive ECMP a try for you self and see what sort of mileage you get. I was happy with it, bu
t I think I was breaking it in what I was doing, not that it broke it's self. To do ECMP routing you would have rules like the following:
ip ro add default via <isp1_gw> dev eth0 weight 1 nexthop via <isp2_gw> dev eth2 weight 1 table isp1
ip ro add default via <isp2_gw> dev eth2 weight 1 nexthop via <isp1_gw> dev eth0 weight 1 table isp2
Grant. . . .
George Alexandru Dragoi wrote:
> echo 100 isp1 >> /etc/iproute2/rt_tables
> echo 101 isp2 >> /etc/iproute2/rt_tables
>
> ip ro add 192.168.1.0/24 dev eth1 table isp1
> ip ro add 192.168.1.0/24 dev eth3 table isp2
> ip ro add <isp1_subnet_link> dev eth0 table isp1
> ip ro add <isp2_subnet_link> dev eth2 table isp2
>
> if ISP1 gave you the 1.2.3.4ip, then <isp1_subnet_link> will be
> 1.2.3.0/24 , or whatever the netmask may be. Now do:
>
> ip ro add default via <isp1_gw> table isp1
> ip ro add default via <isp2_gw> table isp2
>
> also
>
> ip ro add default via <whatever_isp_gw_you_want> if you happen not to
> have a default gateway
>
> and last;
>
> ip rule add from 192.168.1.0/24 iif dev eth1 table isp1
> ip rule add from 192.168.1.0/24 iif dev eth3 table isp2
>
> Hopefully it will work :)
> One problem will be if both ethernet cards will reply to some ap
> query, so even a client choose 192.168.1.1 as a gateway, the traffic
> may come on eth3.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-03-28 6:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-27 0:14 More gateways in the same subnet Kevin de Kok
2005-03-27 17:16 ` George Alexandru Dragoi
2005-03-28 6:13 ` Grant Taylor
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.