VxLAN and HW-VTEP configuration example for OpenSwitch

Get the PDF version here.

VxLAN configuration in OpenSwitch

example
Figure 1. VNI and VLAN mapping in VTEP

Configuration example

conf_example
Figure 2. VTEP1 to VTEP2
Configure VTEP 1:

Setting loopback interface 1 as VxLAN source interface.

switch# configure terminal
switch(config)# vxlan source-interface loopback 1

Configure IP address of loopback interface 1.

switch(config)# interface loopback 1
switch(config-loopback-if)# ip address 1.1.1.1/32

Create VLAN 100 and VNI 1000, binding VLAN 100 to VNI 1000

switch(config)# vlan 100
switch(config-vlan)# no shutdown
switch(config-vlan)# exit
switch(config)# vni 1000
switch(config-vni)# vlan 100

Configure interface 1 to VLAN access mode and access VLAN to 100

switch(config)# interface 1
switch(config-if)# no routing
switch(config-if)# vlan access 100

Create VxLAN tunnel 1 and binding to VNI 1000

switch(config)# interface tunnel 1 mode vxlan
switch(config-vxlan-if)# vxlan-vni 1000
switch(config-vxlan-if)# destination ip 2.2.2.2

Configure default route to destination IP 2.2.2.2.

switch(config)#interface 49
switch(config-if)#no shutdown
switch(config-if)#autonegotiation off
switch(config-if)#ip address 192.168.1.1/24
switch(config-if)#exit
switch(config)#ip route 0.0.0.0/0 192.168.1.2
Configure VTEP 2:

Setting loopback interface 1 as VxLAN source interface.

switch# configure terminal
switch(config)# vxlan source-interface loopback 1

Configure IP address of loopback interface 1.

switch(config)# interface loopback 1
switch(config-loopback-if)# ip address 2.2.2.2./32

Create VLAN 100 and VNI 1000, binding VLAN 100 to VNI 1000

switch(config)# vlan 100
switch(config-vlan)# no shutdown
switch(config-vlan)# exit
switch(config)# vni 1000
switch(config-vni)# vlan 100

Configure interface 1 to VLAN access mode and access VLAN to 100

switch(config)# interface 1
switch(config-if)# no routing
switch(config-if)# vlan access 100

Create VxLAN tunnel 1 and binding to VNI 1000

switch(config)# interface tunnel 1 mode vxlan
switch(config-vxlan-if)# vxlan-vni 1000
switch(config-vxlan-if)# destination ip 1.1.1.1

Configure default route to destination IP 2.2.2.2.

switch(config)#interface 49
switch(config-if)#no shutdown
switch(config-if)#autonegotiation off
switch(config-if)#ip address 192.168.1.2/24
switch(config-if)#exit
switch(config)#ip route 0.0.0.0/0 192.168.1.1

OpenSwitch HW-VTEP configuration

Application example

Setting loopback interface 1 as VxLAN source interface.

switch# configure terminal
switch(config)# vxlan source-interface loopback 1

Configure IP address of loopback interface 1.

switch(config)# interface loopback 1
switch(config-loopback-if)# ip address 1.1.1.1/32

Set interface 1 and as access port

switch(config)# interface 1
switch(config-if)# no shutdown
switch(config-if)# no routing
switch(config-if)# interface 2
switch(config-if)# no shutdown
switch(config-if)# no routing

Configure default route

switch(config)#interface 49
switch(config-if)#no shutdown
switch(config-if)#autonegotiation off
switch(config-if)#ip address 192.168.1.1/24
switch(config-if)#exit
switch(config)#ip route 0.0.0.0/0 192.168.1.2

Configure VXLAN via tool ‘vtep-ctl’ in Linux shell

root@switch:~# vtep-ctl add-ls ls0
root@switch:~# vtep-ctl set Logical_Switch ls0 tunnel_key=1000

Check vxlan status with command “show vxlan” in vtysh

switch# show vxlan
VxLAN source interface: lo1
VxLAN source IP address: 1.1.1.1
VNID VLAN Tunnel Remote VTEP
-----------------------------------------------
1000 N/A

Add three remote mac address and binding to remote tunnel

root@switch:~#vtep-ctl add-ucast-remote ls0 00:00:00:00:00:aa 2.2.2.2
root@switch:~#vtep-ctl add-ucast-remote ls0 00:00:00:00:00:ab 2.2.2.2
root@switch:~#vtep-ctl add-ucast-remote ls0 00:00:00:00:00:ac 2.2.2.3

Check VXLAN tunnel status with command ‘show vxlan tunnel’ in vtysh

switch# show vxlan tunnel
Tunnel VNID Local IP Remote IP Status
----------------------------------------------------------------
tunnel1 1000 1.1.1.1 2.2.2.2 up
tunnel2 1000 1.1.1.1 2.2.2.3 up

Check VXLAN tenant system status with command ‘show vxlan tenant-system’ in vtysh

switch# show vxlan tenant-system
Number of MAC addresses : 3
MAC Address VNID Type Port
-------------------------------------------------------
00:00:00:00:00:ab 1000 hw-vtep tunnel1
00:00:00:00:00:aa 1000 hw-vtep tunnel1
00:00:00:00:00:ac 1000 hw-vtep tunnel2

Binding port 1 to vlan 100 and vnid 1000

root@switch:~# vtep-ctl bind-ls switch 1 100 ls0

Check VXLAN status with command ‘show vxlan’ in vtysh

switch# show vxlan
VxLAN source interface: lo1
VxLAN source IP address: 1.1.1.1
VNID VLAN Tunnel Remote VTEP
-----------------------------------------------
1000 100 tunnel1 2.2.2.2
tunnel2 2.2.2.3

Insert un-tagged packet to interface 1

After inserting un-tagged packet to interface 1, check VXLAN tenant-system with command ‘show vxlan tenant-system” in vtysh

root@switch:~# vtysh
switch# show vxlan tenant-system
Number of MAC addresses : 7
MAC Address VNID Type Port
-------------------------------------------------------
00:00:00:00:00:ab 1000 hw-vtep tunnel1
00:00:00:00:00:aa 1000 hw-vtep tunnel1
00:00:00:00:00:de 1000 vxlan 1
00:00:00:00:00:dd 1000 vxlan 1
00:00:00:00:00:ac 1000 hw-vtep tunnel2
00:00:00:00:00:df 1000 vxlan 1

Check hardware_vtep db Ucast_Macs_Local table

root@switch:~# ovsdb-client dump hardware_vtep Ucast_Macs_Local
Ucast_Macs_Local table
MAC                 _uuid                                ipaddr locator                              logical_switch
------------------- ------------------------------------ ------ ------------------------------------ ------------------------------------
"00:00:00:00:00:dd" 36616e07-d0ff-4296-bd9e-a86260af5533 ""     274589f8-1e9c-47ac-aaee-e733aca3bcc3 834a056f-cd6b-4587-b8b7-be3b2aedd940
"00:00:00:00:00:de" ced9c40d-3c4a-4b69-ad47-1f29596fdead ""     274589f8-1e9c-47ac-aaee-e733aca3bcc3 834a056f-cd6b-4587-b8b7-be3b2aedd940
"00:00:00:00:00:df" 62ca2f88-6eb0-44c7-a6a8-ad69cc995d6d ""     274589f8-1e9c-47ac-aaee-e733aca3bcc3 834a056f-cd6b-4587-b8b7-be3b2aedd940