最常用的linux bond + ovs 桥

最常用的linux bond + ovs 桥

配网络前安装 kvm openvswitch

sudo yum install -y yum-plugin-priorities

yum install -y libvirt-client libvirt-daemon qemu-kvm libvirt-daemon-driver-qemu libvirt-daemon-kvm virt-install bridge-utils rsync libguestfs-tools-c

sudo yum install -y openvswitch sudo systemctl enable openvswitch sudo systemctl start openvswitch





[root@host network-scripts]# cat ifcfg-em1

DEVICE=em1

ONBOOT=yes

TYPE=Ethernet

BOOTPROTO=none

MTU=1500

MASTER=bond1

SLAVE=yes



[root@host network-scripts]# cat ifcfg-em2

DEVICE=em2

ONBOOT=yes

TYPE=Ethernet

BOOTPROTO=none

MTU=1500

MASTER=bond1

SLAVE=yes







[root@host network-scripts]# cat ifcfg-em3

DEVICE=em3

ONBOOT=yes

HOTPLUG=no

NM_CONTROLLED=no

PEERDNS=no

DEVICETYPE=ovs

TYPE=OVSPort

OVS_BRIDGE=ovs-external

BOOTPROTO=none

[root@hostnetwork-scripts]# cat ifcfg-em4

TYPE=Ethernet

BOOTPROTO=dhcp

DEFROUTE=yes

PEERDNS=yes

PEERROUTES=yes

IPV4_FAILURE_FATAL=no

IPV6INIT=yes

IPV6_AUTOCONF=yes

IPV6_DEFROUTE=yes

IPV6_PEERDNS=yes

IPV6_PEERROUTES=yes

IPV6_FAILURE_FATAL=no

IPV6_ADDR_GEN_MODE=stable-privacy

NAME=em4

UUID=331728c8-9ae6-44a0-8d7f-5c7378a186b1

DEVICE=em4

ONBOOT=no



[root@host network-scripts]# cat ifcfg-bond1

DEVICE=bond1

ONBOOT=yes

TYPE=OVSPort

OVS_BRIDGE=ovs-pxe

DEVICETYPE=ovs

BOOTPROTO=none

BONDING_OPTS="miimon=100 mode=802.3ad"

MTU=1500

MASTER=yes

#IPADDR=10.0.66.19

#NETMASK=255.255.255.0

[root@seed network-scripts]# cat ifcfg-

ifcfg-bond1 ifcfg-em1 ifcfg-em2 ifcfg-em3 ifcfg-em4 ifcfg-lo ifcfg-ovs-external ifcfg-ovs-pxe

[root@host network-scripts]# cat ifcfg-ovs-external

DEVICE=ovs-external

ONBOOT=yes

HOTPLUG=no

NM_CONTROLLED=no

PEERDNS=no

DEVICETYPE=ovs

TYPE=OVSBridge

MTU=1500

BOOTPROTO=static

IPADDR=10.0.66.19

NETMASK=255.255.255.0

GATEWAY=10.0.66.1

[root@host network-scripts]# cat ifcfg-ovs-pxe

DEVICE=ovs-pxe

ONBOOT=yes

HOTPLUG=no

NM_CONTROLLED=no

PEERDNS=no

DEVICETYPE=ovs

TYPE=OVSBridge

MTU=1500

BOOTPROTO=static

IPADDR=10.0.60.19

NETMASK=255.255.255.0



[root@host ~]# cat ovs-external.xml

<network>

<name>ovs-external</name>

<forward mode='bridge'/>

<bridge name='ovs-external'/>

<virtualport type='openvswitch'/>

</network>

[root@host ~]# cat ovs-pxe.xml

<network>

<name>ovs-pxe</name>

<forward mode='bridge'/>

<bridge name='ovs-pxe'/>

<virtualport type='openvswitch'/>

</network>

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值