Fri, April 6, 2018 ยท 1 min read

Openvswitch on fedora with kvm.

Openvswitch on fedora with kvm.

Openvswitch is the software used on both physical and virtual environments to implement L2 switching.

Installation of openvswitch:

dnf install -y virt-install libvirt openvswitch

Enabling the openvswitch service and daemon:

systemctl enable openvswitch
systemctl start openvswitch
systemctl status openvswitch

Adding a network interface to ovs bridge ovsbr0:

ovs-vsctl add-br ovsbr0
ovs-vsctl add-port ovsbr0 enp9s0
ifconfig ovsbr0 192.168.15.15/20
dhclient ovsbr0
ovs-vsctl show

Modify the enp9s0 network configuration file:

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
NAME=enp9s0
DEVICE=enp9s0
DEVICETYPE="ovs"
TYPE="OVSPort"
OVS_BRIDGE="ovsbr0"

Creating a bridge configuration file to keep changes persistent across reboots:

DEVICE="ovsbr0"
DEVICETYPE="ovs"
TYPE="OVSBridge"
ONBOOT="yes"
MACADDR="00:1c:23:01:fb:dc"
OVS_EXTRA="set bridge $DEVICE other-config:hwaddr=$MACADDR"
OVSBOOTPROTO="dhcp"
OVSDHCPINTERFACES="enp9s0"

After kvm guest is booted up we can see that ip is the same range as the bridge br0.