如果您对本站内容有任何疑问和建议请及时联系我们。



站长邮箱:teresajarrellypv09@gmail.com
Categories: KVM虚拟化

kvm环境如何使用openvswitch,centos7使用yum安装openvswitch

一定是自带的yum源,阿里源不包含这个软件包

#安装

yum -y install openvswitch*

#启动

systemctl start openvswitch

#开机启动

systemctl enable openvswitch

root[@localhost]# ovs-vsctl add-br br0

root[@localhost]# ovs-vsctl add-port br0 em4

定义一个网络,该网络桥接到ovs网桥上

[root@cnc mnt]# cat test.xml

<network>

<name>test</name>

<forward mode="bridge"/>

<bridge name="br0"/>

<virtualport type="openvswitch"/>

</network>

上面是定义一个网络所需的xml文件,通过文件,我们可以定义该网络的名字、转发的方式、桥的名字以及接口的类型。

步骤如下:

1.创建ovs网桥

[root@cnc mnt]# ovs-vsctl add-br br0

[root@cnc mnt]# ovs-vsctl show

e0738e00-be28-4ac0-8f0b-856bbb9f072c

Bridge test-br

Port test-br

Interface test-br

type: internal

ovs_version: "2.0.0"

2.利用如上xml文件定义网络

[root@cnc mnt]# virsh net-define test.xml

Network test defined from test.xml

[root@cnc mnt]# virsh net-list --all

Name State Autostart Persistent

----------------------------------------------------------

test inactive no yes

[root@cnc mnt]# virsh net-start test

Network test started

[root@cnc mnt]# virsh net-list --all

Name State Autostart Persistent

----------------------------------------------------------

test active no yes

[root@cnc mnt]# virsh net-autostart test

Network test marked as autostarted

原文链接:kvm环境如何使用openvswitch,centos7使用yum安装openvswitch,转载请注明来源!

Tokyo

Share
Published by
Tokyo

Recent Posts

苹果id必须是邮箱吗?是的。是

苹果id必须是邮箱吗?邮箱的地…

5月 ago

苹果密码忘了怎么办?手把手教你AppleID密码找回

如果忘记了苹果ID密码,无法验…

5月 ago

NASA火星车官方账号被“歪了楼”:有人自荐

RT报道称,为了宣传这次发射任…

5月 ago

苹果手机电子邮件怎么填新买来的手机,你知道吗?

的时候,是需要填写自己的电子邮…

5月 ago

塞拉斯:我们必须教给球员东西,让他们成长!

他就应该多给格林、申京、加鲁巴…

5月 ago

求苹果ID账号密码急用,请不要随意下载付费软件

ID免费使用,包括免费韩国、美…

5月 ago