Come promesso ho recuperato la seconda sk di rete e ho fatto le prove,
ti posto i due script che ho utilizzato, molto semplici quanto grezzi, mi perdonerai
Nome file: enable-bonding.sh
--------------------------------------------------------------------------------------------------------
#!/bin/sh
#
modprobe bonding mode=0 arp_interval=100 arp_ip_target=192.168.0.10 primary=eth0
ifconfig bond0 hw ether 00:00:B4:BB:C3:3A
ifconfig bond0 192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255 up
ifenslave bond0 eth0
ifenslave bond0 eth1
--------------------------------------------------------------------------------------------------------
Nome file: disable-bonding.sh
--------------------------------------------------------------------------------------------------------
#!/bin/sh
#
ifenslave -d bond0 eth0
ifenslave -d bond0 eth1
ifconfig eth0 down
ifconfig eth1 down
ifconfig bond0 down
modprobe -r bonding
--------------------------------------------------------------------------------------------------------
Configurazione di prova:
PC1 con eth0 e eth1 in bonding sull' 192.168.0.1, Slack 10.1 e kernel 2.4.29 (default)
PC2 con windows 2000 (dal quale ti sto scrivendo) e una scheda di rete con ip 192.168.0.10
Le prove sono fatte con un cavo cross tra PC1 e PC2
(scollegando e ricollegandolo alternativamente da eth0 e eth1, non avendo un Hub

)
Spiegazione di enable-bonding.sh:
#modprobe bonding mode=0 arp_interval=100 arp_ip_target=192.168.0.10 primary=eth0
Ho attivato il bonding in modalita' backup usando arp_interval, in quanto il modulo mii non
mi vedeva la seconda sk di rete (che potrebbe essere quello che fa per te),
arp_ip_target l'ho fatto puntare sul secondo PC2 e la primary e' l'eth0.
#ifconfig bond0 hw ether 00:00:B4:BB:C3:3A
ho attivato il bonding assegnandohli il MAC Address della eth0, potrebbe essere anche
uno inventato: come fa Telecom quando attiva il load-balancing su due router.
Non ho certamente il Know-how Telecom, ma per me ad un ip deve corrispndere un
ben preciso e univoco Mac Address
#ifconfig bond0 192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255 up
Qui invece ho configurato l'ip della bond0, ovviamente puoi aggiungere anche il gateway
se ne hai bisogno, e' una normale configurazione di un'interfaccia di rete.
#ifenslave bond0 eth0
#ifenslave bond0 eth1
Ed infine aggrego la eth0 e la eth1 alla bond0
Fine.
Risultato: pingando PC2 da PC1 (e viceversa) e spostando il cavo cross ora su eth0, ora
su eth1 (quando ero abbastanza veloce) non perdevo nemmeno un ping

.
Alcuni dati che ti aiuteranno a verificare la tua configurazione:
Configurazione di rete:
--------------------------------------------------------------------------------------------------------
#ifconfig
bond0 Link encap:Ethernet HWaddr 00:00:B4:BB:C3:3A
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:39630 errors:0 dropped:0 overruns:0 frame:0
TX packets:42341 errors:18234 dropped:0 overruns:0 carrier:32650
collisions:0 txqueuelen:0
RX bytes:2469563 (2.3 Mb) TX bytes:3850491 (3.6 Mb)
eth0 Link encap:Ethernet HWaddr 00:00:B4:BB:C3:3A
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:28003 errors:0 dropped:0 overruns:0 frame:0
TX packets:29394 errors:5540 dropped:0 overruns:0 carrier:9620
collisions:0 txqueuelen:1000
RX bytes:1744871 (1.6 Mb) TX bytes:2216827 (2.1 Mb)
Interrupt:11 Base address:0x1060
eth1 Link encap:Ethernet HWaddr 00:00:B4:BB:C3:3A
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:11627 errors:0 dropped:0 overruns:0 frame:0
TX packets:12947 errors:12694 dropped:0 overruns:0 carrier:23030
collisions:0 txqueuelen:1000
RX bytes:724692 (707.7 Kb) TX bytes:1633664 (1.5 Mb)
Interrupt:11 Base address:0x1020
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:65 errors:0 dropped:0 overruns:0 frame:0
TX packets:65 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6000 (5.8 Kb) TX bytes:6000 (5.8 Kb)
--------------------------------------------------------------------------------------------------------
Cavo attaccato su eth0:
--------------------------------------------------------------------------------------------------------
#cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v2.6.0 (January 14, 2004)
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Link Failure Count: 1
Permanent HW addr: 00:00:b4:bb:c3:3a
Slave Interface: eth1
MII Status: down
Link Failure Count: 2
Permanent HW addr: 00:c0:df:f3:f0:9b
--------------------------------------------------------------------------------------------------------
Cavo attaccato su eth1:
--------------------------------------------------------------------------------------------------------
#cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v2.6.0 (January 14, 2004)
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: down
Link Failure Count: 2
Permanent HW addr: 00:00:b4:bb:c3:3a
Slave Interface: eth1
MII Status: up
Link Failure Count: 2
Permanent HW addr: 00:c0:df:f3:f0:9b
--------------------------------------------------------------------------------------------------------
Questo e' tutto, ricordati che quando fai partire
enable-bonding.sh le due interfacce di
rete non devono essere configurate, cioe' se fai un ifconfig ti deve apparire solo:
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:65 errors:0 dropped:0 overruns:0 frame:0
TX packets:65 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6000 (5.8 Kb) TX bytes:6000 (5.8 Kb)
Ho aggiunto anche lo script
disable-bonding.sh che ti porta la configurazione di rete
allo stato iniziale, praticamente ogni volta che lanci
enable-bonding.sh, prima lancia
disable-bonding.sh.
Scusa per la lungaggine, ma ho cercato di essere il piu' dettagliato possibile
(almeno spero).
Ciao
Diego