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
@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