Skip to content

Instantly share code, notes, and snippets.

@umardx
Last active December 6, 2022 13:50
Show Gist options
  • Star 23 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save umardx/a31bf6a13600a55c0d07d4ca33133834 to your computer and use it in GitHub Desktop.
Save umardx/a31bf6a13600a55c0d07d4ca33133834 to your computer and use it in GitHub Desktop.
Installation Openvswitch LTS in CentOS 7

Based on this post: https://n40lab.wordpress.com/2016/03/02/openvswitch-lts-in-centos-7 The most recent release from the LTS series: http://openvswitch.org/releases/openvswitch-2.5.4.tar.gz

Instructions:

As the root user let’s install some packages:

yum -y install wget openssl-devel gcc make python-devel openssl-devel kernel-devel graphviz kernel-debug-devel autoconf automake rpm-build redhat-rpm-config libtool python-twisted-core python-zope-interface PyQt4 desktop-file-utils libcap-ng-devel groff checkpolicy selinux-policy-devel

Add a new user and switch to that user:

adduser ovs

su - ovs

Download source code and prepare the build environmen.

mkdir -p ~/rpmbuild/SOURCES

wget http://openvswitch.org/releases/openvswitch-2.5.4.tar.gz

cp openvswitch-2.5.4.tar.gz ~/rpmbuild/SOURCES/

tar xfz openvswitch-2.5.4.tar.gz

Build the RPM package (no testing) and exit.

rpmbuild -bb --nocheck openvswitch-2.5.4/rhel/openvswitch-fedora.spec

exit

As root, we’ll install the RPM package.

yum localinstall /home/ovs/rpmbuild/RPMS/x86_64/openvswitch-2.5.4-1.el7.centos.x86_64.rpm -y

Finally start the openvswitch service and check that it’s running.

systemctl start openvswitch.service

systemctl is-active openvswitch

active --> Ok

Make openvswitch service to start at boot time:

systemctl enable openvswitch

Let’s check that the command-line tools are ready:

ovs-vsctl -V

ovs-vsctl (Open vSwitch) 2.5.2

Compiled Apr  6 2017 13:07:27

DB Schema 7.12.1
@medometo
Copy link

the simplest install procedure I've seen...thanks

@anaconics
Copy link

Thanks a lot.

@mexmirror
Copy link

Awesome. Thank you. Still works with Cents 7.4

@c51303
Copy link

c51303 commented Dec 6, 2017

Thank you.

@boiler-man
Copy link

Again, thanks. This post has saved me a lot of trouble. So perfectly concise.

@grantterra
Copy link

It works,Thank you.

@c0dyhi11
Copy link

@umardx
Is the RPM "Portable"? I.E. can I build it once for CentOS 7.4 and then push it to all of my hypervisors?
Or are the yum packages installed or the ovs user created above a dependency for this RPM?

@umardx
Copy link
Author

umardx commented Feb 21, 2018

@c0dyhi11 I'm not sure, but as long as your CentOS major version 7, I think it will be fine.

@xjtuwxg
Copy link

xjtuwxg commented Mar 12, 2018

Nice post. Works great for beginners

@CrazyBite
Copy link

Thanks a lot!

@gouthamraj91
Copy link

Works perfectly in CentOS 7.4.1708! Thanks!

@doncicuto
Copy link

I think it would be fair to add the original reference:https://n40lab.wordpress.com/2016/03/02/openvswitch-lts-in-centos-7/

@amiribrahim
Copy link

Can I do the same by cloning the OVS from this github repo https://github.com/doonhammer/ovs?
Also How can I install OVN along with OVS?

@davmin
Copy link

davmin commented Feb 3, 2020

Used the same process to install 2.5.9 on centos 7.7

Build and install worked fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment