Version 2 (modified by 13 years ago) ( diff ) | ,
---|
Installing Open vSwitch on a node
This page describes how to install Open vSwitch on a sandbox node. Open vSwitch is a software OpenFlow switch implementation designed to run on a PC. More information about the software can be found here. The docs provided online are a bit outdated at this point; The installation steps followed here is INSTALL.Linux, included with the Open vSwitch tarball (but attached to this page for your convenience).
1.Prerequisites
The node used here is a NetFPGA cube, the standard node for !SandBox9. The node was imaged with ubuntu.ndz, based on Ubuntu 10.10 (Maverick). A few steps are needed before we begin fetching the install file or any of its dependencies. On the node:
- Run 'apt-get update'. If this fails, repeat after replacing all instances of 'apt:9999' with 'us.archive.ubuntu.com' in /etc/apt/sources.list .
- Install packages for Open Vswitch:
apt-get install pkg-config autoconf automake linux-libc-dev libtool
- Fetch and untar Open vSwitch (don't do anything to it yet):
cd ~/ wget http://openvswitch.org/releases/openvswitch-1.1.1.tar.gz tar -xf openvswitch-1.1.1.tar.gz
- Upgrade the kernel to 2.6.35-30, as 2.6.35-25's kernel header packages are broken (otherwise '2.6.35-30-generic' in the following commands can be replaced with `uname -r`).
apt-get install linux-headers-2.6.35-30-generic linux-image-2.6.35-30-generic reboot apt-get install linux-source-2.6.35
When linux-image is installed, grub is updated so that the newest kernel is loaded automatically upon next reboot. Re-installing linux-source after reboot should install the proper version for the new kernel.
2. Installation
On Debian (and its variants), Open vSwitch must be built as a kernel module. If everything is sound, installing Open vSwitch should be little more than following the steps in INSTALL.Linux, found under the untarred Open vSwitch root directory.
cd ~/openvswitch-1.1.1 ./boot.sh ./configure --with-l26=/lib/modules/`uname -r`/build make make install
Then, instantiate the kernel module:
insmod datapath/linux-2.6/openvswitch_mod.ko
2.1. Sanity checks
If things are not well, here are some things worth checking:
- Check /usr/src/linux-headers-`uname -r`/.config for the following kernel configs:
- CONFIG_BRIDGE as module (=m)
- NET_CLS_ACT, NET_CLS_U32, NET_SCH_INGRESS as modules or built-in (=m or =y, respectively) if policing
- CONFIG_TUN if you need tunneling
Fix them as necessary.
- The bridge module should not be loaded (e.g. should not show up when you do
lsmod | grep bridge
); remove it if it is loaded. If it seems to be loaded at boot time, there may be an entry for it somewhere in /etc/modules.
- /lib/modules/$(uname -r)/build should be a link to the Linux kernel header directory:
root@node1-1:~# ls -ald /lib/modules/$(uname -r)/build lrwxrwxrwx 1 root root 40 2011-07-26 13:41 /lib/modules/2.6.35-30-generic/build -> /usr/src/linux-headers-2.6.35-30-generic
This directory should contain (mostly) unbroken links. If not, repeat step 3 of the prerequisites with another kernel version.
- Modules may not get loaded properly; look for Open vSwitch modules with
lsmod
:root@node1-1:~/openvswitch-1.1.1# lsmod | grep open openvswitch_mod 68183 1
- In general,
dmesg
can be used to check for various anomalies when things e.g. insmod fail silently.
References
The following links were referenced but aren't relevant overall; this is just for citation.
- http://www.cyberciti.biz/tips/build-linux-kernel-module-against-installed-kernel-source-tree.html
- http://forums.gentoo.org/viewtopic-t-118180-highlight-bridgeutils.html?sid=4d602c9e364130609caff99aa2a40c69
- https://help.ubuntu.com/community/Kernel/Compile
- http://ubuntuguide.net/ubuntu-11-04-upgrade-linux-kernel-to-2-6-39-0
Attachments (1)
-
INSTALL.Linux
(12.6 KB
) - added by 13 years ago.
OVS-1.1.1 install instruction
Download all attachments as: .zip