Installing and Configuring OpenvSwitch on Ubuntu 12.04 (Precise Pangolin)

Installing and Configuring OpenvSwitch on Ubuntu 12.04 (Precise Pangolin)

Installing and Configuring OpenvSwitch on Ubuntu 12.04 (Precise Pangolin)
Updates
Installing and Configuring OpenvSwitch on Ubuntu 12.04 (Precise Pangolin)

Quick install how to for Installing and Configuring OpenvSwitch on Ubuntu 12.04 (Precise Pangolin) with the nightly OVS build. Before I start, I must point out the great progress the dev team has done in such a short time. All of the old gotchas in earlier releases on implementation are long gone. I am going to revisit the KVM integration in a few days as some of the inconsistencies for bringing up TAPs into hypervisors should be getting some consensus for provisioning.


The announcement of the inclusion of OpenvSwitch into the mainline Linux kernel, coupled with some KVM enhancements to provide VLAN tagging, LACP, QoS, sFlow etc, is making some of us excited ,and others very nervous.

For those familiar with the build you can just paste the following in your bash shell as root. To walk through the install skip the following snippet. The installation is extensively documented in the INSTALL file in the root of the tarball.

System Preperation

Install dependencies:

Download the OVS tarball Note: you can also pull from the git repository but that is bleeding edge and depending on kernel releases it may need some massaging.

Compiling Open vSwitch From Source

Open vSwitch Configuration

Run the following commands, note some dashes are two ‘- -‘ e.g. – -remote=db & – -private-key

Start ovsdb-server, this stores the config into a file that is persistent even after restarts.

If they are not there try loading again and check your path to the kernel module.

At this point you have a fucntioning vanilla OVS install. Output should look something like this.

Configure Linux Networking

I have one NIC (eth1) on the same LAN segment/network/vlan.
We are attaching eth1 to br1 and applying an IP to the bridge interface.
We are attaching an IP to br2. br2 is the island that we are building a tunnel for hosts to connect on.

If you have issues getting the bridge built you may need to kill the OVS processes and restart them depending on your step order.

Your Linux routing table should now look something like this:

You can put the following into a text file and give it execute permissions with “chmod +x filename” and then run it “./filename”. If your network settings are right it should flip the IP to the bridge and not cut you off. Keyword “should” so have a way to get to the box if you cut yourself off.

If you want your networking to be persistent over restart you can adjust /etc/network/interfaces similar to the following template.


Thanks for stopping by.

Guest
Akash Rajguru
1 year 1 month ago


Hi Brent,

i just want to ask you that , can we configure OVS(OpenvSwitch) or any openFlow switch act as a router. and if yes how ?
i am doing my final semester university project on SDN , where i have to create topology using some openVswitches and using SDN controller make OpenvSwitch act as a router .
can you please share some idea on how i can achieve this Senior.

can we configure OpenvSwitch as router ?

thanks

Guest
leena
1 year 1 month ago


I am facing issues while installing openvswitch any versions…even after complete cleanup and things

db:Open_vSwitch,manager_options”: Invalid Syntax

Tried several installations but it doesn’t worked. Did anyone face issues??

Guest
esperertulip
1 year 3 months ago


I have just tried to install the openvswitch on the ubuntu 12.04.My ubuntu version is 12.04.4,I have tried openvswitch 1.9.*,openvswitch1.10.0,when I make it,the make program report error:”
/opt/openvswitch-1.9.3/datapath/linux/actions.c:104:2:error:too few arguments to function ‘_vlan_hwaccel_put_tag’
include/linux/if_vlan.h:236:31:note:declared here
/opt/openvswitch-1.9.3/datapath/linux/actions.c:In function ‘push_vlan':
/opt/openvswitch-1.9.’3/datapath/linux/action.c:124:2:error:too few arguments to function ‘_vlan_hwaccel_put_tag’
include/linux/if_vlan.h:236:31:note:declared here
the error reported by installing openvswitch 1.10.0 is the same.

Guest
hakim
1 year 3 months ago


Hi Mr Brent,

When I am trying to run this command:

sudo insmod datapath/linux/openvswitch.ko

It’s saying the following error:
insmod: error inserting ‘datapath/linux/openvswitch.ko': -1 Unknown symbol in module

can u help me to fix it ?
thx

Guest
G8XSU
1 year 3 months ago


Which version of openVswitch are you trying to install ?
post your ovs version, kernel version
and output of “dmesg |tail ” when you are trying to do insmod.

