Configuring a VXLAN
Prerequisites
- A enabled layer 3 interface with an IP address assigned to it, created with the command
interface
. A layer 3 VLAN.
Procedure
-
Create VXLAN interface 1 with the command
interface vxlan
. -
Enable VXLAN interface 1 with the command
no shutdown
. -
Set the source IP address for the VXLAN tunnel with the command
source ip
. -
Create a VNI with the command
vni
. -
Define the IP address of the peer VTEP with the command
vtep-peer
. -
Associate a VLAN with the VNI with the command
vlan
. -
Review VXLAN settings with the commands
show interface vxlan1
andshow interface vxlan1 vteps
.
Example
This example creates the following configuration:
- Creates the layer 3 underlay interface
1/1/1 with IP address
100.1.1.1/24
. - Creates VLAN 10.
- Creates VXLAN interface 1.
- Sets the source IP address for the VXLAN tunnel to 100.1.1.1.
- Creates VNI 10.
Sets the VTEP peer to 200.1.1.1.
Associates VLAN 10 with VNI 10.
switch(config)# interface 1/1/1 switch(config-if)# no shutdown switch(config-if)# ip address 100.1.1.1/24 switch(config-if)# exit switch(config)# vlan 10 switch(config-vlan-10)# exit switch(config)# interface vxlan 1 switch(config-vxlan-if)# no shutdown switch(config-vxlan-if)# source ip 100.1.1.1 switch(config-vxlan-if)# vni 10 switch(config-vni)# vtep-peer 200.1.1.1 switch(config-vni)# VLAN 10 switch(config-vni)# exit switch(config-vxlan-if)# exit switch(config-if)# exit switch(config)# show interface vxlan1 Interface vxlan1 is up Admin state is up Description:VXLAN1 Destination UDP port: 4789 VTEP source IPv4 address: 100.1.1.1 VNI VLAN VTEP Peers 10 10 200.1.1.1