Open VSwitch (OVS) 2.5.6 LTS Install (Ubuntu 16.04.5)

Step 1. Download and install OVS 2.5.6

$ sudo apt-get install wget autoconf libtool -y
$ wget https://www.openvswitch.org/releases/openvswitch-2.5.6.tar.gz
$ tar zxvf openvswitch-2.5.6.tar.gz
$ cd openvswitch-2.5.6
$ ./boot.sh
$ ./configure
$ make && make install
$ sudo modprobe openvswitch
$ sudo lsmod | grep openvswitch
$ export PATH=$PATH:/usr/local/share/openvswitch/scripts
$ ovs-ctl start

Step 2. Make bridge and add port(s)

# remove and add ovsbr0
$ sudo ovs-vsctl del-br ovsbr0 2> /dev/null
$ sudo ovs-vsctl add-br ovsbr0

# configure ovsbr0
$ sudo ovs-vsctl set-controller ovsbr0 tcp:127.0.0.1:6633
$ sudo ovs-vsctl -- set bridge ovsbr0 protocols=OpenFlow10
$ sudo ovs-vsctl set-fail-mode ovsbr0 secure

# add interfaces to ovsbr0
$ sudo ovs-vsctl add-port ovsbr0 [interface name]
$ sudo ovs-vsctl add-port ovsbr0 [interface name]
$ sudo ovs-ofctl show ovsbr0

Step 3. Install flow rules

$ sudo ovs-ofctl add-flow ovsbr0 in_port=1,actions=output:2
$ sudo ovs-ofctl add-flow ovsbr0 in_port=2,actions=output:1
$ sudo ovs-ofctl dump-flows ovsbr0

 

Leave a Reply

Your email address will not be published. Required fields are marked *