Guest
hakim
1 year 3 months ago


Hi G8XSU, thx for ur attention.
I try to install OPenVSwitch-2.0.0 on VirtualBox (Ubuntu-12.04-Desktop-i386) .
I used 3.2.0-58-generic-pae

This is the output when i wrote ‘sudo dmesg |tail’
amha@amha-VirtualBox:~/openvswitch-2.0.0$ sudo dmesg |tail
[ 20.100152] fb0: VESA VGA frame buffer device
[ 21.269151] init: anacron main process (802) killed by TERM signal
[ 22.204054] init: plymouth-upstart-bridge main process (498) killed by TERM signal
[ 28.168183] eth0: no IPv6 routers present
[ 707.476130] openvswitch: Unknown symbol gre_del_protocol (err 0)
[ 707.476130] openvswitch: Unknown symbol gre_add_protocol (err 0)
[ 707.476130] openvswitch: Unknown symbol crc32c (err 0)
[ 1291.512179] openvswitch: Unknown symbol gre_del_protocol (err 0)
[ 1291.512179] openvswitch: Unknown symbol gre_add_protocol (err 0)
[ 1291.512179] openvswitch: Unknown symbol crc32c (err 0)

Guest
G8XSU
1 year 3 months ago


sudo modprobe gre
sudo modprobe crc32c
:)

Guest
hakim
1 year 3 months ago


still error (not work) :(

Guest
sai
1 year 7 months ago


Hi Brent,

Thank you for the post. This post helped me in setting up openvswitch on my linuxbox.
Now my switch node has 4 interfaces. 1 to controller and other 3 to hosts.

This is running on my controller
./pox.py openflow.of_01 –address=10.1.2.2 –port=6633 log.level –DEBUG misc.of_tutorial

On the switch:

ovs-vsctl add-br br1
ovs-vsctl add-port br1 inf002
#inf002 is the interface on Switch connecting to the controller node
# remove the IP of inf002 and put it on the newly created br1 interface pointing to controller
ifconfig inf002 0
ifconfig br1 10.1.2.1 netmask 255.255.255.0

ovs-vsctl set-controller br1 tcp:10.1.2.2:6633

This made the connection to the controller. The log said connected at the controller screen with the DPID.

Now I am unsure about the hosts facing configuration of the br interface on switch. Please help.

Admin
1 year 7 months ago


I ran into issues building from source on Ubuntu 13.04+ in the past week or so. The specific error is: ### “db:Open_vSwitch,manager_options : invalid syntax” ###

For now I pulled cloning from the how-to and opt for the tarball. If you want to pull from git use:
git clone git://git.openvswitch.org/openvswitch

Cheers,
-Brent

Guest
David
1 year 7 months ago


Hi,
when i try to do:

ovs-vsctl –no-wait init

It says:

2013-10-10T13:41:06Z|00002|reconnect|WARN|unix:/usr/local/var/run/openvswitch/db.sock: connection attempt failed (No such file or directory)
ovs-vsctl: unix:/usr/local/var/run/openvswitch/db.sock: database connection failed (No such file or directory)

So i have done:

ps -Af | grep ovsdb-server

to check the daemon ann it says:

root 28570 28553 0 15:20 ? 00:00:00 ovsdb-server
root 28663 28650 0 15:22 pts/3 00:00:00 grep –color=auto ovsdb-server

What i should do? Can you help me?
Thank you very much!

Admin
1 year 7 months ago


Hi David, give installing from tarball a shot and see if that improves the errors and let me know. If not ping me on IRC.
Cheers,
-Brent

Guest
Dave
1 year 7 months ago


Hi,
Excellent installation guide, thank you!
I cloned the latest openvswitch git repo, but I’m getting an error while trying to do:
‘sudo insmod datapath/linux/openvswitch.ko’

From /var/log/syslog:
‘Oct 8 10:48:38 DavGDev kernel: [ 4279.417176] openvswitch: Unknown symbol crc32c (err 0)’

I’m using Ubuntu12.04LTS:
‘Linux DavGDev 3.2.0-54-generic-pae #82-Ubuntu SMP Tue Sep 10 20:29:22 UTC 2013 i686 i686 i386 GNU/Linux’

I had the missing gre symbol and fixed it by doing:
‘sudo modprobe gre’
but I don’t know which module, if any, will fix crc32c symbol…

Any ideas?

Thanks,
Dave

Guest
Gursharan Singh
1 year 4 months ago


were you able to fix it ?