[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Agrégation de liens Internet [RESOLU]



En creusant un peu, j'ai trouvé  [1] dont en particulier:

Linux provides flexibility among algorithms by allowing the administrator to assign each next hop a weight with the weight keyword. The number of times a next hop is selected is proportional to its weight in relation to all the other next hops. If all the next hops are assigned the same weight, the algorithm falls back to the so-called equal cost multipath algorithm.

Note, however, that the granularity used to distribute traffic among the next hops is measured not in packets, but in the number of routing cache entries. This is because once a next hop is selected, an entry is added to the cache. Because the routing subsystem always consults the cache before invoking any check on routing tables, subsequent packets belonging to the same traffic flow (aggregate of traffic) will be handled straight from the cache. As explained in Chapter 36, a flow is a collection of packets that match a set of criteria. These consist mainly of the source or destination addresses, the ingress or egress devices, and the IP TOS field. You will see in the section "Per-Flow, Per-Connection, and Per-Packet distribution" that when Multipath support for the cache is enabled, traffic can also be distributed on a per-connection basis instead of on a per-flow basis.

From purely a throughput point of view, this granularity may be suboptimal, because different flows may have very different bandwidth requirements, and therefore the kernel may be unfair even when all of the next hops are configured with the same weightand what is worse, the unfairness would not be deterministic. So Linux provides an option that allows you to use per-packet rather than per-flow granularity (see the section "Equalizer algorithm"). However, in most cases, given the high number of flows that usually traverse a router, the next hops are likely to get, on average, a load that is proportional to their weights.



Ramené à mon exemple, si j'ai bien compris ce que j'ai lu, le fait de solliciter monip.org fait que la machine qui route vers les différentes passerelles consulte son propre "cache de routage", et indique logiquement la même passerelle.
Pour tester, je devrai donc avoir plusieurs sites de même métal de monip.org, ce qui logiquement devrait conduire à de nouvelles entrées dans le cache de routage et donc probablement un choix différencié de passerelles.

En débranchant temporairement une passerelle, j'ai constaté avec plaisir le basculement vers l'autre passerelle.

En testant avec myip.dk, monip.org et d'autres, j'ai vu changer les adresses IP publiques.

Merci mille fois pour le coup de main !!

Il me reste encore à savoir comment conserver canoniquement  sur une Debian, la règle "ip route ..." dans un fichier de config.



[1] http://www.embeddedlinux.org.cn/linux_net/0596002556/understandlni-CHP-31-SECT-2.html


Le 18 avril 2014 17:07, Olivier <oza.4h07@gmail.com> a écrit :



Le 14 avril 2014 10:46, daniel huhardeaux <no-spam@tootai.net> a écrit :
Le 14/04/2014 10:30, Olivier a écrit :

Bonjour,

Bonjour



J'ai un site sur lequel plusieurs (4 ou 6) liens Internet sont actuellement en place pour offrir de la connectivité à une centaine d'utilisateurs.

Plutôt que répartir "statiquement" les utilisateurs par modem-routeur (20 utilisateurs par routeur), j'envisage de mettre en place un mécanisme d'agrégation ou de load-balancing.

Avez-vous déjà étudié ou mis en place ce type de service ?
Quels moyens avez-vous utilisés ?
Quelles suggestions et recommandations ?

Avec mon moteur de recherche, j'ai trouvé que le mécanisme de Teaming, ajouté à linux 3.3 était une ré-écriture du mécanisme de bonding. Est-ce utilisable vers Internet quand l'ISP fournit de simples box sans mécanisme de routage sophistiqué (BGP, ...) ?

Tu peux faire du bonding ou du load balancing avec iptables

Ex: http://sygard.no/2012/06/load-balancing-multiple-isp-connections-using-iproute-and-iptables/

J'ai lu attentivement le lien.
Si j'ai bien compris, la clé de la répartition est la ligne:
ip route add default scope global \
nexthop via 10.10.0.1 dev eth0.10 weight 2 \
nexthop via 10.20.0.1 dev eth0.20 weight 2 \
nexthop via 192.168.1.1 dev eth0.30 weight 1

C'est intéressant.
Je viens d'essayer ça sur une machine: j'ai l'impression que toutes mes machines sortent avec
la même passerelle vers Internet (testé en lançant un navigateur sur monip.org).

J'ai simplement utilisé une commande :
ip route replace default scope global nexthop via 192.168.64.254 dev eth0 weight 1 nexthop via 192.168.64.253 dev eth0 weight 1

où mes deux passerelles ont respectivement les adresses 192.168.64.253 et 254.

Il m'est difficile de créer beaucoup de machines mais je peux en créer une ou deux de plus, si besoin.

Comment démontrer avec certitude que ça marche ou ça ne marche pas ?
Un conseil ?
 

--
Daniel

--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet "unsubscribe"
vers debian-user-french-REQUEST@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmaster@lists.debian.org
Archive: [🔎] 534BA051.10702@tootai.net" target="_blank">https://lists.debian.org/[🔎] 534BA051.10702@tootai.net




Reply to: