0% found this document useful (0 votes)
38 views

Ovs

This document summarizes the steps to install Open vSwitch on a Linux server and configure the networking for KVM virtualization. It installs Open vSwitch, configures a bonded interface in active-backup or LACP mode, disables firewalld, defines an Open vSwitch network in libvirt with multiple VLAN-tagged portgroups, and starts the new network.

Uploaded by

Anton Klimov
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Ovs

This document summarizes the steps to install Open vSwitch on a Linux server and configure the networking for KVM virtualization. It installs Open vSwitch, configures a bonded interface in active-backup or LACP mode, disables firewalld, defines an Open vSwitch network in libvirt with multiple VLAN-tagged portgroups, and starts the new network.

Uploaded by

Anton Klimov
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

//Install Open vSwitch

[root@lab-kvm ~]# yum -y install https://rdoproject.org/repos/rdo-release.rpm

[root@lab-kvm ~]# yum -y install openvswitch

[root@lab-kvm ~]# systemctl start openvswitch.service


[root@lab-kvm ~]# systemctl enable openvswitch.service

[root@lab-kvm ~]# systemctl disable NetworkManager


[root@lab-kvm ~]# systemctl stop NetworkManager

[root@lab-kvm ~]# systemctl enable network.service


[root@lab-kvm ~]# systemctl start network.service

////////////////////////////LACP for production only!!!


[root@lab-kvm ~]# vi /etc/sysconfig/network-scripts/ifcfg-ovs-bond0
--------------------------------------------------------------------------
DEVICE="ovs-bond0"
ONBOOT="yes"
DEVICETYPE="ovs"
TYPE="OVSBond"
BOOTPROTO="none"
BOND_IFACES="eno1 eno2"
OVS_BRIDGE="ovs-bridge0"
OVS_OPTIONS="bond_mode=balance-tcp lacp=active vlan_mode=native-untagged tag=2272
trunks=2272,2280 other_config:lacp-time=fast other_config:bond-detect-mode=carrier"
NM_CONTROLLED="no"
HOTPLUG="no"
--------------------------------------------------------------------------

////////////////////////////Active-Backup for lab


[root@lab-kvm ~]# vi /etc/sysconfig/network-scripts/ifcfg-ovs-bond0
--------------------------------------------------------------------------
DEVICE="ovs-bond0"
ONBOOT="yes"
DEVICETYPE="ovs"
TYPE="OVSBond"
BOOTPROTO="none"
BOND_IFACES="eno1 eno2"
OVS_BRIDGE="ovs-bridge0"
OVS_OPTIONS="bond_mode=active-backup vlan_mode=native-untagged tag=2272
trunks=2272,2280 other_config:bond-detect-mode=carrier"
NM_CONTROLLED="no"
HOTPLUG="no"
--------------------------------------------------------------------------

//Disable firewalld
[root@lab-kvm ~]# systemctl stop firewalld
[root@lab-kvm ~]# systemctl disable firewalld

//Configure KVM network

[root@lab-kvm ~]# vi ovs-network.xml


<network>
<name>ovs-network</name>
<forward mode='bridge'/>
<bridge name='ovs-br0'/>
<virtualport type='openvswitch'/>
<portgroup name='ovs-admin'>
<vlan>
<tag id='1'/>
</vlan>
</portgroup>
<portgroup name='ovs-aux'>
<vlan>
<tag id='10'/>
</vlan>
</portgroup>
<portgroup name='ovs-out'>
<vlan>
<tag id='20'/>
</vlan>
</portgroup>
<portgroup name='ovs-access'>
<vlan>
<tag id='30'/>
</vlan>
</portgroup>
<portgroup name='ovs-internet'>
<vlan>
<tag id='100'/>
</vlan>
</portgroup>
<portgroup name='ovs-subscriber'>
<vlan>
<tag id='200'/>
</vlan>
</portgroup>
<portgroup name='ovs-divert_int'>
<vlan>
<tag id='300'/>
</vlan>
</portgroup>
<portgroup name='ovs-divert_ext'>
<vlan>
<tag id='400'/>
</vlan>
</portgroup>
</network>

[root@lab-kvm ~]# virsh net-define ovs-network.xml


[root@lab-kvm ~]# virsh net-start ovs-network
[root@lab-kvm ~]# virsh net-autostart ovs-network

[root@lab-kvm ~]# virsh net-list


Name State Autostart Persistent
----------------------------------------------------------
default active yes yes
ovs-network active yes yes
--network network=ovs-network,portgroup=ovs-admin,model=virtio \
--network network=ovs-network,portgroup=ovs-aux,model=virtio \
--network network=ovs-network,portgroup=ovs-access,model=virtio \
--network network=ovs-network,portgroup=ovs-out,model=virtio \

You might also like