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.
Rohit Kumar Das currently working as Assistant Professor in VIT-AP University, Andhra Pradesh, India. Obtained his Ph.D. degree from North-Eastern Hill University, Meghalaya, India. His area of interest are Internet of Things, Software-Defined Network, Big Data and Blockchain.