Easiest way to install OpenVswitch and Mininet on Ubuntu 12.04

I’ve been struggling trying to set up the OVS 2.0 with Mininet 2.2 on Ubuntu 12.04.

Apparently the installation script from Mininet is not fully working on Ubuntu 12.04.

What did I do to fix it?

The easiest way to install it is to use the Mininet installation script and then do a small fix.

I did this exactly to install:

sudo apt-get update
sudo apt-get install -y git
git clone git://github.com/mininet/mininet
cd mininet
git checkout -b 2.2.0 2.2.0
util/install.sh -nf
util/install.sh -V 2.3.0

After this you will some weird errors. It should look like this:

Setting up openvswitch-switch (2.3.0-1) ...
 * Inserting openvswitch module
 * /etc/openvswitch/conf.db does not exist
 * Creating empty database /etc/openvswitch/conf.db
 * Starting ovsdb-server
2015-01-02T00:57:50Z|00002|stream_unix|WARN|/usr/local/var/run/openvswitch/db.sock: connection failed (No such file or directory)
2015-01-02T00:57:50Z|00003|reconnect|WARN|unix:/usr/local/var/run/openvswitch/db.sock: connection attempt failed (No such file or directory)
2015-01-02T00:57:51Z|00004|stream_unix|WARN|/usr/local/var/run/openvswitch/db.sock: connection failed (No such file or directory)

You should interrupt the script now with ctrl+C. Next do this:

cd ~/openvswitch/openvswitch-2.3.0/
sudo -s
ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema
ovsdb-server -v --remote=punix:/usr/local/var/run/openvswitch/db.sock \
--remote=db:Open_vSwitch,Open_vSwitch,manager_options \
--private-key=db:Open_vSwitch,SSL,private_key \
--certificate=db:Open_vSwitch,SSL,certificate \
--pidfile --detach --log-file
ovs-vsctl --no-wait init
ovs-vswitchd --pidfile --detach
ovs-vsctl show

This partially solves the problem. Let’s go ahead and test it: sudo mn --test pingall.

If you reboot you are going to have the same error. What you can do is to run this everytime you reboot:

cd ~/openvswitch/openvswitch-2.3.0/
sudo -s
ovsdb-tool convert /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema
ovsdb-server -v --remote=punix:/usr/local/var/run/openvswitch/db.sock \
--remote=db:Open_vSwitch,Open_vSwitch,manager_options \
--private-key=db:Open_vSwitch,SSL,private_key \
--certificate=db:Open_vSwitch,SSL,certificate \
--pidfile --detach --log-file
ovs-vsctl --no-wait init
ovs-vswitchd --pidfile --detach
ovs-vsctl show

If you find a best solution or this does not work for you, please report me your issue. I will do my best to help you!

Regards,

Advertisements

I'm a Network Engineer with software development experiences. MSCS from Georgia Tech. CCNA certified. ONF-SDN certified.

Posted in Mininet, OpenVswitch, SDN, Ubuntu

Please leave any feedback

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

Network Heresy

Tales of the network reformation

How to Do Great Research

Grad school survival advice from Nick Feamster and Alex Gray

n40lab

A blog about cloud, virtualization, sdn and centos

%d bloggers like this: