Bridging and Bonding with CentOS 6.5

eth0和eth1要做bond,然后kvm虚拟机通过bridge与外界通信。
那么就要在bond上做bridge。配置文件例如以下,实測这样配置,能够从kvm虚拟机ping通外界拓扑。

ifcfg-eth0:

DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

ifcfg-eth1:

DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

ifcfg-bond0:

DEVICE=bond0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
BONDING_OPTS="miimon=100 mode=4 xmit_hash_policy=layer3+4"
BRIDGE=br0

ifcfg-br0:

DEVICE=br0
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Bridge"
BOOTPROTO="static"
IPADDR="10.65.248.201"
NETMASK="255.255.0.0"
GATEWAY="10.65.251.247"
MTU="1500"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="yes"
IPV6INIT="no"
NAME="System br0"
DELAY=0

kvm虚拟机的xml的interface部分例如以下:

 <interface type='bridge'>
      <mac address='00:16:3e:1e:b2:20'/>
      <source bridge='br0'/>
       </interface>

虚拟机的ip地址是10.65.248.242,ping宿主机
这里写图片描写叙述
ping宿主机所在拓扑主机:
这里写图片描写叙述

搞定~

原文地址:https://www.cnblogs.com/clnchanpin/p/7394490.html