我的最终目标是使用 Openvswitch 配置 RedHat 6.6 服务器,如下图所示:
接口配置文件包括:
ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
ifcfg-bond0
DEVICE=bond0
BONDING_OPS="mode=4 miimon=500"
DELAY=0
DEVICETYPE=ovs
TYPE=OVSBond
OVS_BRIDGE=virbr0
ONBOOT=yes
BOOTPROTO=none
NM_CONTROLLED=no
HOTPLUG=no
OVS_OPTIONS="bond_mode=balance-tcp lacp=active"
BOND_IFACES="eth0 eth1"
ifcg-virbr0
DEVICE=virbr0
DEVICETYPE=ovs
TYPE=OVSBridge
ONBOOT=yes
BOOTPROTO=none
NM_CONTROLLED=no
DELAY=0
HOTPLUG=no
我不知道如何将多个虚拟桥连接到一个绑定接口。当我定义绑定接口时,只能指定一个虚拟桥。我需要为每组虚拟机定义一个虚拟桥。
如果这不可能,那么该策略可以继续隔离来自每组虚拟机的流量吗?
谢谢!
答案1
一种解决方法是使用补丁端口连接多个虚拟网桥:
虚拟控制器
DEVICE=virbr0
DEVICETYPE=ovs
TYPE=OVSBridge
ONBOOT=yes
BOOTPROTO=none
NM_CONTROLLED=no
DELAY=0
HOTPLUG=no
虚拟主机
DEVICE=virbr1
DEVICETYPE=ovs
TYPE=OVSBridge
ONBOOT=yes
BOOTPROTO=none
NM_CONTROLLED=no
DELAY=0
HOTPLUG=no
ifcfg 补丁 1-0
DEVICE=patch1-0
ONBOOT=yes
DEVICETYPE=ovs
TYPE=OVSPatchPort
OVS_BRIDGE=virbr1
OVS_PATCH_PEER=patch0-1
补丁号 0-1
DEVICE=patch0-1
ONBOOT=yes
DEVICETYPE=ovs
TYPE=OVSPatchPort
OVS_BRIDGE=virbr0
OVS_PATCH_PEER=patch1-0
最大接驳端口为 5
ovs-vsctl show
Bridge "virbr0"
Port "virbr0"
Interface "virbr0"
type: internal
Port "patch0-1"
Interface "patch0-1"
type: patch
options: {peer="patch1-0"}
Bridge "virbr1"
Port "bond0"
Interface "eth0"
Interface "eth1"
Port "patch1-0"
Interface "patch1-0"
type: patch
options: {peer="patch0-1"}
Port "virbr1"
Interface "virbr1"
type: internal