{"id":6977,"date":"2017-09-12T12:40:57","date_gmt":"2017-09-12T04:40:57","guid":{"rendered":"http:\/\/rmohan.com\/?p=6977"},"modified":"2017-09-12T12:41:23","modified_gmt":"2017-09-12T04:41:23","slug":"open-vswitch-installation-on-centos-7-2","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=6977","title":{"rendered":"Open vSwitch installation on CentOS 7.2"},"content":{"rendered":"<p>Open vSwitch installation on CentOS 7.2<br \/>\nOpen vSwitch (OVS) is a production quality, multilayer virtual switch software available for various platforms. The server platforms include x86 based latest Linux distributions e.g. Debian 16 LTS or CentOS 7.2. Popular SDN switch operating system development company Pica8 also bundles the OVS in a custom Ubuntu version for Pronto, Dell, and many other switches.<\/p>\n<p>Below is an effort to provide easy installation instructions for OVS on CentOS 7.2 and also to integrate OVS with the OpenDaylight. Note this blog is updated to use OVS version 2.5.1 (bug fix release for OVS 2.5.0).<\/p>\n<p>Install the requisite packages.<br \/>\n#yum -y install make gcc openssl-devel autoconf automake rpm-build redhat-rpm-config python-devel openssl-devel kernel-devel kernel-debug-devel libtool wget<br \/>\nNecessary steps for building RPM<br \/>\n#mkdir -p ~\/rpmbuild\/SOURCES<br \/>\n#wget http:\/\/openvswitch.org\/releases\/openvswitch-2.8.0.tar.gz<br \/>\n#cp openvswitch-2.8.0.tar.gz ~\/rpmbuild\/SOURCES\/<br \/>\n#tar xfz openvswitch-2.8.0.tar.gz<br \/>\n#sed &#8216;s\/openvswitch-kmod, \/\/g&#8217; openvswitch-2.8.0\/rhel\/openvswitch.spec > openvswitch-2.8.0\/rhel\/openvswitch_no_kmod.spec<br \/>\nBuild the RPM<br \/>\n#rpmbuild -bb &#8211;nocheck ~\/openvswitch-2.8.0\/rhel\/openvswitch_no_kmod.spec<br \/>\nInstall the RPM<br \/>\n#ls -l ~\/rpmbuild\/RPMS\/x86_64\/<br \/>\n#yum localinstall ~\/rpmbuild\/RPMS\/x86_64\/openvswitch-2.8.0-1.x86_64.rpm<br \/>\nStart the OVS service and enable it for the next boot<br \/>\n#systemctl start openvswitch.service<br \/>\n#chkconfig openvswitch on<br \/>\nThis process will install the OVS on the server and start the process. Firewall should be open to accept the incoming TCP connection at port 6633.<\/p>\n<p>Check that the command-line tools are ready<br \/>\novs-vsctl -V<br \/>\nNOW, if you&#8217;re using SELinux in enfocing mode and try to start the service, you&#8217;ll find some errors. Please follow the steps to solve it.<br \/>\nyum install policycoreutils-python<br \/>\nmkdir \/etc\/openvswitch<br \/>\nsemanage fcontext -a -t openvswitch_rw_t &#8220;\/etc\/openvswitch(\/.*)?&#8221;<br \/>\nrestorecon -Rv \/etc\/openvswitch<br \/>\nStart OpenvSwitch<br \/>\n\/etc\/init.d\/openvswitch start<\/p>\n<p>Test the OVS Version<br \/>\n#ovs-vsctl -V<\/p>\n<p>Useful OVS commands<br \/>\n#ovs-vsctl show<br \/>\n#ovs-ofctl show br0<\/p>\n<p>Create a new OVS Bridge, add physical ports, connect OVS with ODL controller<br \/>\n#ovs-vsctl add-br ovsbr0<br \/>\n#ovs-vsctl set bridge ovsbr0 protocols=OpenFlow13<br \/>\n#ovs-vsctl list controller<br \/>\n#ovs-vsctl add-port ovsbr0 eth4<br \/>\n#ovs-vsctl add-port ovsbr0 eth8<br \/>\n#ovs-vsctl set-controller ovsbr0 tcp:192.168.1.57:6633<br \/>\n#ovs-vsctl show<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Open vSwitch installation on CentOS 7.2 Open vSwitch (OVS) is a production quality, multilayer virtual switch software available for various platforms. The server platforms include x86 based latest Linux distributions e.g. Debian 16 LTS or CentOS 7.2. Popular SDN switch operating system development company Pica8 also bundles the OVS in a custom Ubuntu version for [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6977"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6977"}],"version-history":[{"count":2,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6977\/revisions"}],"predecessor-version":[{"id":6979,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6977\/revisions\/6979"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6977"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6977"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6977"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}