Différences entre les versions de « Bonding & trunking »

De BlaxWiki
Aller à la navigationAller à la recherche
Ligne 5 : Ligne 5 :
=== Généralités ===
=== Généralités ===


Il ne faut pas avoir les options à la fois dans /etc/modprobe.conf et dans /etc/sysconfig/network-scripts/ifcfg-bond0|bond1 (ou autre fichier de configuration des interfaces réseaux)
Il est nécessaire de définir dans les options à la fois miimon ou arp_interval et arp_ip_target, sinon cela va générer un warning au boot et ne permet pas d'avoir un bonding totalement
efficace.
Il ne faut pas avoir les options à la fois dans /etc/modprobe.conf et dans /etc/sysconfig/network-scripts/ifcfg-bond0|bond1 (ou autre fichier de configuration des interfaces réseaux).
De préférence mettre les options dans la configuration de l'interface


* Dans /etc/modprobe.conf
* Dans /etc/modprobe.conf
Ligne 23 : Ligne 26 :


Le primary= permet d avoir le mode failback (quand la primary interface revient up, le serveur rebascule dessus)
Le primary= permet d avoir le mode failback (quand la primary interface revient up, le serveur rebascule dessus)
=== Bonding sous Centos ===
On doit configurer les interfaces ethX
<pre>
[root@veso3folx01 network-scripts]# cat ifcfg-bond0
DEVICE=bond0
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.80.30.1
NETMASK=255.255.255.128
NETWORK=10.80.30.0
BROADCAST=10.80.30.127
BONDING_OPTS="mode=1 miimon=100"
[root@veso3folx01 network-scripts]# cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
MTU=1500
[root@veso3folx01 network-scripts]# cat ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
MTU=1500
</pre>


=== Bonding sous Debian ===
=== Bonding sous Debian ===
Il faut installer le package ifenslave-2.6.
Il faut installer le package ifenslave-2.6. On ne configure pas du tout les interfaces ethX liées au bonding


* /etc/network/interfaces file
* /etc/network/interfaces
<pre>
<pre>
auto bond0
auto bond0
iface bond0 inet static
iface bond0 inet static
  address 10.31.1.5
        address 172.26.15.49
  netmask 255.255.255.0
        netmask 255.255.255.240
  network 10.31.1.0
        gateway 172.26.15.62
  gateway 10.31.1.254
        bond-slaves eth0 eth1
  slaves eth0 eth1
        bond-mode active-backup
  bond-mode active-backup
        bond-primary eth0
  bond-miimon 100
        bond-arp_ip_target 172.26.15.62
  bond-downdelay 200
        bond-arp_interval 1000
  bond-updelay 200
        bond-downdelay 200
        bond-updelay 200
</pre>
</pre>


Ligne 45 : Ligne 81 :
<pre>
<pre>
alias bond0 bonding
alias bond0 bonding
options bonding mode=1 arp_interval=2000 arp_ip_target=192.168.3.1
alias bond1 bonding
</pre>
options bond0 primary=eth0 mode=1 arp_interval=1000 arp_ip_target=172.26.15.62
 
options bond1 primary=eth2 mode=1 arp_interval=1000 arp_ip_target=172.26.15.30
<pre>
 
/etc/network/interfaces:
------------------------
 
# The primary network interface
#auto eth0
#iface eth0 inet static
#      address 212.43.195.133
#      netmask 255.255.255.0
#      network 212.43.195.0
#      broadcast 212.43.195.255
#      gateway 212.43.195.1
#      # dns-* options are implemented by the resolvconf package, if installed
#      dns-nameservers 212.43.194.2 212.43.194.3
#      dns-search co.fr.clara.net
 
auto bond0
iface bond0 inet static
      address 212.43.220.45
      netmask 255.255.255.0
      gateway 212.43.220.1
      pre-up ifconfig eth0 up
      pre-up ifconfig eth1 up
      up ifenslave bond0 eth0 eth1
      down ifenslave -d bond0 eth0 eth1
      post-down ifconfig eth0 down
      post-down ifconfig eth1 down
      dns-nameservers 212.43.194.2 212.43.194.3
      dns-search co.fr.clara.net
 
