informatique:linux:bonding
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| informatique:linux:bonding [2008/07/09 10:02] – benoit | informatique:linux:bonding [2011/07/22 06:33] (Version actuelle) – benoit | ||
|---|---|---|---|
| Ligne 121: | Ligne 121: | ||
| Sous Red-Hat/ | Sous Red-Hat/ | ||
| Dans / | Dans / | ||
| - | / | + | / |
| ONBOOT=yes | ONBOOT=yes | ||
| Ligne 223: | Ligne 223: | ||
| La redondance des cartes réseaux est souvent perçue comme inutile et couteuse malgré une installation simple. | La redondance des cartes réseaux est souvent perçue comme inutile et couteuse malgré une installation simple. | ||
| Avec ces 7 modes de fonctionnements, | Avec ces 7 modes de fonctionnements, | ||
| + | |||
| + | |||
| ===== 5. Script de configuration automatique sous Redhat ===== | ===== 5. Script de configuration automatique sous Redhat ===== | ||
| Ligne 228: | Ligne 230: | ||
| ##### modification utilisateur ########## | ##### modification utilisateur ########## | ||
| # Mettre ici le nom de l' | # Mettre ici le nom de l' | ||
| - | | + | |
| - | # indiquer ici les interfaces esclaves | + | |
| + | bond0if1=" | ||
| + | bond0ip=" | ||
| + | bond0mask=" | ||
| + | bond0speed=" | ||
| + | bond0mode=" | ||
| + | |||
| + | bond1name=" | ||
| + | bond1if0=" | ||
| + | bond1if1=" | ||
| + | bond1ip=" | ||
| + | bond1mask=" | ||
| + | bond1speed=" | ||
| + | bond1mode=" | ||
| + | | ||
| # | # | ||
| - | mode=" | + | |
| # | # | ||
| # | # | ||
| Ligne 238: | Ligne 254: | ||
| # | # | ||
| ######## fin modif utilisateur ######### | ######## fin modif utilisateur ######### | ||
| - | | + | |
| - | | + | |
| - | cat <<EOF >> /etc/sysconfig/ | + | #---- debut configuration de bond0 |
| - | | + | grep ${bond0name} |
| - | | + | |
| - | BOOTPROTO=static | + | then |
| - | IPADDR= | + | cat <<EOF >> /etc/modprobe.conf |
| - | NETMASK= | + | |
| - | GATEWAY= | + | |
| EOF | EOF | ||
| - | cp / | + | |
| - | cat <<EOF > / | + | |
| + | # Configuration des interfaces physiques | ||
| + | for interface in ${bond0if0} ${bond0if1} | ||
| + | do | ||
| + | | ||
| + | cat <<EOF > / | ||
| ONBOOT=yes | ONBOOT=yes | ||
| - | DEVICE=$nic1 | + | DEVICE=${interface} |
| - | MASTER=$bondname | + | MASTER=${bond0name} |
| SLAVE=yes | SLAVE=yes | ||
| - | ETHTOOL_OPTS=" | + | ETHTOOL_OPTS=" |
| - | POST_UP_SCRIPT=ifen$nic1 | + | POST_UP_SCRIPT=ifen${interface} |
| EOF | EOF | ||
| - | | + | |
| - | cat <<EOF > / | + | # Creation des scripts de mise en esclaces des interfaces physiques |
| + | cat << EOF > / | ||
| + | #!/bin/sh | ||
| + | ifenslave | ||
| + | EOF | ||
| + | chmod +x / | ||
| + | |||
| + | # Configuration de l' | ||
| + | cat <<EOF > / | ||
| ONBOOT=yes | ONBOOT=yes | ||
| - | DEVICE=$nic2 | + | DEVICE=${bond0name} |
| - | MASTER=$bondname | + | BOOTPROTO=static |
| + | IPADDR=${bond0ip} | ||
| + | NETMASK=${bond0mask} | ||
| + | EOF | ||
| + | done | ||
| + | #---- fin configuration de bond0 | ||
| + | |||
| + | if [ ${bond1name} ] | ||
| + | then | ||
| + | #---- debut configuration de bond1 | ||
| + | grep ${bond1name} / | ||
| + | if [ " | ||
| + | then | ||
| + | cat <<EOF >> / | ||
| + | alias ${bond1name} bonding | ||
| + | options ${bond1name} mode=${bond1mode} miimon=100 | ||
| + | EOF | ||
| + | fi | ||
| + | |||
| + | # Configuration des interfaces physiques | ||
| + | for interface in ${bond1if0} ${bond1if1} | ||
| + | do | ||
| + | cp / | ||
| + | cat <<EOF > / | ||
| + | ONBOOT=yes | ||
| + | DEVICE=${interface} | ||
| + | MASTER=${bond1name} | ||
| SLAVE=yes | SLAVE=yes | ||
| - | ETHTOOL_OPTS=" | + | ETHTOOL_OPTS=" |
| - | POST_UP_SCRIPT=ifen$nic2 | + | POST_UP_SCRIPT=ifen${interface} |
| EOF | EOF | ||
| - | cat << EOF > / | + | |
| + | # Creation des scripts de mise en esclaces des interfaces physiques | ||
| + | | ||
| #!/bin/sh | #!/bin/sh | ||
| - | ifenslave $bondname | + | ifenslave ${bond1name} |
| EOF | EOF | ||
| - | | + | |
| - | cat << EOF > / | + | |
| - | | + | # Configuration de l' |
| - | | + | |
| + | | ||
| + | | ||
| + | BOOTPROTO=static | ||
| + | IPADDR=${bond1ip} | ||
| + | NETMASK=${bond1mask} | ||
| EOF | EOF | ||
| - | chmod +x / | + | done |
| + | #---- fin configuration de bond1 | ||
| + | fi | ||
informatique/linux/bonding.1215597779.txt.gz · Dernière modification : (modification externe)
