Content Entry

CentOS 6.x KVM 桥接网卡设置

  2011-10-25   Software   KVM Bridge CentOS

前提,正确安装 KVM (Kernel-based Virtual Machine)

yum install kvm kvm-qemu-img libvirt bridge-utils

Step 1:
cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
HWADDR="78:2B:CB:3C:A4:BA"
NM_CONTROLLD="yes"
ONBOOT="yes"
IPADDR=192.168.48.111
NETMASK=255.255.255.0
GATEWAY=192.168.48.1

注释掉 BOOTPROTO

加入一行
vim /etc/sysconfig/network-scripts/ifcfg-eth0
BRIDGE="br0"

Step 2:
vim /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
ONBOOT=ye
BOOTPROTO=static
PREFIX=24
IPADDR=192.168.48.111
NETMASK=255.255.255.0
GATEWAY=192.168.48.1
STP=on
DELAY=0

/etc/init.d/network restart

OK