Temat: Bonding - 2 łącza dsl
Witam.
Mamy 2 łacza DSL (routery orange)
Serwer - debian na kompie
3 karty sieciowe.
Z uwagi że w lokalizacji często mamy przerwy w dostawie netu to konieczne było dla zapewnienia względnej ciągłości dostepu do sieci jakoś przełaczć się między tymi łaczami.
Jako amator zrealizowałem to (pewnie druciarstwo) za pomocą skryptu który pingował google i jak nie było odpowiedzi ponawiał test. Po 3 nieudanych próbach uznawał że brak netu i przechodził dalej.
Dalej podmieniał plik interfaces na ten z konfiguracją dla "2 netu" , wykonywał restart sieci.
Działało dosyć długo.
Serwer padł i postawiłem na nowo.
No i zamarzyło mi się bardziej eleganckie rozwiązanie. Obiło mi się o uszy słowo bonding i ifenslave.
Niestety poniosłem porażkę bo nie działa. Różne konfiguracje próbowałem i albo nie pokazywało żadnego ruchu na bon0 albo pokazywało (czyli działał) ale nie było netu.
Obecne ustawienie utknęły na takim etapie:
#eth0
# - pierwszy DSL
auto lo eth0 eth1 eth2
iface lo inet loopback
iface eth0 inet static
address 83.12.149.x
netmask 255.255.255.248
network 83.12.149.x
gateway 83.12.149.x
post-up iptables-restore < /etc/iptables.up.rules
#eth1
#- drugi DSL
iface eth1 inet static
address 80.55.249.x
netmask 255.255.255.248
network 80.55.249.x
gateway 80.55.249.x
#eth2
#-LAN
allow-hotplug eth2
iface eth2 inet static
address 192.168.2.1
netmask 255.255.255.0
broadcast 192.168.2.255
network 192.168.2.0
#-Bond
auto bond0
iface bond0 inet static
address 192.168.122.15
netmask 255.255.255.0
gateway 192.168.122.1
slaves eth0 eth1
bond_mode active-backup
bond_miimon 100
bond_downdelay 200
root@debian:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 200
Down Delay (ms): 200
Slave Interface: eth0
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:13:8f:de:df:ee
Slave queue ID: 0
Slave Interface: eth1
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:50:bf:80:14:50
Slave queue ID: 0ifconfig
root@debian:~# ifconfig
bond0 Link encap:Ethernet HWaddr 00:13:8f:de:df:ee
inet addr:192.168.122.15 Bcast:192.168.122.255 Mask:255.255.255.0
inet6 addr: fe80::213:8fff:fede:dfee/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:33021 errors:0 dropped:19319 overruns:0 frame:0
TX packets:2024 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3131831 (2.9 MiB) TX bytes:156953 (153.2 KiB)
eth0 Link encap:Ethernet HWaddr 00:13:8f:de:df:ee
inet addr:83.12.149.x Bcast:83.12.149.x Mask:255.255.255.248
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:16373 errors:0 dropped:16477 overruns:0 frame:0
TX packets:170 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1325165 (1.2 MiB) TX bytes:20191 (19.7 KiB)
eth1 Link encap:Ethernet HWaddr 00:13:8f:de:df:ee
inet addr:80.55.249.x Bcast:80.55.249.x Mask:255.255.255.248
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:16648 errors:0 dropped:0 overruns:0 frame:0
TX packets:1854 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1806666 (1.7 MiB) TX bytes:136762 (133.5 KiB)
eth2 Link encap:Ethernet HWaddr b0:48:7a:85:4c:57
inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::b248:7aff:fe85:4c57/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:14430 errors:0 dropped:873 overruns:0 frame:0
TX packets:454 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1130468 (1.0 MiB) TX bytes:64974 (63.4 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1360 errors:0 dropped:0 overruns:0 frame:0
TX packets:1360 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:136613 (133.4 KiB) TX bytes:136613 (133.4 KiB)Wynik route - długo myśli zanim pokaże
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.122.1 0.0.0.0 UG 0 0 0 bond0
80.55.249.x * 255.255.255.248 U 0 0 0 eth1
83.12.149.x * 255.255.255.248 U 0 0 0 eth0
192.168.2.0 * 255.255.255.0 U 0 0 0 eth2
192.168.122.0 * 255.255.255.0 U 0 0 0 bond0Ping google.pl - milczy
Ping 8.8.8.8
root@debian:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.122.15 icmp_seq=1 Destination Host Unreachable
From 192.168.122.15 icmp_seq=2 Destination Host Unreachable
From 192.168.122.15 icmp_seq=3 Destination Host Unreachable
^C
--- 8.8.8.8 ping statistics ---
6 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4999ms
pipe 4Może ktoś podpowiedzieć jak ugryźć temat aby mieć zapasowe łacze płynnie przełaczane najlepiej z powiadamianiem (logowaniem)