OVS is a programmable Openflow switch that can be controlled via SDN Controller from anywhere in the world.

Step 1: Download the TAR file

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

Step 2: Unzip and navigate to openvswitch folder

tar -xvf openv

Step 3: Make sure you have super user privileges

sudo su

Step 4: Install the following packages which are necessary for running openvswitch in your Raspberry Pi

apt-get install python-simplejson python-qt4 libssl-dev python-twisted-conch automake autoconf gcc uml-utilities libtool build-essential pkg-config

Step 5: Check the Kernel Release of the OS(eg:-linux-headers-4.9.0.4-rpi ) and copy it and run the following commands

uname -r

apt-cache search linux-headers

apt-get install -y linux-headers-4.9.0.4-rpi

Step 6: Configure and Build the kernel module

./configure --with-linux=/lib/modules/4.9.0.4-rpi/build

Step 7: Make Install

make
make install

Step 8: Browse into datapath/linux located inside the extracted openvswitch folder and run the following commands

cd datapath/linux

modprobe openvswitch

cat /etc/modules

echo "openvswitch" >> /etc/modules

cat /etc/modules

Step 9: Navigate back to openvswitch folder and create a ovs database file by running the following commands

cd ../..

touch /usr/local/etc/ovs-vswitchd.conf

mkdir -p /usr/local/etc/openvswitch

ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema

Step 10: Create and open a file named “script” using nano or any editor of your choice(Make sure you have superuser privileges when you run the command)

nano script

Step 11: Copy-paste the following codes into the file named “script”

ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \
                     --remote=db:Open_vSwitch,Open_vSwitch,manager_options \
                     --private-key=db:Open_vSwitch,SSL,private_key \
                     --certificate=db:Open_vSwitch,SSL,certificate \
                     --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert \
                     --pidfile --detach
ovs-vswitchd --pidfile --detach
ovs-vsctl --no-wait init
ovs-vsctl show

Step 12: Save the file by hitting Ctrl+o and exit the editor by hitting Ctrl+x

Step 13: Create the executable version of the file and run it

chmod +x script
./script

That’s it. Your Openvswitch would work every time you run the script file.

f you liked this article, you might also love our other Internet of Things articles.

Please check out our latest articles on Web Development.

Share
Published by
Dr. Rohit Kumar Das

Recent Posts

Step-by-Step Guide: Creating Your First App Engine Application in Google Cloud

App Engine is a robust platform within Google Cloud that empowers developers to create and…

1 year ago

Django: The Powerful Python Framework for Building High-Quality, Secure Web Applications

Django is an open-source web framework that helps developers to create and maintain high-quality, secure…

3 years ago

Convert Zigzag Patterned String in ‘PAYPALISHIRING’ Using Given Number of Rows – Code Solution

The problem of converting a string in a zigzag pattern is a classic problem in…

3 years ago

What is the Science Behind a Javelin Throw

When Neeraj Chopra bagged India's only gold medal in Tokyo 2020 Olympics, the whole nation…

4 years ago

How to integrate htmx in Django with example

Htmx is short for high power tools for HTML. It simplifies tedious work for developers.…

4 years ago

What is Biomechanics? Its history and application

What is Biomechanics? We know, mechanics is the branch of physics dealing with the motion…

4 years ago