O'Reilly logo

KVM Virtualization Cookbook by Konstantin Ivanov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

To create a new OVS bridge and attach the virtual interface of a KVM guest, follow these steps:

  1. Remove the existing Linux bridge, if any:
root@kvm:~# brctl showbridge name      bridge id             STP enabled      interfacesvirbr0           8000.fe5400559bd6     yes              vnet0root@kvm:~# ifconfig virbr0 downroot@kvm:~# brctl delbr virbr0root@kvm:~# brctl showbridge name bridge id STP enabled interfacesroot@kvm:~#
On some Linux distributions, it helps to unload the kernel module for the Linux bridge before using OVS. To do this, execute root@kvm:/usr/src# modprobe -r bridge.
  1. Install the OVS package on Ubuntu:
root@kvm:~# apt-get install openvswitch-switch...Setting up openvswitch-common (2.0.2-0ubuntu0.14.04.3) ...Setting up openvswitch-switch (2.0.2-0ubuntu0.14.04.3) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required