Building and Installing Open vSwitch (OVS) on ubuntu

Hey, there everybody,

This post is about how to install OVS 2.1, the newest version at the moment. The steps are the same as we used to configure the previous version, but I decided to share here how to do it, although you can find more details on the official Open vSwitch web page.

Installing dependencies:

$ sudo apt-get install python-simplejson automake autoconf gcc uml-utilities libtool build-essential git pkg-config

Downloading and buiding OVS 2.1

$ sudo apt-get install -y git automake autoconf gcc uml-utilities libtool build-essential git pkg-config linux-headers-`uname -r`
$ wget http://openvswitch.org/releases/openvswitch-2.1.2.tar.gz && tar zxvf openvswitch-2.1.2.tar.gz && rm openvswitch-2.1.2.tar.gz
$ cd openvswitch-2.1.2
$ ./boot.sh
$ ./configure --with-linux=/lib/modules/`uname -r`/build
$ make
$ sudo make modules_install
$ sudo make install
$ sudo mkdir -p /usr/local/etc/openvswitch
$ sudo ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema
$ sudo ovsdb-server -v --remote=punix:/usr/local/var/run/openvswitch/db.sock --remote=db:Open_vSwitch,Open_vSwitch,manager_options --pidfile --detach --log-file
$ ovs-vsctl --no-wait init
$ ovs-vswitchd --pidfile --detach
$ ovs-vsctl show

OBS.: If you’re trying to install on kernel newer than 3.11, the kernel module will not be built. However, you can still install OVS 2.1. For that, instead of doing “./configure –with-linux=/lib/modules/`uname -r`/build”, just do “./configure”.

That’s all,

Advertisements

3 thoughts on “Building and Installing Open vSwitch (OVS) on ubuntu

  1. Pingback: Upgrading OVS on Mininet | blog_do_airton += coisa_nova;
  2. Hi
    thanks for your guidance
    I when type this “sudo make modules_install” I got this error “make : ***no rule to make target ‘modules_install'”
    can you help me please?

    • Hi, maybe I can help you.
      The problem you’ve got is probably because you forgot to pass “–with-linux” argument to “configure” script. Try by typing “./configure –with-linux=/lib/modules/`uname -r`/build “… This will prepare the kernel modules to be compiled by “make” command.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s