Балансировка каналов
Балансировка каналов
Доброго здравия уважаемые!
Сушествует такой вопрос, есть два езернетных конца из интернета (в частности ADSL и радиоезернет на 10мб/с), вопрос в том, что хочеться сделать на них роутер, в виде одного компа, который ещё к тому же будет баланчсировать нагрузку на каналы. Реально ли?!
Сушествует такой вопрос, есть два езернетных конца из интернета (в частности ADSL и радиоезернет на 10мб/с), вопрос в том, что хочеться сделать на них роутер, в виде одного компа, который ещё к тому же будет баланчсировать нагрузку на каналы. Реально ли?!
Насколько мне известно, это можно получить при использовании одного из подходов (в скобках указана соотв. опция ядра Linux):
1) EQL (CONFIG_EQUALIZER)
2) PPP Multilink (CONFIG_PPP_MULTILINK)
3) IP equal cost multipath (CONFIG_IP_ROUTE_MULTIPATH)
1)-2) требуют наличия соотв. поддержки со стороны провайдера, в то время как 3) толжно работать в любом случае.
Дополнительная информация:
http://mp.mansol.net.au/
http://www.kerneltraffic.org/kernel-tra ... 62.html#11
http://www.tldp.org/HOWTO/Adv-Routing-H ... tml#AEN284
http://www.ssi.bg/~ja/#routes (http://www.ssi.bg/~ja/nano.txt)
linux/Documentation/networking/load-balancing.txt (http://www.linuxhq.com/kernel/v2.2/5-ac ... ancing.txt)
1) EQL (CONFIG_EQUALIZER)
2) PPP Multilink (CONFIG_PPP_MULTILINK)
3) IP equal cost multipath (CONFIG_IP_ROUTE_MULTIPATH)
1)-2) требуют наличия соотв. поддержки со стороны провайдера, в то время как 3) толжно работать в любом случае.
Дополнительная информация:
http://mp.mansol.net.au/
http://www.kerneltraffic.org/kernel-tra ... 62.html#11
http://www.tldp.org/HOWTO/Adv-Routing-H ... tml#AEN284
http://www.ssi.bg/~ja/#routes (http://www.ssi.bg/~ja/nano.txt)
linux/Documentation/networking/load-balancing.txt (http://www.linuxhq.com/kernel/v2.2/5-ac ... ancing.txt)
>> How does equal cost multipath works (what algorithm is
>> used) when it load balances on default gateways? Is the routing
>> decision based by packet or by flow?
> This is how I understood it (and I would greatly appreciate any
> correction on this):
>
> . if you specify two routes with an equal metric value (using the
> "metric" or "preference" keyword), load balancing is done on a per
> connection basis;
No, it is done on a per route base (which is normally, but not always,
selected based on the IP of the destination). There is currently no
support to bind routes to individual streams. You can change it using
policy routing or fwmark routing though, but that is static.
>
> . if you specify the "equalize" keyword on two routes (which of course
> must have the usual triplet matching) then load balancing is done on a
> packet basis;
In this case the route is just recomputed for every packet. Without it
the route stays cached and bound to a specific nexthop (unless the nexthop
dies). Flow-balancing route means each new IP address that we
want to send packets to gets one of the two routes at random.
Use 'weight' to bias the randomness.
>
> . I tried to analyze the code (net/ipv4/fib_semantics.c) but I
> couldn't understand where the "weight" parameter came from, given also
> that the "weight" keyword in the ip user level command refers to
> multicast routes.
Weight it set by the nexthop parameter for ip route.
===========
> I am about to add a second gateway routing entry to a RH7.0 box,
> that appears to have a 2.2.16 kernel with equal cost multi path and
> advanced routing options compiled into it. The box does not have rip,
> gated, or any other route checking program running on it.
> The two links to the Internet go out through different Ethernet cards,
> hubs, then gateway devices. The gateway devices as far as I am concerned are
> dumb devices that don't know if they are working or not.
>
> How will the 2.2 kernel's routing tables and the round robin affect
> of equal cost multi path handle the possibility of either the gateway
> device, or some other upstream link failing?
It won't, it needs an OSPF or similar daemon that downs/ups the interfaces
as needed.
In theory it could use the ARP neighbour reachability information for this,
but that isn't implemented. A real routing protocol is more general purpose
anyway, it is not limited to a single hop.
> So, in a nut shell, since a) the isp's are not going to be peering with
> me and b) the gateway devices themselves aren't supported to give me
> even their status, I need to implement some route checking scripts to
> add or remove the bad default gateway if it happens to go down? Is my
> line of thinking correct, or am I missing some information about how
> osfp/rip enabled programs work, or is there another tool available to do
> this?
You don't need to change the routes, but up/down the interfaces as needed.
Interface up/down is currently the only routing fail-over event supported.
You could probably do that with a single user space daemon that regularly
checks links with a second route by ARP or pinging.
> It seems that packets are be directed to the first route with the lowest
> metric. In the case of >1 route with the same metric, traffic is always
> sent to the first route. If this is the case, what it the point of even
> having ECMP?
Load balancing, and fail-over with routing daemons that support it (which
is currently none as far as I know, a few people were writing their own
primitive daemons to just check for nexthop alive)
>
> Perhaps I must use gated/zebra or some other routing daemon?
Yes, but probably only without automatic load balancing (because at least
zebra does not seem to support Linux multipoint routes yet)
> CONFIG_IP_MULTIPLE_TABLES=y
> CONFIG_IP_ROUTE_MULTIPATH=y
>
> I don't have iproute/iptools on this box, the routing and ip assignments
> were done with ifconfig and route:
Multipath routing can only be configured using iproute's nexthop option, it's
different from having multiple routes.
-Andi
Да, можно. Со стороны Linux это называтеся Channel Bonding (CONFIG_BONDING, Bonding driver support). В Google есть куча ссылок и примеров на эту тему.Denis писал(а):а можно ли объединить два езернет канала в один? т.е. две сетевухи, воткнутые в сервер и в один хаб сделать как одну?
Согласно сказанному мною выше, тебя спасёт только IP equal cost multipath (CONFIG_IP_ROUTE_MULTIPATH).Теня писал(а):хочеться сделать на них роутер, в виде одного компа, который ещё к тому же будет баланчсировать нагрузку на каналы
2 mend0za: Ты как-то уж очень лаконично отвечаешь, и совсем не привносишь новой информации. Совсем не QoS народу надо.
2 Denis: А скромные мессаги "iproute2" в этом разделе форума можно безошибочно постить на каждую новую тему через один.
В последнем, ммм.... там не совсем то решение которое мне подходит. То биш Linux bonding. я о транкинге думал, но у меня не пойдут на покупку девайса такого.
К тому же апосля начала данной темы, когда она была ещё теоретической, сейчас всё жутко практически!
То есть мне надо ещё на эти каналы запихнуть dmz - эТО основное на чём сломал голову.
К тому же апосля начала данной темы, когда она была ещё теоретической, сейчас всё жутко практически!
То есть мне надо ещё на эти каналы запихнуть dmz - эТО основное на чём сломал голову.