>GRE Tunneling with Open Vswitch

By | August 9, 2013

>

Tunneling is one of the hot topics in networking. Tunneling create two points in the network and allow traffic to enter on one point and exit on other. No deviation of traffic between these two points, we can say strictly point to point delivery. Tunneling perform encapsulation on the network traffic and forward that via tunnel endpoint.
 
Here in this writeup, I am going to discuss tunneling in open vswitch to separate management traffic from VM traffic.
 
You can see in above given image there are two virtual machine VM1 and VM2. These virtual machines are located on different hypervisors (systems). The hypervisor communicate to network via eth0, so all the traffic including VM traffic pass via eth0. What I am going to do is to create a bridge network interface. All the network traffic pass to this bridge will transfer via the tunnel.
 
Let us first create a tunnel interface and bridge that interface with eth0 interface which transfer the traffic physically.
 
 
I used below commands for creating tunnel interface tep0 and bridging that interface with eth0. The name of bridged interface is br0 here. 
+++++++++++++Hypervisor 1+++++++++++++++++++++++++++
#ovs-ovsctl add-br br0
#ovs-ovsctl add-port br0 eth0
#ovs-ovsctl add-port br0 tep0 –set interface tep0 type=internal
#ifconfig tep0 192.168.10.1 netmask 255.255.255.0
+++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++Hypervisor 2++++++++++++++++++++++++++++++
#ovs-ovsctl add-br br0
#ovs-ovsctl add-port br0 eth0
#ovs-ovsctl add-port br0 tep0 –set interface tep0 type=internal
#ifconfig tep0 192.168.10.2 netmask 255.255.255.0
++++++++++++++++++++++++++++++++++++++++++++++++++
Now ping 192.168.10.2 from Hypervisor 1 and 192.168.10.1 from Hypervisor 2, if they ping each other successfully then you can proceed further and create GRE tunnel on both ends.

On Hypervisor 1 execute following command to create gre tunnel
+++++++++++Hypervisor 1++++++++++++++++
 
#ovs-ovsctl add-br br2
#ovs-ovsctl add port br2 gre0 –set interface gre0 type=gre options:remote_ip=192.168.10.2
++++++++++++++++++++++++++++++++++++
 
+++++++Hypervisor 2+++++++++++++++++++++
 
#ovs-ovsctl add-br br2
#ovs-ovsctl add port br2 gre0 –set interface gre0 type=gre options:remote_ip=192.168.10.1
++++++++++++++++++++++++++++++++++++++++
 
 
Share itShare on FacebookEmail this to someoneTweet about this on TwitterShare on Google+Share on LinkedInPrint this page

Leave a Reply

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

Current month ye@r day *