From Boldcore's wiki
Jump to: navigation, search
(Created page with " == Openvswitch VXLAN Hello World example == This is very cool. You can create simple and efficient L2 ethernet tunnel between two hosts with L3 (IP) connection.<br> Later yo...")
 
 
Line 1: Line 1:
 
 
== Openvswitch VXLAN Hello World example ==
 
== Openvswitch VXLAN Hello World example ==
 
 
This is very cool. You can create simple and efficient L2 ethernet tunnel between two hosts with L3 (IP) connection.<br>
 
This is very cool. You can create simple and efficient L2 ethernet tunnel between two hosts with L3 (IP) connection.<br>
 
Later you can add physical interface to the ovs bridge, connect dumb physical L2 switch and interconnect two sites.
 
Later you can add physical interface to the ovs bridge, connect dumb physical L2 switch and interconnect two sites.
 
  
 
=== Open port on ffiewall ===
 
=== Open port on ffiewall ===
 
 
L2 Ethernet frames are encapsulated in L4 UDP datagrams. Port is 4789.
 
L2 Ethernet frames are encapsulated in L4 UDP datagrams. Port is 4789.
 
<pre>
 
<pre>
Line 14: Line 10:
  
 
=== Create virtual switch and VXLANs ===
 
=== Create virtual switch and VXLANs ===
 
 
<pre>
 
<pre>
 
ovs-vsctl add-br br0
 
ovs-vsctl add-br br0
Line 25: Line 20:
  
 
=== Create and connect internal virtual interface to vitual switch ===
 
=== Create and connect internal virtual interface to vitual switch ===
 
 
<pre>
 
<pre>
 
ovs-vsctl add-port br0 vi0 -- set Interface vi0 type=internal
 
ovs-vsctl add-port br0 vi0 -- set Interface vi0 type=internal

Latest revision as of 06:34, 13 April 2018

Openvswitch VXLAN Hello World example

This is very cool. You can create simple and efficient L2 ethernet tunnel between two hosts with L3 (IP) connection.
Later you can add physical interface to the ovs bridge, connect dumb physical L2 switch and interconnect two sites.

Open port on ffiewall

L2 Ethernet frames are encapsulated in L4 UDP datagrams. Port is 4789.

firewall-cmd --add-port=4789/udp --zone=public --permanent

Create virtual switch and VXLANs

ovs-vsctl add-br br0
ovs-vsctl add-port br0 vxlan0 -- set interface vxlan0 type=vxlan options:remote_ip=192.168.80.30
ovs-vsctl add-port br0 vxlan0 -- set interface vxlan0 type=vxlan options:remote_ip=192.168.80.20

br0 is the virtual switch (bridge) where you can "plug" virtual and physical interfaces remote_ip is your server's public IP (private in this case, just for testing in LAB)

Create and connect internal virtual interface to vitual switch

ovs-vsctl add-port br0 vi0 -- set Interface vi0 type=internal
ip addr add 192.168.120.10/24 dev vi0
ifconfig vi0 up
ovs-vsctl add-port br0 vi0 -- set Interface vi0 type=internal
ip addr add 192.168.120.20/24 dev vi0
ifconfig vi0 up

Tesing

Try to ping each other's IP address of vi0. (192.168.120.10 and 192.168.120.20)