2010年12月17日 星期五

RHEL6+KVM Guest OS bridge with Host nics

1.首先要把很難用的NetworkManager服務停掉,換回熟悉的network
# chkconfig NetworkManager off
# chkconfig network on
# service NetworkManager stop
# service network start
2.Host實體介面的ifcfg-*,擺脫NetworkManger的控制
ifcfg-eth*
   NM_CONTROLLED=no
3.我們用eth0示範bridge功能,在此bridge的device將取名為br0,先修改eth0的設定
BOOTPROTO=none 
BRIDGE=br0
#eth0本來的ip設給br0
4.新增ifcfg-br0設定如下
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
ONBOOT=yes
DELAY=0
IPADDR=192.168.1.x
5.防火牆設定值修改
# iptables -I FORWARD -m physdev --physdev-is-bridged -j ACCEPT
# service iptables save
# service iptables restart
6.重載libvirt設定
service libvirtd reload
7.最後可以看一下bridge的設定有沒有生效

# brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.000e0cb30550       no              eth0
8.再來修改guest os的網路設定,就會看到新建的bridge interface了
http://www.techotopia.com/index.php/Creating_an_RHEL_6_KVM_Networked_Bridge_Interface
9.官方文件有說 另一個內建的virbr0是拿來做NAT的,請大家不要亂搞它XD

Ref: Redhat Docs

1 則留言: