Déc 19 2009

Fichiers de démarrage des bridges sur Redhat/Ubuntu/Debian

Publié par à 7:04 sous Linux

Tous les systèmes nécessitent que le package bridge-utils soit installé avec yum ou apt-get.
 

Redhat / Fedora

Modifier le fichier de démarrage des interfaces réseau qui vont être ajoutées au bridge

[root@redhat ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:C0:4F:44:41:8A
ONBOOT=yes
BRIDGE=br0

 
Et créer le fichier de configuration du bridge

[root@redhat ~]$ cat /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
BROADCAST=192.168.0.255
IPADDR=192.168.0.100
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes
USERCTL=no
IPV6INIT=no
PEERDNS=no
ONBOOT=yes


Ubuntu

root@ubuntu:~$ cat /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback

auto br0
iface br0 inet static
        address 192.168.0.100
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        pre-up ifconfig eth1 down
        pre-up brctl addbr br0
        pre-up brctl addif br0 eth0
        pre-up brctl addif br0 eth1
        pre-up ifconfig eth0 0.0.0.0
        pre-up ifconfig eth1 0.0.0.0
        post-down ifconfig eth0 down
        post-down ifconfig eth1 down
        post-down ifconfig br0 down
        post-down brctl delif br0 eth0
        post-down brctl delif br0 eth1
        post-down brctl delbr br0


Debian

root@debian:~$ cat /etc/network/interfaces
iface eth0 inet manual

iface eth1 inet manual

 # Bridge setup
 iface br0 inet static
        bridge_ports eth0 eth1
        address 192.168.0.100
        broadcast 192.168.0.255
        netmask 255.255.255.0
        gateway 192.168.0.1

No responses yet

Comments RSS

Leave a Reply