Mon, April 16, 2018 · 1 min read

Openvswith with kvm bridge network.

Openvswith with kvm bridge network.

Openvswitch is a virtual switch production level software, that can be used in virtual switch in VM environments like kvm, virtualbox etc.

In case of vm’s network connection to outer world is established by NAT or Bridge (Layer2 device), this model is good for single server vm guests, openvswitch is suited for multiserver vm guests connection.

Installing openvswitch on fedora:

dnf install openvswitch -y
systemctl enable openvswitch.service
systemctl start openvswitch.service
systemctl status openvswitch.service

Add an ovs bridge and add a bridge to it:

ovs-vsctl add-br ovsbr0
ovs-vsctl show

Adding a virtual interface to ovs bridge:

ip link add name veth0 type veth peer name veth1

Associating virtual interface veth0 to bridge br0:

brctl addif br0 veth0
brctl show

Adding virtual interface veth1 to ovs bridge:

sudo ovs-vsctl add-port ovsbr0 veth1
sudo ovs-vsctl show

Edit the xml config file of kvm guest and add the appropriate interface line.