Config reseau bridge

De BlaxWiki
Révision datée du 5 novembre 2012 à 17:57 par Admin (discussion | contributions) (Page créée avec « Cette page recense tous les types de configuration avec des interfaces en mode bridge que l'on peut avoir. Cela est principalement mis en place sur des hyperviseurs avec d... »)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)
Aller à la navigationAller à la recherche

Cette page recense tous les types de configuration avec des interfaces en mode bridge que l'on peut avoir. Cela est principalement mis en place sur des hyperviseurs avec des vm derrières.

Mode bridge + bonding

Voici la configuration sous kvm / xen d'interface en bonding avec une interface en mode bridge (ifcfg-br0) qui n'a pas d'ip. Le nom du device br0 peut avoir n'importe quel nom L'arborescence des interfaces est ainsi : ethX --> bondX --> bridgeX

[root@]# cat ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes

[root@]# cat ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes

[root@]# cat ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
BRIDGE=br0
BONDING_OPTS="mode=4 miimon=100"

[root@]# cat ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
ONBOOT=yes
BOOTPRORO=none

Mode bridge classique

Voici la configuration sous kvm / xen d'une interface en mode bridge (ici il y a un vlan mais c'est pareil sans vlan). L'arborescence des interfaces est ainsi : ethX --> bridgeX

L'interface principale (eth0 ou eth1) doit toujours etre montée, sinon les alias ou vlan (eth0:1 ou eth0.122) liés à cette interface ne monteront pas.
[root@]# cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
HWADDR="D4:BE:D9:AA:95:8E"
ONBOOT=yes
ETHTOOL_OPTS="speed 100 duplex full autoneg off"

[root@]# cat ifcfg-eth0.154
BRIDGE=prive154
DEVICE=eth0.154
TYPE=Ethernet
VLAN=yes
ONBOOT=yes

[root@]# cat ifcfg-prive154
DEVICE=prive154
TYPE=Bridge
BOOTPROTO=static
ONBOOT=yes
VLAN=yes
IPADDR=172.25.7.130
NETMASK=255.255.255.224

Mode bridge avec ip

Voici la configuration sous kvm / xen d'interface en bonding avec une interface qui a une ip. Le nom du device admin peut avoir n'importe quel nom. L'arborescence des interfaces est ainsi : ethX --> admin

[root@]# cat ifcfg-eth0
DEVICE="eth0"
ONBOOT="yes"
BOOTPROTO="static"
BRIDGE=admin

[root@]# cat ifcfg-admin
DEVICE=admin
BOOTPRORO=static
TYPE=Bridge
ONBOOT="yes"
STP=off
IPADDR="172.27.125.6"
NETMASK="255.255.255.0"
NETWORK="172.27.125.0"
BROADCAST="172.27.125.255"

On peut très bien avoir un alias ip sur l'interface admin, l'interface eth0 est lié à admin mais aussi à admin:0 sans que l'on ait besoin de le préciser

[root@]# cat ifcfg-admin:0
DEVICE=admin:0
NM_CONTROLLED="yes"
BOOTPRORO=static
TYPE=Bridge
STP=off
IPADDR="172.27.125.109"
NETMASK="255.255.255.0"
NETWORK="172.27.125.0"
BROADCAST="172.27.125.255"