kurzer tip, wie man über mehrere interfaces traffic verteilt... 1.) Lege pro Uplink eine Routing Tabelle an: # echo 201 t_ppp0 >> /etc/iproute2/rt_tables # echo 202 t_ppp1 >> /etc/iproute2/rt_tables 2.) Baue entsprechende Routing Tables: z.B. # ip route add default via PPP-PEER dev ppp0 table t_ppp0 3.) Setze Routing Flowmarks via iptables: Hierbei stehen die variösen Möglichkeiten von iptables zur Verfügung * Empfehlenswert ist ein Rückgriff auf CONNMARK: # iptables -t mangle -N classify # iptables -t mangle -A PREROUTING -p tcp -j CONNMARK --restore-mark # iptables -t mangle -A PREROUTING -p tcp -m mark --mark 0 -j classify # iptables -t mangle -A PREROUTING -p tcp -j CONNMARK --save-mark Der Vorteil: man braucht die aufwändige Klassifikation nur für neue `flows` durchzuführen :) * Im Beispiel wirft man dann in den chain `classify` die regeln: z.B. flowmark 42 für peer2peer # iptables -t mangle -A classify -p tcp -m ipp2p --ipp2p -j MARK --set-mark 42 oder flowmark 23 für ssh # iptables -t mangle -A classify -p tcp --destination-port 22 -j MARK --set-mark 23 ... 4.) Werfe markierte Pakete in die designierte Tabelle z.B. # ip rule add fwmark 23 table t_ppp0 # ip rule add fwmark 42 table t_ppp1 Achtung: Unmarkierte Pakete landen in der default table! Somit sollte auch da eine sinnvolle default-route existieren! ==================================================== Erweiterungen: * In der globalen Routing table ganz simpel per flow balancen: # ip route add default scope global nexthop via PPP0-PEER dev ppp0 weight 1 nexthop via PPP1-PEER dev ppp1 weight 1 Hierbei wird pro Route im random-verfahren entweder die route via ppp0 oder ppp1 gewählt. D.h. man bekommt auch nur maximal die speed von EINEM link! * Das ganze nun noch mit einem "ausgefuchsten" Shaping koppeln: Hierzu muss man nun noch auf die jeweiligen Interfaces mit `tc` policer einrichten. Es empfiehlt sich pro Interface auch noch ein imqX interface anzulegen, um den incoming traffic zu handlen.