How To Install OpenvSwitch On CentOS 7
- Install some packages
yum -y install wget openssl-devel gcc make python-devel openssl-devel kernel-devel kernel-debug-devel autoconf automake rpm-build redhat-rpm-config libtool
- You can add a user that can see the file and directory clearly, up to you.
- Get the file and decompress it
mkdir -p ~/rpmbuild/SOURCES
wget http://openvswitch.org/releases/openvswitch-2.3.1.tar.gz
cp openvswitch-2.3.1.tar.gz ~/rpmbuild/SOURCES/
tar xfz openvswitch-2.3.1.tar.gz
- Modify the file
sed 's/openvswitch-kmod, //g' openvswitch-2.3.1/rhel/openvswitch.spec > openvswitch-2.3.1/rhel/openvswitch_no_kmod.spec
- Generate the rpm file
rpmbuild -bb --nocheck ~/openvswitch-2.3.1/rhel/openvswitch_no_kmod.spec
- exit
- Install the rpm package
yum localinstall /home/ovs/rpmbuild/RPMS/x86_64/openvswitch-2.3.1-1.x86_64.rpm
- Check that the command-line tools are ready
- NOW, if you're using SELinux in enfocing mode and try to start the service, you'll find some errors. Please follow the steps to solve it.
yum install policycoreutils-python
mkdir /etc/openvswitch
semanage fcontext -a -t openvswitch_rw_t "/etc/openvswitch(/.*)?"
restorecon -Rv /etc/openvswitch
- Start OpenvSwitch
- /etc/init.d/openvswitch start