| 1 | = Installing Open vSwitch on a node = |
| 2 | 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 [http://openvswitch.org/ 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). |
| 3 | |
| 4 | == 1.Prerequisites == |
| 5 | 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: |
| 6 | |
| 7 | 1. In /etc/apt/sources.list, replace all instances of 'apt:9999' with 'us.archive.ubuntu.com' |
| 8 | |
| 9 | 2. Install packages for Open Vswitch: |
| 10 | {{{ |
| 11 | apt-get update |
| 12 | apt-get install pkg-config autoconf automake linux-libc-dev libtool |
| 13 | }}} |
| 14 | |
| 15 | 3. Fetch and untar Open vSwitch (don't do anything to it yet): |
| 16 | {{{ |
| 17 | cd ~/ |
| 18 | wget http://openvswitch.org/releases/openvswitch-1.1.1.tar.gz |
| 19 | tar -xf openvswitch-1.1.1.tar.gz |
| 20 | }}} |
| 21 | |
| 22 | 4. 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`). |
| 23 | {{{ |
| 24 | apt-get install linux-headers-2.6.35-30-generic linux-image-2.6.35-30-generic |
| 25 | reboot |
| 26 | apt-get install linux-source-2.6.35 |
| 27 | }}} |
| 28 | 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. |
| 29 | |
| 30 | == 2. Installation == |
| 31 | 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. |
| 32 | {{{ |
| 33 | cd ~/openvswitch-1.1.1 |
| 34 | ./boot.sh |
| 35 | ./configure --with-l26=/lib/modules/`uname -r`/build |
| 36 | make |
| 37 | make install |
| 38 | }}} |
| 39 | |
| 40 | == 2.1. Sanity checks == |
| 41 | If things are not well, here are some things worth checking: |
| 42 | |
| 43 | 1. Check /usr/src/linux-headers-!`uname -r`/.config for the following kernel configs: |
| 44 | |
| 45 | * CONFIG_BRIDGE as module (=m) |
| 46 | * NET_CLS_ACT, NET_CLS_U32, NET_SCH_INGRESS as modules or built-in (=m or =y, respectively) if policing |
| 47 | * CONFIG_TUN if you need tunneling |
| 48 | |
| 49 | Fix them as necessary. |
| 50 | |
| 51 | 2. 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. |
| 52 | |
| 53 | 3. /lib/modules/$(uname -r)/build should be a link to the Linux kernel header directory: |
| 54 | {{{ |
| 55 | root@node1-1:~# ls -ald /lib/modules/$(uname -r)/build |
| 56 | 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 |
| 57 | }}} |
| 58 | This directory should contain (mostly) unbroken links. If not, repeat step 3 of the prerequisites with another kernel version. |
| 59 | |
| 60 | == References == |
| 61 | The following links were referenced but aren't relevant overall; this is just for citation. |
| 62 | |
| 63 | * http://www.cyberciti.biz/tips/build-linux-kernel-module-against-installed-kernel-source-tree.html |
| 64 | * http://forums.gentoo.org/viewtopic-t-118180-highlight-bridgeutils.html?sid=4d602c9e364130609caff99aa2a40c69 |
| 65 | * https://help.ubuntu.com/community/Kernel/Compile |
| 66 | * http://ubuntuguide.net/ubuntu-11-04-upgrade-linux-kernel-to-2-6-39-0 |