09 March 2013

升级了centos后,之前建的bridge设备起不来了,原网卡和bridge网卡在启动时分别报错:


原网卡eth0: Connection activation failed: Master connection not found or invalid

bridge网卡br0:Conncetion activation failed: Failed to determine connection's virtual interface name

自己折腾了一阵不成功,最后按照下面的文章设置ok。原来是NetworkManager的原因,升级后NetworkManager接管了网卡启动,将NetworkManager停掉,之前的配置就可以启动网卡了。

SETUP BRIDGE DEVICE ON CENTOS

Howto setup a bridge device on CentOS or Fedora.

If you need to bring your KVM VM’s into the same local area network like your host is in you need to configure a bridge device.

1. Install all needed packages:

yum install bridge-utils

yum install tunctl


2. Disable NetworkManager and enable network at boot time:

chkconfig NetworkManager off

chkconfig –levels 35 network on

/etc/init.d/NetworkManager stop

/etc/init.d/network restart


3. Create br0 configuration

vi /etc/sysconfig/network-scripts/ifcfg-br0


Change following configuration to your needs.

DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
DNS1=192.168.0.1
GATEWAY=192.168.0.1
IPADDR=192.168.0.100
NETMASK=255.255.255.0
ONBOOT=yes
SEARCH=”example.com”


4. Modify eth0 configuration:

vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
HWADDR=00:1e:90:f3:f0:02
ONBOOT=yes
TYPE=Ethernet
IPV6INIT=no
USERCTL=no
BRIDGE=br0


5. Restart network or reboot machine

/etc/init.d/network restart


or

reboot


Here are some additional information on the libvirt page. If you have performance problems with your bridge device you maybe need to disable the netfilter on the bridge interface.

原文在来这里:http://www.banym.de/linux/centos/setup-bridge-device-on-centos