Tuesday, September 23, 2014

Load Register action and resubmit actions in openflow with openvswitch 2.3

 Here is a sample configuration which includes configuring a flow based tunnel and forwarding traffic on this tunnel.

We try to filter out all the ICMP traffic. We use multi-table support to achieve this.

ovs-vsctl add-br br0
ovs-vsctl add-port br0 tun1
ovs-vsctl add-port br0 allvxlan -- set interface allvxlan type=vxlan options:remote_ip=flow options:key=flow


ovs-ofctl add-flow br0 "table=0,priority=99,in_port=1,dl_type=0x800,nw_proto=1,actions=exit"

ovs-ofctl add-flow br0 "table=0, priority=0,in_port=2,tun_src=192.168.1.10,tun_id=5001,actions=load:5001->NXM_NX_REG2[],resubmit(,2)"

ovs-ofctl add-flow br0 "table=0, priority=0,in_port=1,actions=resubmit(,2)"

ovs-ofctl add-flow br0 "table=2,in_port=1 actions=set_tunnel:5001,set_field:192.168.1.10->tun_dst,2"

ovs-ofctl add-flow br0 "table=2,reg2=5001,dl_dst=ff:ff:ff:ff:ff:ff/ff:00:00:00:00:00,actions=1"

ovs-ofctl add-flow br0 "table=2,reg2=5001,dl_dst=00:0F:B7:80:04:96,actions=1"

flow based tunnels and port based tunnels in openvswitch

a very good reference for this is http://benpfaff.org/~blp/ovs-fields.pdf

CentOS 6.4 SL 6.4 and RHEL 6.4 – Openvswitch 2.3 LTS installation

#yum install wget openssl-devel
#yum groupinstall "Development Tools"
 
 
$wget http://openvswitch.org/releases/openvswitch-2.3.tar.gz
$tar xvfz openvswitch-2.3.tar.gz
$cd openvswitch-2.3
$mkdir -p /root/rpmbuild/SOURCES
$ cp ../openvswitch-1.9.3.tar.gz /root/rpmbuild/SOURCES/
$cp rhel/openvswitch-kmod.files /root/rpmbuild/SOURCES/
$rpmbuild -bb rhel/openvswitch.spec
$rpmbuild -bb rhel/openvswitch-kmod-rhel6.spec
$exit

#yum localinstall /root/rpmbuild/RPMS/x86_64/kmod-openvswitch-1.9.3-1.el6.x86_64.rpm
#yum localinstall /root/rpmbuild/RPMS/x86_64/openvswitch-1.9.3-1.x86_64.rpm