12.1. Configuring VXLAN
Overview
Function Introduction
Virtual Extensible LAN (VXLAN) is a networking technology that encapsulates MAC-based Layer 2 Ethernet frames within Layer 3 UDP packets to aggregate and tunnel multiple layer 2 networks across a Layer 3 infrastructure. VXLAN scales up to 16 million logical networks and supports layer 2 adjacency across IP networks. Multicast transmission architecture is used for broadcast/multicast/unknown packets.
Principle Description
N/A
Configuration
Vxlan Configuration
In the following example, switch1 and swith2 are connected via layer 3 route. The traffic of vlan 20 are encapsulated in vni 20000, in order to pass through the layer 3 networks.
The following configuration should be operated on all switches if the switch ID is not specified.
step 1 Enter the configure mode
Switch# configure terminal
step 2 Enter the vlan configure mode and create vlan, enable overlay for each vlan
Switch(config)# vlan database
Switch(config-vlan)# vlan 20
Switch(config-vlan)# vlan 20 overlay enable
Switch(config-vlan)# exit
step 3 Enter the interface configure mode and set the attributes of the interface
Interface configuration for Switch1:
Switch(config)# interface eth-0-1
Switch(config-if)# switchport access vlan 20
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# interface eth-0-2
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan add 20
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# interface eth-0-9
Switch(config-if)# no switchport
Switch(config-if)# ip address 9.9.9.1/24
Switch(config-if)# overlay uplink enable
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# interface loopback0
Switch(config-if)# ip address 1.0.1.1/32
Switch(config-if)# exit
Interface configuration for Switch2:
Switch(config)# interface eth-0-1
Switch(config-if)# switchport access vlan 20
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# interface eth-0-2
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan add 20
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# interface eth-0-9
Switch(config-if)# no switchport
Switch(config-if)# ip address 9.9.9.2/24
Switch(config-if)# overlay uplink enable
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# interface loopback0
Switch(config-if)# ip address 1.0.1.2/32
Switch(config-if)# exit
Step 4 Create a static route
Configuring Switch1:
Switch(config)# ip route 1.0.1.2/32 9.9.9.2
Configuring Switch2:
Switch(config)# ip route 1.0.1.1/32 9.9.9.1
Step 5 Set attributes for overlay
Configuring Switch1:
Switch(config)# overlay
Switch(config-overlay)# source 1.0.1.1
Switch(config-overlay)# remote-vtep 1 ip-address 1.0.1.2 type vxlan
Switch(config-overlay)# vlan 20 vni 20000
Switch(config-overlay)# vlan 20 remote-vtep 1
Switch(config-overlay)# exit
Configuring Switch2:
Switch(config)# overlay
Switch(config-overlay)# source 1.0.1.2
Switch(config-overlay)# remote-vtep 1 ip-address 1.0.1.1 type vxlan
Switch(config-overlay)# vlan 20 vni 20000
Switch(config-overlay)# vlan 20 remote-vtep 1
Switch(config-overlay)# exit
step 6 Exit the configure mode
Switch(config)# end
step 7 Validation
Display the result on Switch1:
Switch# show overlay vlan 20
-------------------------------------------------------
ECMP Mode : Normal
Source VTEP : 1.0.1.1
-------------------------------------------------------
VLAN ID : 20
VNI : 20000
EVPN Tunnel Data-fdb Learning : Enable
Remote VTEP NUM : 1
Index: 1, Ip address: 1.0.1.2, Source ip: 1.0.1.1, Type: VxLAN Protocol: Static
DVR Gateway NUM: 0
-------------------------------------------------------
Display the result on Switch2:
Switch# show overlay vlan 20
-------------------------------------------------------
ECMP Mode : Normal
Source VTEP : 1.0.1.2
-------------------------------------------------------
VLAN ID : 20
VNI : 20000
EVPN Tunnel Data-fdb Learning : Eanble
Remote VTEP NUM : 1
Index: 1, Ip address: 1.0.1.1, Source ip: 1.0.1.2, Type: VxLAN, Protocol: Static
DVR Gateway NUM: 0
-------------------------------------------------------
Configuring VXLAN Routing
In the following example, VM-1 & VM-3 are encapsulated in same vni to make up the distributed route via vxlan; VM-2 & VM-4 are encapsulated in another vni to make up the distributed route via vxlan.
The following configuration should be operated on all switches if the switch ID is not specified.
step 1 Enter the configure mode
Switch# configure terminal
step 2 Enter the vlan configure mode and create vlan, enable overlay for each vlan
Switch(config)# vlan database
Switch(config-vlan)# vlan 20,30
Switch(config-vlan)# vlan 20 overlay enable
Switch(config-vlan)# vlan 30 overlay enable
Switch(config-vlan)# exit
step 3 Create a vrf instance
Switch(config)# ip vrf tenant
Switch(config-vrf)# exit
step 4 Create the layer 3 interface and set the ip address
Configuring Switch1:
Switch(config)# interface vlan 20
Switch(config-if)# ip vrf forwarding tenant
Switch(config-if)# ip address 2.2.2.111/24
Switch(config-if)# exit
Switch(config)# interface vlan 30
Switch(config-if)# ip vrf forwarding tenant
Switch(config-if)# ip address 3.3.3.111/24
Switch(config-if)# exit
Configuring Switch2:
Switch(config)# interface vlan 20
Switch(config-if)# ip vrf forwarding tenant
Switch(config-if)# ip address 2.2.2.222/24
Switch(config-if)# exit
Switch(config)# interface vlan 30
Switch(config-if)# ip vrf forwarding tenant
Switch(config-if)# ip address 3.3.3.222/24
Switch(config-if)# exit
step 5 Enter the interface configure mode and set the attributes of the interface
Switch(config)# interface eth-0-1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan add 20
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# interface eth-0-2
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan add 30
Switch(config-if)# no shutdown
Switch(config-if)# exit
Configuring Switch1:
Switch(config)# interface eth-0-9
Switch(config-if)# no switchport
Switch(config-if)# ip address 9.9.9.1/24
Switch(config-if)# overlay uplink enable
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# interface loopback0
Switch(config-if)# ip address 1.0.1.1/32
Switch(config-if)# exit
Configuring Switch2:
Switch(config)# interface eth-0-9
Switch(config-if)# no switchport
Switch(config-if)# ip address 9.9.9.2/24
Switch(config-if)# overlay uplink enable
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# interface loopback0
Switch(config-if)# ip address 1.0.1.2/32
Switch(config-if)# exit
Step 6 Set attributes for overlay
Configuring Switch1:
Switch(config)# overlay
Switch(config-overlay)# source 1.0.1.1
Switch(config-overlay)# remote-vtep 1 ip-address 1.0.1.2 type vxlan
Switch(config-overlay)# remote-vtep 1 virtual-mac 22.22.22
Switch(config-overlay)# vlan 20 vni 20000
Switch(config-overlay)# vlan 30 vni 30000
Switch(config-overlay)# vlan 20 remote-vtep 1
Switch(config-overlay)# vlan 30 remote-vtep 1
Switch(config-overlay)# vlan 20 gateway-mac a.a.a
Switch(config-overlay)# vlan 30 gateway-mac b.b.b
Switch(config-overlay)# exit
Configuring Switch2:
Switch(config)# overlay
Switch(config-overlay)# source 1.0.1.2
Switch(config-overlay)# remote-vtep 1 ip-address 1.0.1.1 type vxlan
Switch(config-overlay)# remote-vtep 1 virtual-mac 11.11.11
Switch(config-overlay)# vlan 20 vni 20000
Switch(config-overlay)# vlan 30 vni 30000
Switch(config-overlay)# vlan 20 remote-vtep 1
Switch(config-overlay)# vlan 30 remote-vtep 1
Switch(config-overlay)# vlan 20 gateway-mac a.a.a
Switch(config-overlay)# vlan 30 gateway-mac b.b.b
Switch(config-overlay)# exit
step 7 Create a static routes and vxlan routes
Configuring Switch1:
Switch(config)# ip route 1.0.1.2/32 9.9.9.2
Switch(config)# ip route vrf tenant 2.2.2.2/32 remote-vtep 1 vni 20000 inner-macda 3.3.3
Switch(config)# ip route vrf tenant 3.3.3.2/32 remote-vtep 1 vni 30000 inner-macda 4.4.4
Configuring Switch2:
Switch(config)# ip route 1.0.1.1/32 9.9.9.1
Switch(config)# ip route vrf tenant 2.2.2.1/32 remote-vtep 1 vni 20000 inner-macda 1.1.1
Switch(config)# ip route vrf tenant 3.3.3.1/32 remote-vtep 1 vni 30000 inner-macda 2.2.2
step 8 Exit the configure mode
Switch(config)# end
step 9 Validation
Display the result on Switch1:
Switch# show ip route vrf tenant
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
Dc - DHCP Client
[*] - [AD/Metric]
* - candidate default
S 2.2.2.2/32 is in overlay remote vxlan vtep:1.0.1.1->1.0.1.2,vni:20000
S 3.3.3.2/32 is in overlay remote vxlan vtep:1.0.1.1->1.0.1.2,
vni:30000
Display the result on Switch2:
Switch# show ip route vrf tenant
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
Dc - DHCP Client
[*] - [AD/Metric]
* - candidate default
S 2.2.2.1/32 is in overlay remote vxlan vtep:1.0.1.2->1.0.1.1,
vni:20000
S 3.3.3.1/32 is in overlay remote vxlan vtep:1.0.1.2->1.0.1.1,
vni:30000
Configuring VXLAN Distributed Routing by EBGP EVPN
In the following example, VM-1 & VM-2 are encapsulated in same vni to make up the distributed route via vxlan by EBGP EVPN for sending vxlan tunnel and host information;
The following configuration should be operated on all switches if the switch ID is not specified.
step 1 Enter the configure mode
Switch# configure terminal
step 2 Enter the vlan configure mode and create vlan, enable overlay for each vlan
Switch(config)# vlan database
Switch(config-vlan)# vlan 10, 20
Switch(config-vlan)# vlan 10 overlay enable
Switch(config-vlan)# exit
option: enable arp broadcast suppress for vlan
Switch(config-vlan)# vlan 10 arp-broadcast-suppress enable
step 3 Create vlan mapping vni for vxlan
Switch(config)# overlay
Switch(config-overlay)# vlan 10 vni 10000
Switch(config-vlan)# exit
option: Disable inner fdb learning for overlay
Switch(config-overlay)# vlan 10 mac-address-tunnel learning-disable
step 4 Create evpn instance
Switch(config)# evpn
Switch(config-evpn)# vni 10000
Switch(config-evi)# rd auto
Switch(config-evi)# route-target both 1:10000
Switch(config-evi)# exit
step 5 Create a vrf instance, and enable EVPN
Configuring Switch1:
Switch1(config)# ip vrf tenant
Switch1(config-vrf)# rd 1:20000
Switch1(config-vrf)# route-target both 1:10000 evpn
Switch1(config-vrf)# vxlan vni 20000
Switch1(config-vrf)# exit
Configuring Switch2:
Switch2(config)# ip vrf tenant
Switch2(config-vrf)# rd 2:20000
Switch2(config-vrf)# route-target both 1:10000 evpn
Switch2(config-vrf)# vxlan vni 20000
Switch2(config-vrf)# exit
step 6 Create the layer 3 interface set the ip address and enable distributed gateway
Configuring Switch1:
Switch1(config)# interface vlan 10
Switch1(config-if)# ip vrf forwarding tenant
Switch1(config-if)# overlay distributed-gateway enable
Switch1(config-if)# overlay host-collect enable
Switch1(config-if)# ip address 10.1.1.1/24
Switch1(config-if)# exit
Switch1(config)# interface vlan 20
Switch1(config-if)# ip address 20.1.1.1/24
Switch1(config-if)# exit
Configuring Switch2:
Switch2(config)# interface vlan 10
Switch2(config-if)# ip vrf forwarding tenant
Switch2(config-if)# overlay distributed-gateway enable
Switch2(config-if)# overlay host-collect enable
Switch2(config-if)# ip address 10.1.1.2/24
Switch2(config-if)# exit
Switch2(config)# interface vlan 20
Switch2(config-if)# ip address 20.1.1.2/24
Switch2(config-if)# exit
step 7 Enter the interface configure mode and set the attributes of the interface
Switch(config)# interface eth-0-1
Switch(config-if)# switchport access vlan 10
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# interface eth-0-9
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan add 20
Switch(config-if)# vxlan uplink enable
Switch(config-if)# no shutdown
Switch(config-if)# exit
Step 8 Create NVE
Configuring Switch1:
Switch1(config)# interface loopback 1
Switch1(config-if)# ip address 1.1.1.1/32
Switch1(config-if)# exit
Switch1(config)# interface nve 1
Switch1(config-if)# source loopback 1
Switch1(config-if)# member vni 10000
Switch1(config-if)# member vni 20000 associate-vrf
Switch1(config-if)# exit
Configuring Switch2:
Switch2(config)# interface loopback 1
Switch2(config-if)# ip address 2.2.2.2/32
Switch2(config-if)# exit
Switch2(config)# interface nve 1
Switch2(config-if)# source loopback 1
Switch2(config-if)# member vni 10000
Switch2(config-if)# member vni 20000 associate-vrf
Switch2(config-if)# exit
option: configure the attribute of EVPN tunnel
Switch(config-if)# keep-vlan-tag enable
Switch(config-if)# split-horizon disable
Switch(config-if)# encapsulation-dscp-strategy custom-assign 63
Switch(config-if)# virtual-mac a.a.a
Step 9 Create BGP EVPN
Configuring Switch1:
Switch1(config)# router bgp 100
Switch1(config-router)# neighbor 20.1.1.2 remote-as 200
Switch1(config-router)# address-family l2vpn evpn
Switch1(config-router-af)# neighbor 20.1.1.2 activate
Switch1(config-router-af)# neighbor 20.1.1.2 send-community extended
Switch1(config-router-af)# neighbor 20.1.1.2 attribute-unchanged next-hop
Switch1(config-router-af)# exit
Switch1(config-router)# exit
Configuring Switch2:
Switch2(config)# router bgp 200
Switch2(config-router)# neighbor 20.1.1.1 remote-as 100
Switch2(config-router)# address-family l2vpn evpn
Switch2(config-router-af)# neighbor 20.1.1.1 activate
Switch2(config-router-af)# neighbor 20.1.1.1 send-community extended
Switch2(config-router-af)# neighbor 20.1.1.1 attribute-unchanged next-hop
Switch2(config-router-af)# exit
Switch2(config-router)# exit
step 10 Create a static routes
Configuring Switch1:
Switch1(config)# ip route 2.2.2.2/32 20.1.1.2
Configuring Switch2:
Switch(config2)# ip route 1.1.1.1/32 20.1.1.1
step 11 Exit the configure mode
Switch(config)# end
step 12 Validation
Display the result on Switch1:
Switch1# show bgp evpn all
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 1:10000 (L2VNI 10000)
*> [2]:[0]:[48]:[4623.28ef.da00]:[32]:[0.0.0.0]/136
1.1.1.1 32768 i
*> [2]:[0]:[48]:[4623.28ef.da00]:[32]:[10.1.1.3]/136
1.1.1.1 32768 i
*> [2]:[0]:[48]:[ac7f.1cc5.fe00]:[32]:[0.0.0.0]/136
2.2.2.2 0 200 i
*> [2]:[0]:[48]:[ac7f.1cc5.fe00]:[32]:[10.1.1.4]/136
2.2.2.2 0 200 i
*> [3]:[0]:[32]:[1.1.1.1]/80
1.1.1.1 32768 i
*> [3]:[0]:[32]:[10.20.30.40]/80
2.2.2.2 0 200 i
Route Distinguisher: 1:10000
*> [2]:[0]:[48]:[ac7f.1cc5.fe00]:[32]:[0.0.0.0]/136
2.2.2.2 0 200 i
*> [2]:[0]:[48]:[ac7f.1cc5.fe00]:[32]:[10.1.1.4]/136
2.2.2.2 0 200 i
*> [3]:[0]:[32]:[2.2.2.2]/80
2.2.2.2 0 200 i
Route Distinguisher: 1:20000 (L3VNI 20000)
*> [2]:[0]:[48]:[ac7f.1cc5.fe00]:[32]:[10.1.1.4]/136
2.2.2.2
Switch1# show overlay tunnel
-------------------------------------------------------
Vlan Vni Type Remote-vtep IP-Address Src-Address Head-end-flooding Protocol
10 10000 VxLAN 0 2.2.2.2 1.1.1.1 Enable Evpn
Display the result on Switch2:
Head-end-floodingSwitch2 show bgp evpn all
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 1:10000 (L2VNI 10000)
*> [2]:[0]:[48]:[4623.28ef.da00]:[32]:[0.0.0.0]/136
1.1.1.1 0 100 i
*> [2]:[0]:[48]:[4623.28ef.da00]:[32]:[10.1.1.3]/136
1.1.1.1 0 100 i
*> [2]:[0]:[48]:[ac7f.1cc5.fe00]:[32]:[0.0.0.0]/136
2.2.2.2 32768 i
*> [2]:[0]:[48]:[ac7f.1cc5.fe00]:[32]:[10.1.1.4]/136
2.2.2.2 32768 i
*> [3]:[0]:[32]:[1.1.1.1]/80
1.1.1.1 0 100 i
*> [3]:[0]:[32]:[2.2.2.2]/80
2.2.2.2 32768 i
Route Distinguisher: 1:10000
*> [2]:[0]:[48]:[4623.28ef.da00]:[32]:[0.0.0.0]/136
1.1.1.1 0 100 i
*> [2]:[0]:[48]:[4623.28ef.da00]:[32]:[10.1.1.3]/136
1.1.1.1 0 100 i
*> [3]:[0]:[32]:[1.1.1.1]/80
1.1.1.1 0 100 i
Route Distinguisher: 2:20000 (L3VNI 20000)
*> [2]:[0]:[48]:[4623.28ef.da00]:[32]:[10.1.1.3]/136
1.1.1.1 0 100 i
Switch2# show overlay tunnel
-------------------------------------------------------
```console
Vlan Vni Type Remote-vtep IP-Address Src-Address Head-end-flooding
Protocol
10 10000 VxLAN 0 1.1.1.1 2.2.2.2 Enable Evpn
Configuring VXLAN Distributed Routing by IBGP EVPN
In the following example, VM-1 & VM-2 are encapsulated in same vni to make up the distributed route via vxlan by IBGP EVPN for sending vxlan tunnel and host information;EVPN route is exchanged by bgp route reflector.
The following configuration should be operated on all switches if the switch ID is not specified.
step 1 Enter the configure mode
Switch# configure terminal
step 2 Enter the vlan configure mode and create vlan, enable overlay for each vlan
Configuring Switch1:
Switch1(config)# vlan database
Switch1(config-vlan)# vlan 10, 20
Switch1(config-vlan)# vlan 10 overlay enable
Switch1(config-vlan)# exit
Configuring Switch2:
Switch2(config)# vlan database
Switch2(config-vlan)# vlan 20, 30
Switch2(config-vlan)# exit
Configuring Switch3:
Switch3(config)# vlan database
Switch3(config-vlan)# vlan 10, 30
Switch3(config-vlan)# vlan 10 overlay enable
Switch3(config-vlan)# exit
option: enable arp broadcast suppress for vlan
Switch(config-vlan)# vlan 10 arp-broadcast-suppress enable
step 3 Create vlan mapping vni for vxlan
Configuring Switch1:
Switch1(config)# overlay
Switch1(config-overlay)# vlan 10 vni 10000
Switch1(config-vlan)# exit
option: Disable inner fdb learning for overlay
Switch1(config-overlay) vlan 10 mac-address-tunnel learning-disable
Configuring Switch3:
Switch3(config)# overlay
Switch3(config-overlay)# vlan 10 vni 10000
Switch3(config-vlan)# exit
option: Disable inner fdb learning for overlay
Switch3(config-overlay)# vlan 10 mac-address-tunnel learning-disable
step 4 Create evpn instance
Configuring Switch1:
Switch1(config)# evpn
Switch1(config-evpn)# vni 10000
Switch1(config-evi)# rd 2:2
Switch1(config-evi)# route-target both 20:20
Switch1(config-evi)# exit
Configuring Switch2:
Switch2(config)# evpn
Configuring Switch3:
Switch3(config)# evpn
Switch3(config-evpn)# vni 10000
Switch3(config-evi)# rd 4:4
Switch3(config-evi)# route-target both 20:20
Switch3(config-evi)# exit
step 5 Create a vrf instance, and enable EVPN
Configuring Switch1:
Switch1(config)# ip vrf tenant
Switch1(config-vrf)# rd 22:22
Switch1(config-vrf)# route-target both 20:20 evpn
Switch1(config-vrf)# vxlan vni 20000
Switch1(config-vrf)# exit
Configuring Switch3:
Switch3(config)# ip vrf tenant
Switch3(config-vrf)# rd 44:44
Switch3(config-vrf)# route-target both 20:20 evpn
Switch3(config-vrf)# vxlan vni 20000
Switch3(config-vrf)# exit
step 6 Create the layer 3 interface set the ip address and enable distributed gateway
Configuring Switch1:
Switch1(config)# interface vlan 10
Switch1(config-if)# ip vrf forwarding tenant
Switch1(config-if)# overlay distributed-gateway enable
Switch1(config-if)# overlay host-collect enable
Switch1(config-if)# ip address 10.1.1.2/24
Switch1(config-if)# exit
Switch1(config)# interface vlan 20
Switch1(config-if)# ip address 20.1.1.1/24
Switch1(config-if)# exit
Configuring Switch2:
Switch2(config)# interface vlan 20
Switch2(config-if)# ip address 20.1.1.2/24
Switch2(config-if)# exit
Switch2(config)# interface vlan 30
Switch2(config-if)# ip address 30.1.1.1/24
Switch2(config-if)# exit
Configuring Switch3:
Switch3(config)# interface vlan 10
Switch3(config-if)# ip vrf forwarding tenant
Switch3(config-if)# overlay distributed-gateway enable
Switch3(config-if)# overlay host-collect enable
Switch3(config-if)# ip address 10.1.1.3/24
Switch3(config-if)# exit
Switch3(config)# interface vlan 30
Switch3(config-if)# ip address 30.1.1.2/24
Switch3(config-if)# exit
step 7 Enter the interface configure mode and set the attributes of the interface
Configuring Switch1:
Switch1(config)# interface eth-0-10
Switch1(config-if)# switchport access vlan 10
Switch1(config-if)# no shutdown
Switch1(config-if)# exit
Switch1(config)# interface eth-0-20
Switch1(config-if)# switchport mode trunk
Switch1(config-if)# switchport trunk allowed vlan add 20
Switch1(config-if)# vxlan uplink enable
Switch1(config-if)# no shutdown
Switch1(config-if)# exit
Configuring Switch2:
Switch2(config)# interface eth-0-20
Switch2(config-if)# switchport mode trunk
Switch2(config-if)# switchport trunk allowed vlan add 20
Switch2(config-if)# vxlan uplink enable
Switch2(config-if)# no shutdown
Switch2(config-if)# exit
Switch2(config)# interface eth-0-30
Switch2(config-if)# switchport mode trunk
Switch2(config-if)# switchport trunk allowed vlan add 30
Switch2(config-if)# vxlan uplink enable
Switch2(config-if)# no shutdown
Switch2(config-if)# exit
Configuring Switch3:
Switch3(config)# interface eth-0-10
Switch3(config-if)# switchport access vlan 10
Switch3(config-if)# no shutdown
Switch3(config-if)# exit
Switch3(config)# interface eth-0-30
Switch3(config-if)# switchport mode trunk
Switch3(config-if)# switchport trunk allowed vlan add 30
Switch3(config-if)# vxlan uplink enable
Switch3(config-if)# no shutdown
Switch3(config-if)# exit
Step 8 Create NVE
Configuring Switch1:
Switch1(config)# interface loopback 2
Switch1(config-if)# ip address 2.2.2.2/32
Switch1(config-if)# exit
Switch1(config)# interface nve 1
Switch1(config-if)# source 2.2.2.2
Switch1(config-if)# member vni 10000
Switch1(config-if)# member vni 20000 associate-vrf
Switch1(config-if)# exit
Configuring Switch2:
Switch2(config)# interface loopback 3
Switch2(config-if)# ip address 3.3.3.3/32
Switch2(config-if)# exit
Configuring Switch3:
Switch3(config)# interface loopback 4
Switch3(config-if)# ip address 4.4.4.4/32
Switch3(config-if)# exit
Switch3(config)# interface nve 1
Switch3(config-if)# source 4.4.4.4
Switch3(config-if)# member vni 10000
Switch3(config-if)# member vni 20000 associate-vrf
Switch3(config-if)# exit
option: configure the attribute of EVPN tunnel
Switch(config-if)# keep-vlan-tag enable
Switch(config-if)# split-horizon disable
Switch(config-if)# encapsulation-dscp-strategy custom-assign 63
Switch(config-if)# virtual-mac a.a.a
Step 9 Create BGP EVPN
Configuring Switch1:
Switch1(config)# router bgp 100
Switch1(config-router)# neighbor 3.3.3.3 remote-as 100
Switch1(config-router)# neighbor 3.3.3.3 update-source loopback2
Switch1(config-router)# neighbor 20.1.1.2 remote-as 100
Switch1(config-router)# address-family ipv4
Switch1(config-router-af)# network 2.2.2.2 mask 255.255.255.255
Switch1(config-router-af)# neighbor 20.1.1.2 weight 32768
Switch1(config-router-af)# exit
Switch1(config-router)# address-family l2vpn evpn
Switch1(config-router-af)# neighbor 3.3.3.3 activate
Switch1(config-router-af)# neighbor 3.3.3.3 send-community extended
Switch1(config-router-af)# exit
Switch1(config-router)# exit
Configuring Switch2:
Switch2(config)# router bgp 100
Switch2(config-router)# neighbor 2.2.2.2 remote-as 100
Switch2(config-router)# neighbor 2.2.2.2 update-source loopback3
Switch2(config-router)# neighbor 4.4.4.4 remote-as 100
Switch2(config-router)# neighbor 4.4.4.4 update-source loopback3
Switch2(config-router)# neighbor 20.1.1.1 remote-as 100
Switch2(config-router)# neighbor 30.1.1.2 remote-as 100
Switch2(config-router)# address-family ipv4
Switch2(config-router-af)# network 3.3.3.3 mask 255.255.255.255
Switch2(config-router-af)# network 20.1.1.0 mask 255.255.255.0
Switch2(config-router-af)# network 30.1.1.0 mask 255.255.255.0
Switch2(config-router-af)# neighbor 20.1.1.1 weight 32768
Switch2(config-router-af)# neighbor 20.1.1.1 route-reflector-client
Switch2(config-router-af)# neighbor 20.1.1.1 next-hop-self
Switch2(config-router-af)# neighbor 30.1.1.2 weight 32768
Switch2(config-router-af)# neighbor 30.1.1.2 route-reflector-client
Switch2(config-router-af)# neighbor 30.1.1.2 next-hop-self
Switch2(config-router-af)# exit
Switch2(config-router)# address-family l2vpn evpn
Switch2(config-router-af)# neighbor 2.2.2.2 activate
Switch2(config-router-af)# neighbor 2.2.2.2 route-reflector-client
Switch2(config-router-af)# neighbor 2.2.2.2 send-community extended
Switch2(config-router-af)# neighbor 4.4.4.4 activate
Switch2(config-router-af)# neighbor 4.4.4.4 route-reflector-client
Switch2(config-router-af)# neighbor 4.4.4.4 send-community extended
Switch2(config-router-af)# exit
Switch2(config-router)# exit
Configuring Switch3:
Switch3(config)# router bgp 100
Switch3(config-router)# neighbor 3.3.3.3 remote-as 100
Switch3(config-router)# neighbor 3.3.3.3 update-source loopback4
Switch3(config-router)# neighbor 30.1.1.1 remote-as 100
Switch3(config-router)# address-family ipv4
Switch3(config-router-af)# network 4.4.4.4 mask 255.255.255.255
Switch3(config-router-af)# neighbor 30.1.1.1 weight 32768
Switch3(config-router-af)# exit
Switch3(config-router)# address-family l2vpn evpn
Switch3(config-router-af)# neighbor 3.3.3.3 activate
Switch3(config-router-af)# neighbor 3.3.3.3 send-community extended
Switch3(config-router-af)# exit
Switch3(config-router)# exit
step 10 Exit the configure mode
Switch(config)# end
step 11 Validation
Display the result on Switch1:
Switch1# show bgp evpn all
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 2:2 (L2VNI 10000)
*> [2]:[0]:[48]:[988b.123a.4000]:[32]:[0.0.0.0]/136
2.2.2.2 32768 i
*> [2]:[0]:[48]:[988b.123a.4000]:[32]:[10.1.1.1]/136
2.2.2.2 32768 i
*> [3]:[0]:[32]:[2.2.2.2]/80
2.2.2.2 32768 i
*>i[3]:[0]:[32]:[4.4.4.4]/80
4.4.4.4 100 0 i
Route Distinguisher: 4:4
*>i[3]:[0]:[32]:[4.4.4.4]/80
4.4.4.4 100 0 i
Switch1# show overlay tunnel
------------------------------------------------------
Vlan Vni Type Remote-vtep IP-Address Src-Address Head-end-flooding Protocol
10 10000 VxLAN 0 4.4.4.4 2.2.2.2 Enable Evpn
Display the result on Switch2:
Switch2# show bgp evpn all
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 2:2
*>i[2]:[0]:[48]:[988b.123a.4000]:[32]:[0.0.0.0]/136
2.2.2.2 100 0 i
*>i[2]:[0]:[48]:[988b.123a.4000]:[32]:[10.1.1.1]/136
2.2.2.2 100 0 i
*>i[3]:[0]:[32]:[2.2.2.2]/80
2.2.2.2 100 0 i
Route Distinguisher: 4:4
*>i[3]:[0]:[32]:[4.4.4.4]/80
4.4.4.4 100 0 i
Display the result on Switch3:
Switch3# show bgp evpn all
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 2:2
*>i[2]:[0]:[48]:[988b.123a.4000]:[32]:[0.0.0.0]/136
2.2.2.2 100 0 i
*>i[2]:[0]:[48]:[988b.123a.4000]:[32]:[10.1.1.1]/136
2.2.2.2 100 0 i
*>i[3]:[0]:[32]:[2.2.2.2]/80
2.2.2.2 100 0 i
Route Distinguisher: 4:4 (L2VNI 10000)
*>i[2]:[0]:[48]:[988b.123a.4000]:[32]:[0.0.0.0]/136
2.2.2.2 100 0 i
*>i[2]:[0]:[48]:[988b.123a.4000]:[32]:[10.1.1.1]/136
2.2.2.2 100 0 i
*>i[3]:[0]:[32]:[2.2.2.2]/80
2.2.2.2 100 0 i
*> [3]:[0]:[32]:[4.4.4.4]/80
4.4.4.4 32768 i
Route Distinguisher: 44:44 (L3VNI 20000)
*>i[2]:[0]:[48]:[988b.123a.4000]:[32]:[10.1.1.1]/136
2.2.2.2 100 0 i
Switch3# show overlay tunnel
-------------------------------------------------------
Vlan Vni Type Remote-vtep IP-Address Src-Address Head-end-flooding
Protocol
10 10000 VxLAN 0 2.2.2.2 4.4.4.4 Enable Evpn
Switch3# show mac address-table
Mac Address Table
-------------------------------------------
(*) - Security Entry (M) - MLAG Entry
(MO) - MLAG Output Entry (MI) - MLAG Input Entry
Vlan Mac Address Type Ports
---- ----------- ---- -----
30 fcc0.9318.0a00 dynamic eth-0-9
10 988b.123a.4000 dynamic VxLAN: 4.4.4.4->2.2.2.2(EI)
Switch3# show ip route vrf tenant
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
Dc - DHCP Client
[*] - [AD/Metric]
* - candidate default
C 10.1.1.0/24 is directly connected, vlan10
C 10.1.1.3/32 is in local loopback, vlan10
B 10.1.1.1/32 is in overlay remote vxlan vtep:4.4.4.4->2.2.2.2, vni:20000