Open vSwitch Red Hat Installation

Open vSwitch Red Hat Installation

Open Vswitch Lab

Open vSwitch Red Hat Installation

This is an updated tutorial for an Open vSwitch Red Hat Installation. It is a little tricky at the moment from a kernel-devel bug that has a broken symbolic link. I did a screencast also in case anyone gets stuck. Just let me know if I mistyped anything and I will update it.

Install Open vSwitch Pre-Reqs for Red Hat

The OS details are here.

Next using Yum, install some dependencies.

Open vSwitch Red Hat Installation

No need to run -> ./ from the tarball.
Next fix a bug from kernel-devel before you run ./configure.

rm build Add the new symlink based on the output of:

Figure 1. It will look something like this. Notice the symbolic link is linked to a bad target. you will simply re-link that.

Once you fix the symlink your configure will run clean so cd back into the openvswitch dir.

Now ./configure will go clean.

If you leave the bad symlink you will get this error:

Next we need to edit a kernel file and comment something out.

Open skbuff.h and head to line 242 or there about. Find the following code and comment it out.

Openvswitch skbuff before edit
Figure 2. Edit skbuff.h around line 242.

Change it to reflect the next screenshot by commenting out the following method and next three lines after it.

Figure 3. Here is what it should look like after the edit.

Now finish the build.

If you do not comment out the file properly you will get and error like the following:

Now that you got it to build cleanly you need to make sure the linux bridge kernel module is not loaded.

Then insert the openvswitch.ko kernel module. Fastpath good, slow path bad. This is executed from within the untarred Open vSwitch directory where you compiled the code so the full path would be /home//openvswitch/datapath/linux/openvswitch.ko.

If you do not remove the Linux bridge module you will get ths follwoing error.

The rest is just copy and paste.

Configure the Open vSwitch Bridge and Network

Open vSwitch Red Hat Installation Screencast

Thanks for stopping by, feel free to post any issues, apologies for any delays in response.

About the Author

Brent SalisburyI have over 15 years of experience wearing various hats from, network engineer, architect, devops and software engineer. I currently have the pleasure of working at the company that develops my favorite software I have ever used, Docker. My comments here are my personal thoughts and opinions. More at Brent's BioView all posts by Brent Salisbury →

  1. Jian QiuJian Qiu02-01-2013

    I exactly followed the instruction to compile openvswitch-1.4.5 on CentOS 6.3. Compilation was a success. However, when I did ‘insmod openvswitch_mod’, the following error message was found in dmesg:

    openvswitch_mod: Undefined symbol ‘kmem_cache_alloc_trace’

    Laster I found out that it was caused by a mismatch between the running kernel, which was installed from original ISO, and the kernel headers, which was installed by yum install kernel-devel.

    I did a yum distribution-synchronization. Then reboot the system with the up-to-date kernel and redo the compilation. Finally, the kernel module can be insmod without any error.

    • Hey! Quick question that’s entirely off topic. Do you know how to make your site mobile friendly? My web site looks weird when browsing from my iphone. I’m trying to find a theme or plugin that might be able to
      fix this problem. If you have any suggestions, please share.
      Appreciate it!

    • What a stuff of un-ambiguity and preserveness of precious knowledge concerning unpredicted emotions.

    • Hey there just wanted to give you a quick heads up. The text in your article
      seem to be running off the screen in Firefox. I’m not sure if this is a formatting issue or something to do with internet browser compatibility but I figured I’d post to let you know.
      The layout look great though! Hope you get the problem fixed soon.
      Many thanks

  2. Ken CorkinsKen Corkins03-14-2013

    Great Blog. I’ve found lots of useful information. I really appreciate it.

    I just ran these instructions on a CentOS 6.4 system and the kernel-devel bug is not there (I dod not have to fix the symlink).

    Thanks again!

  3. Jian QiuJian Qiu03-19-2013

    CentOS 6.4 kernel already includes the openvswitch kernel module. So just compile the userspace program without –with-linux option.

    • Ken CorkinsKen Corkins03-19-2013

      Thanks Jian!

  4. hacker un wifihacker un wifi10-28-2013

    I enjoy what you guys are usually up too. This type of clever work and exposure!
    Keep up the wonderful works guys I’ve added you guys to blogroll.

  5. DreamerDreamer03-21-2014


    I am getting this error after make:

    make[4]: Entering directory `/usr/src/kernels/2.6.18-371.6.1.el5-i686′
    CC [M] /root/openvswitch-1.1.0pre2/datapath/linux-2.6/addrconf_core-openvswitch.o
    In function ‘__ipv6_addr_type’:
    error: ‘IPV6_ADDR_RESERVED’ undeclared (first use in this function)
    error: (Each undeclared identifier is reported only once
    error: for each function it appears in.)
    make[5]: *** [/root/openvswitch-1.1.0pre2/datapath/linux-2.6/addrconf_core-openvswitch.o]
    Error 1
    make[4]: *** [_module_/root/openvswitch-1.1.0pre2/datapath/linux-2.6] Error 2
    make[4]: Leaving directory `/usr/src/kernels/2.6.18-371.6.1.el5-i686′
    make[3]: *** [default] Error 2
    make[3]: Leaving directory `/root/openvswitch-1.1.0pre2/datapath/linux-2.6′
    make[2]: *** [all-recursive] Error 1
    make[2]: Leaving directory `/root/openvswitch-1.1.0pre2/datapath’
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/root/openvswitch-1.1.0pre2′
    make: *** [all] Error 2

    I guess that some dependency is missing, but I can’t figure out which one…

    Please help

  6. watch lockewatch locke04-23-2014

    What’s Going down i’m new to this, I stumbled upon this I have discovered It positively helpful
    and it has aided me out loads. I’m hoping to give a
    contribution & aid other customers like its helped me. Good job.

  7. I think everything posted was actually very logical. But,
    what about this? what if you were to create a killer headline?
    I ain’t suggesting your content is not good., however suppose you added a headline that makes people desire more?

    I mean Open vSwitch Red Hat Installation is kinda vanilla.
    You could glance at Yahoo’s front page and note how they create news headlines to grab viewers to click.
    You might try adding a video or a related picture or two
    to grab people interested about what you’ve
    got to say. Just my opinion, it might bring your posts a little
    bit more interesting.