Open vSwitch Installation on Centos 7 - mabazyar/Open-vSwitch-on-Centos7 GitHub Wiki
Prerequisites
The following packages need to be installed in advance:
yum -y install make gcc openssl-devel autoconf automake rpm-build redhat-rpm-config python-devel kernel-devel kernel-debug-devel libtool wget python-six selinux-policy-devel graphviz python-twisted-core python-zope-interface PyQt4 desktop-file-utils libcap-ng-devel groff checkpolicy python-sphinx
yum -y localinstall http://downloads.naulinux.ru/pub/NauLinux/7x/x86_64/Extras/RPMS/Projects/OpenFlow/python-openvswitch-2.5.0-2.el7.noarch.rpm
Preparation
The most recent release needs to be pulled from the official OVS website. ATTOW, the most recent one is as below: http://openvswitch.org/releases/openvswitch-2.8.1.tar.gz
prepare the build environment like so:
mkdir -p ~/rpmbuild/SOURCES
cd ~/rpmbuild/SOURCES
wget http://openvswitch.org/releases/openvswitch-2.8.1.tar.gz # The latest version
tar -xvzf openvswitch-2.8.1.tar.gz
rpmbuild -bb --without $(pwd)/openvswitch-2.8.1/rhel/openvswitch-fedora.spec
Installation
Run the following commands to have the OVS installed on the host OS:
cd /root/rpmbuild/RPMS/x86_64
ls -1 | xargs -n 1 yum -y localinstall
SELinux Status
Check the SELinux status, if it has already been activated then switch it off to allow the OVS to get started off.
Change the directive SELinux=enforcing to SELinux=disabled in /etc/sysconfig/selinux and then get the host OS rebooted in order for changes to take effect. Finally, check the status of SELinux as shown:
sestatus
The expected output is as per below:
SELinux status: disabled
Start/Enable the Service
systemctl start openvswitch.service
systemctl enable openvswitch.service
Verification
Check the service on to make sure that if it is up and running, like so:
systemctl is-active openvswitch
The command-line tools should be checked on to ensure OVS is installed successfully.
ovs-vsctl -V
#OUTPUET:
ovs-vsctl (Open vSwitch) 2.8.1
DB Schema 7.15.0
ovs-vsctl --help
The following is not supposed to show anything if the OVS had not been installed previously on the host OS. As long as no errors are not in the output, we are happy.
ovs-vsctl list-br
and the last, but not least is its man page checking:
man ovs-vsctl