How to compile and install OpenvSwitch in Linux

0 0
0 0

Open vSwitch is a multilayer virtual switch licensed under the open source. Which has the level of production level quality with VLAN, traffic shaping etc.

Open VSwitch come in source tarball we need to build our own RPM from source. To build the RPM package we need to install with below RPM build package and dependencies.

# yum install make gcc curl wget vim openssl-devel autoconf automake rpm-build libtool redhat-rpm-config python-devel openssl-devel kernel-devel kernel-debug-devel

Create an rpm build directory under root’s home.

# mkdir -p ~/rpmbuild/SOURCES

Download OpenvSwitch source code from the official website. Move the downloaded tarball to RPM build directory and extract the content.

# wget

# cp openvswitch-2.5.2.tar.gz ~/rpmbuild/SOURCES/

#tar xfz openvswitch-2.5.2.tar.gz

Replace kernel module to null using sed. Build the RPM using rpmbuild.

# sed ‘s/openvswitch-kmod, //g’ /root/rpmbuild//SOURCES/openvswitch-2.5.2/rhel/openvswitch.spec > /root/rpmbuild/SOURCES/openvswitch-2.5.2/rhel/openvswitch_no_kmod.spec

# rpmbuild -bb –nocheck ~/rpmbuild/SOURCES/openvswitch-2.5.2/rhel/openvswitch_no_kmod.spec

We are ready to install RPM package, Install with required SELinux policy package to restore Policy.

# yum localinstall rpmbuild/RPMS/x86_64/openvswitch-2.5.2-1.x86_64.rpm

# yum install policycoreutils-python

# semanage fcontext -a -t openvswitch_rw_t “/etc/openvswitch(/.*)?”

# restorecon -Rv /etc/openvswitch

Start the OpenVSwitch service and check the status.

# systemctl status openvswitch.service

# systemctl start openvswitch.service

# systemctl status openvswitch.service

# chkconfig openvswitch on

To Check installed version use below command.

# ovs-vsctl -V

About Post Author

Babin Lonston

Overall 14+ Years of experience in the IT field, currently working as a Senior Linux administration with Virtualization & Cloud. Being numismatist for a long time.
0 0 %
0 0 %
0 0 %
0 0 %
0 0 %
0 0 %

Average Rating

5 Star
4 Star
3 Star
2 Star
1 Star

Leave a Reply

Your email address will not be published.

Previous post Convert GPT to MBR layout in any Linux Drives
Next post Create Bootable USB disk of CentOS 7 in Mac OS x

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

We promise not to spam you, and we don't usually send more than one email a week.

You have Successfully Subscribed!

Exit mobile version