/etc/modules:
-------------
bonding mode=4 miimon=100
 
ifconfig -a:
------------
 
bond0    Lien encap:Ethernet  HWaddr 00:14:85:29:BE:22          inet adr:212.43.220.45  Bcast:212.43.220.255  Masque:255.255.255.0
        UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
        RX packets:540669 errors:0 dropped:0 overruns:0 frame:0
        TX packets:278688 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 lg file transmission:0          RX bytes:794712182 (757.8 MiB)  TX bytes:20612336 (19.6 MiB)
 
eth0      Lien encap:Ethernet  HWaddr 00:14:85:29:BE:22          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
        RX packets:258810 errors:0 dropped:0 overruns:0 frame:0
        TX packets:278630 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 lg file transmission:1000         RX bytes:376450410 (359.0 MiB)  TX bytes:20604912 (19.6 MiB)
        Interruption:16
eth1      Lien encap:Ethernet  HWaddr 00:14:85:29:BE:22          UP BROADCAST RUNNING NOARP SLAVE MULTICAST  MTU:1500  Metric:1
        RX packets:281859 errors:0 dropped:0 overruns:0 frame:0
        TX packets:58 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 lg file transmission:1000          RX bytes:418261772 (398.8 MiB)  TX bytes:7424 (7.2 KiB)
        Interruption:17
 
</pre>
</pre>


[[Catégorie:Linux]]
[[Catégorie:Linux]]

Version du 28 mars 2012 à 17:04


Le bonding ou teaming permet de faire du failover ou de l'agrégation d'interfaces.

Généralités

Il est nécessaire de définir dans les options à la fois miimon ou arp_interval et arp_ip_target, sinon cela va générer un warning au boot et ne permet pas d'avoir un bonding totalement efficace. Il ne faut pas avoir les options à la fois dans /etc/modprobe.conf et dans /etc/sysconfig/network-scripts/ifcfg-bond0|bond1 (ou autre fichier de configuration des interfaces réseaux). De préférence mettre les options dans la configuration de l'interface

  • Dans /etc/modprobe.conf
alias bond0 bonding
alias bond1 bonding
  • Dans /etc/sysconfig/network-scripts/ifcfg-bond0|1
ifcfg-bond0 :
BONDING_OPTS="primary=eth0 mode=1 miimon=100"

ifcfg-bond1 :
BONDING_OPTS="primary=eth2 mode=1 miimon=100"

Le primary= permet d avoir le mode failback (quand la primary interface revient up, le serveur rebascule dessus)

Bonding sous Centos

On doit configurer les interfaces ethX

[root@veso3folx01 network-scripts]# cat ifcfg-bond0
DEVICE=bond0
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.80.30.1
NETMASK=255.255.255.128
NETWORK=10.80.30.0
BROADCAST=10.80.30.127
BONDING_OPTS="mode=1 miimon=100"

[root@veso3folx01 network-scripts]# cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
MTU=1500

[root@veso3folx01 network-scripts]# cat ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
MTU=1500


Bonding sous Debian

Il faut installer le package ifenslave-2.6. On ne configure pas du tout les interfaces ethX liées au bonding

  • /etc/network/interfaces
auto bond0
iface bond0 inet static
        address 172.26.15.49
        netmask 255.255.255.240
        gateway 172.26.15.62
        bond-slaves eth0 eth1
        bond-mode active-backup
        bond-primary eth0
        bond-arp_ip_target 172.26.15.62
        bond-arp_interval 1000
        bond-downdelay 200
        bond-updelay 200
  • /etc/modprobe.d/aliases-bond.conf
alias bond0 bonding
alias bond1 bonding
options bond0 primary=eth0 mode=1 arp_interval=1000 arp_ip_target=172.26.15.62
options bond1 primary=eth2 mode=1 arp_interval=1000 arp_ip_target=172.26.15.30