informatique:systeme:matos:channel_bonding

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
informatique:systeme:matos:channel_bonding [2012/02/15 17:41] bn8informatique:systeme:matos:channel_bonding [2024/02/05 10:44] (Version actuelle) – [Changer d'interface active] bn8
Ligne 22: Ligne 22:
 <note important>Il peut être nécessaire de forcer le mode de //bonding// au moment du chargement du module kernel (rencontré avec un switch Cisco notamment et le mode 802.3ad). Dans ce cas, éditer le fichier ///etc/modprobe.d/bonding.conf// et ajouter : <code>options bonding mode=4 miimon=100</code></note> <note important>Il peut être nécessaire de forcer le mode de //bonding// au moment du chargement du module kernel (rencontré avec un switch Cisco notamment et le mode 802.3ad). Dans ce cas, éditer le fichier ///etc/modprobe.d/bonding.conf// et ajouter : <code>options bonding mode=4 miimon=100</code></note>
  
 +===== Utilisation avec des VLANs =====
 +
 +<code>
 +auto bond0
 +iface bond0 inet manual
 +    slaves eth0 eth1
 +    bond-mode 802.3ad
 +    bond-miimon 100
 +    bond-downdelay 200
 +    bond-updelay 200
 +
 +auto vlan1
 +iface vlan1 inet static
 +    vlan-raw-device bond0    
 +    address 192.168.0.1
 +    network 255.255.255.0
 +    gateway 192.168.0.254
 +    
 +auto vlan2
 +iface vlan2 inet static
 +    vlan-raw-device bond0    
 +    address 192.168.1.1
 +    network 255.255.255.0
 +</code>
 ===== Mode de bonding supporté par le kernel Linux ===== ===== Mode de bonding supporté par le kernel Linux =====
  
Ligne 34: Ligne 58:
  
  
 +====== Procédures ======
 +
 +===== État détaillé d'un bond =====
 +
 +<code bash>ip -d -s -s link ls dev bond0</code>
 +
 +===== Création manuelle d'un bond =====
 +
 +<code>
 +# create the bonding interface with active-backup mode
 +ip link add name bond0 type bond mode active-backup
 +
 +# add the under laying interfaces
 +# the interface, that has been added first, will be active
 +ip link set master bond0 dev eth1
 +ip link set master bond0 dev eth0
 +
 +# enable the bonding interface
 +ip link set up dev bond0
 +ip address add 192.168.100.1/24 dev bond0
 +
 +# check the results: detailed info and statistics of bond0
 +ip -s -s -d link ls dev bond0
 +
 +# check the state of ALL under laying interfaces
 +# with statistics and details 
 +ip -s -s -d link ls master bond0
 +
 +# check the kernel logs
 +journalctl -kn 20
 +</code>
 +
 +Source : https://serverfault.com/a/1064428
 +
 +===== Changer d'interface active =====
 +
 +  * Lister les interfaces :
 +    * <code bash>cat /sys/devices/virtual/net/bond0/bonding/slaves</code>
 +    * ou : <code bash>ip link show master bond0</code>
 +  * Voir l'interface active : <code bash>cat /sys/devices/virtual/net/bond0/bonding/primary</code>
 +  * Changer d'interface active : 
 +    * <code bash>echo eth1 > /sys/devices/virtual/net/bond0/bonding/primary</code>
 +    * ou : <code bash>ip link set dev bond0 type bond active_slave eth1</code>
  
 +===== Supprimer/ajouter une interface slave à un bond =====
  
 +  * Sortir ''eth0'' de son bond actuel : ''ip link set nomaster dev eth0''
 +  * Mettre ''eth0'' dans ''bond0'' : ''ip link set master bond0 dev eth0''
  
  • informatique/systeme/matos/channel_bonding.1329327711.txt.gz
  • Dernière modification : 2012/02/15 17:41
  • de bn8