Bonding
De Wiki de Nelly & Richard.
Sommaire |
NIC bonding : 802.3ad
modes
- Le module bonding pris en charge par le noyau linux se décline sous 7 modes :
mode number | mode | description | switch |
---|---|---|---|
0 | balance-rr | load balancing / failover | Link Aggregation |
1 | active-backup | failover | - |
2 | balance-xor | load balancing / failover ((source MAC) XOR (dest MAC)) | LACP : 802.3ad |
3 | broadcast | tout le traffic sur les 2 interfaces failover | - |
4 | 802.3ad | 802.3ad | LACP : 802.3ad |
5 | balance-tlb | load balancing sur le traffic entrant + répartition de la charge sur toutes les interfaces | - |
6 | balance-alb | balance-tlb mais load-balancing sur le traffic entrant et sortant | - |
link monitoring
Ce module possède 2 mode de surveillance du lien au choix mais obligatoire :
MII monitor operation : surveillance du lien physique
nécessite au moins l'option miimon
root@server:~# modprobe bonding miimon=100
ARP monitor operation : surveillance de la liaison ARP
nécessite au moins les options arp_interval, arp_ip_target
root@server:~# modprobe bonding arp_interval=60 arp_ip_target=192.168.0.100
debian
installation
root@server:~# apt-get install ifenslave ifenslave-2.6
configuration manuelle
- activation
root@server:~# modprobe bonding mode=balance-alb miimon=100 root@server:~# ifconfig bond0 192.168.1.1 root@server:~# ifenslave bond0 eth0 eth1
- désactivation
root@server:~# ifenslave -d bond0 eth0 eth1 root@server:~# rmmod bonding
configuration /etc/network/interfaces
debian peut intégrer dans le fichier /etc/network/interfaces les options à passer au module en y faisant précéder bond_.
exemple
# bonding balance-alb (eth0 + eth1) auto bond0 allow-hotplug bond0 iface bond0 inet static address 192.168.0.1 netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.0.2 # interfaces esclaves slaves eth0 eth1 # mode bond_mode balance-alb # MII monitor bond_miimon 100 bond_downdelay 200 bond_updelay 200
statut
fichier /proc/net/bonding/bond0
root@server:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.2.5 (March 21, 2008) Bonding Mode: adaptive load balancing 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 Link Failure Count: 7 Permanent HW addr: 00:00:00:00:00:00 Slave Interface: eth1 MII Status: up Link Failure Count: 7 Permanent HW addr: 00:00:00:00:00:01
ifenslave
root@server:~# ifenslave -a
SLM2008
On trouve via l'interface web du SLM2008 les options Static Link Aggregation, LACP settings et LACP status sous le menu Port .