CÔNG TY TNHH CÔNG NGHỆ VIỆT THÁI DƯƠNG
Logo CNTTShop.vn

NTT03, Line 1, Thống Nhất Complex, Thanh Xuân, Hà Nội.
Danh mục sản phẩm

Configure BGP EVPN VXLAN to Realize L2 Intercommunication

Network Requirements

  • Leaf1 and leaf2 serve as VTEP to create the VXLAN instance.
  • Leaf1 and Leaf 2 create the BGP EVPN VXLAN tunnel, realizing the intercommunication of Server1 and Server2 in the same segment.

Network Topology

Networking of configuring BGP EVPN VXLAN to realize L2 intercommunication

Figure 1-2 Networking of configuring BGP EVPN VXLAN to realize L2 intercommunication

Configuration Steps

Step 1: Configure VLAN, and add the ports to the corresponding VLAN (omitted).

Step 2: Configure the IP address of the interface.

#Configure Leaf1.

Leaf1(config)#interface loopback 0
Leaf1(config-if-loopback0)#ip address 10.0.0.1 255.255.255.255
Leaf1(config-if-loopback0)#exit
Leaf1(config)#interface vlan 3
Leaf1(config-if-vlan3)#ip address 2.0.0.1 255.255.255.0
Leaf1(config-if-vlan3)#exit

#Configure Leaf2.

Leaf2(config)#interface loopback 0
Leaf2(config-if-loopback0)#ip address 20.0.0.1 255.255.255.255
Leaf2(config-if-loopback0)#exit
Leaf2(config)#interface vlan 3
Leaf2(config-if-vlan3)#ip address 2.0.0.2 255.255.255.0
Leaf2(config-if-vlan3)#exit

Step 3: Configure OSPF, making the Loopback route between devices reachable.

#Configure Leaf1.

Leaf1#configure terminal
Leaf1(config)#router ospf 100
Leaf1(config-ospf)#network 10.0.0.1 0.0.0.0 area 0
Leaf1(config-ospf)#network 2.0.0.0 0.0.0.255 area 0
Leaf1(config-ospf)#exit

#Configure Leaf2.

Leaf2#configure terminal
Leaf2(config)#router ospf 100
Leaf2(config-ospf)#network 20.0.0.1 0.0.0.0 area 0
Leaf2(config-ospf)#network 2.0.0.0 0.0.0.255 area 0
Leaf2(config-ospf)#exit

#View the route table of Leaf1.

Leaf1#show ip route 
Codes: C - connected, S - static, R - RIP, O - OSPF, OE-OSPF External, M - Management 
       D - Redirect, E - IRMP, EX - IRMP external, o - SNSP, B - BGP, i-ISIS  
 
Gateway of last resort is not set 
 
C 2.0.0.0/24 is directly connected, 00:05:40, vlan3 
C 127.0.0.0/8 is directly connected, 1d:21:38:36, lo0 
C 10.0.0.1/32 is directly connected, 00:06:34, loopback0
O 20.0.0.1/32 [110/2] via 2.0.0.2, 00:00:05, vlan3

#View the route table of Leaf2.

Leaf2#show ip route 
Codes: C - connected, S - static, R - RIP, O - OSPF, OE-OSPF External, M Management 
       D - Redirect, E - IRMP, EX - IRMP external, o - SNSP, B BGP, i-ISIS  
 
Gateway of last resort is not set 
 
C 2.0.0.0/24 is directly connected, 00:06:43, vlan3 
C 127.0.0.0/8 is directly connected, 1w3d:03:35:57, lo0
O 10.0.0.1/32 [110/2] via 2.0.0.1, 00:02:36, vlan3 
C 20.0.0.1/32 is directly connected, 00:07:07, loopback0

We can see that both leaf1 and leaf2 have learned the route of the peer loopback port by running the OSPF protocol.

Step 4: Configure VXLAN and associate VNID, and configure EVPN address family to add ports of leaf1 and leaf2 to VXLAN.

#Configure Leaf1.

Leaf1(config)# vxlan 100
Leaf1(config-vxlan-100)#vxlan vnid 100
Leaf1(config-vxlan-100)#vxlan internal-vlan vlan 2
Leaf1(config-vxlan-100)#address-family evpn
Leaf1(config-vxlan-evpn)#rd 100:1
Leaf1(config-vxlan-evpn)#route-target both 100:1
Leaf1(config-vxlan-evpn)#exit
Leaf1(config-vxlan-100)#exit

#Configure Leaf2.

Leaf2(config)# vxlan 100
Leaf2(config-vxlan-100)#vxlan vnid 100
Leaf2(config-vxlan-100)#vxlan internal-vlan vlan 2
Leaf2(config-vxlan-100)#address-family evpn
Leaf2(config-vxlan-evpn)#rd 100:1
Leaf2(config-vxlan-evpn)#route-target both 100:1
Leaf2(config-vxlan-evpn)#exit
Leaf2(config-vxlan-100)#exit

#View the VXLAN information of Leaf1.

Leaf1#show vxlan 100 config  
 
vxlan 100 
 vxlan vnid 100 
 vxlan internal-vlan vlan 2
 address-family evpn 
  rd 100:1 
  route-target import 100:1 
  route-target export 100:1 
  exit 
 exit 

#View the VXLAN information of Leaf2.

Leaf2#show vxlan 100 config vxlan 100 
 vxlan vnid 100 
 vxlan internal-vlan vlan 2 
 address-family evpn 
  rd 100:1 
  route-target import 100:1 
  route-target export 100:1 
  exit
 exit

Step 5: Configure BGP.

#Configure Leaf1.

Configure to establish a direct-connected EBGP peer with leaf2, and activate the notification capability under the EBGP address family.

Leaf1(config)#router bgp 100
Leaf1(config-bgp)#neighbor 2.0.0.2 remote-as 200
Leaf1(config-bgp)#address-family l2vpn evpn
Leaf1(config-bgp-af)#neighbor 2.0.0.2 activate
Leaf1(config-bgp-af)#exit-address-family
Leaf1(config-bgp)#exit

#Configure Leaf2.

Configure to establish a direct-connected EBGP peer with leaf2, and activate the notification capability under the EVPN address family.

Leaf2(config)#router bgp 200
Leaf2(config-bgp)#neighbor 2.0.0.1 remote-as 100
Leaf2(config-bgp)#address-family l2vpn evpn
Leaf2(config-bgp-af)#neighbor 2.0.0.1 activate
Leaf2(config-bgp-af)#exit-address-family
Leaf2(config-bgp)#exit

#View the BGP EVPN neighbor of Leaf1.

Leaf1#show bgp l2vpn evpn summary  
BGP router identifier 10.0.0.1, local AS number 100
BGP table version is 5 
1 BGP AS-PATH entries 0
BGP community entries 
 
Neighbor  V  AS    MsgRcvd MsgSent TblVer InQ OutQ Up/Down   State/PfxRcd
2.0.0.2   4  200   52      50      4      0    0   00:42:18  0 
 
Total number of neighbors 1 

#View the BGP EVPN neighbor of Leaf2.

Leaf2#show bgp l2vpn evpn summary  
BGP router identifier 20.0.0.1, local AS number 200
BGP table version is 5 
1 BGP AS-PATH entries 0
BGP community entries 
 
Neighbor  V  AS    MsgRcvd  MsgSent TblVer  InQ  OutQ Up/Down    State/PfxRcd
2.0.0.1   4  100   52       53      5       0    0    00:43:20   0 
 
Total number of neighbors 1

We can see that leaf1 and leaf2 have successfully established BGP EVPN neighbors.

Step 6: Configure the NVE interface.

#Configure the NVE interface of Leaf1 and configure the corresponding VXLAN, and use the BGP protocol to build the L2 tunnel dynamically.

Leaf1(config)#interface nve 1
Leaf1(config-if-nve1)#source 10.0.0.1
Leaf1(config-if-nve1)#vxlan 100 ingress-replication protocol bgp
Leaf1(config-if-nve1)#exit

#Configure the NVE interface of Leaf2 and configure the corresponding VXLAN, and use the BGP protocol to build the L2 tunnel dynamically.

Leaf2(config)#interface nve 1
Leaf2(config-if-nve1)#source 20.0.0.1
Leaf2(config-if-nve1)#vxlan 100 ingress-replication protocol bgp
Leaf2(config-if-nve1)#exit

#View the tunnel information and VXLAN session of Leaf1.

Leaf1# show vxlan tunnel Number of vxlan tunnel: 1
---  --------   ---------  -----------   ------ 
NO.  TunnelID   Source     Destination   State 
---  --------   ---------  -----------   ------      
1    4096       10.0.0.1   20.0.0.1      up          
 
Leaf1#show vxlan session Number of vxlan session: 1
---  ---------  ---------  --------   --------   -----------  ------
NO.  VXLAN-ID   SessionID  TunnelID   Source     Destination  State  
---  ---------  ---------  --------   --------   -----------  ------     
1    100        4096       4096       10.0.0.1   20.0.0.1     up  

#View the tunnel information and VXLAN session of Leaf2.

Leaf2# show vxlan tunnel Number of vxlan tunnel: 1
---  --------   --------   -----------  ------
NO.  TunnelID   Source     Destination  State   
---  --------   --------   -----------  ------    
1    4096       20.0.0.1   10.0.0.1     up    
 
Leaf2#show vxlan session Number of vxlan session: 1 
---  --------   ---------  --------   --------   -----------  ------
NO.  VXLAN-ID   SessionID  TunnelID   Source     Destination  State 
---  --------   ---------  --------   --------   -----------  ------      
1    100        4096       4096       20.0.0.1   10.0.0.1     up 

From the above information, we can see that the tunnel is up, and the dynamic VXLAN multicast session between Leaf1 and Leaf2 can be established normally. So far, the L2 BUM traffic can be forwarded between Leaf1 and Leaf2.

Step 7: VM1 of Server1 and VM1 od Server ping the different addresses of different segment resptively, and view the VXLAN session of Leaf1 and Leaf2.

#View the VXLAN session of Leaf1.

Leaf1#show vxlan session 4096        
 vxlan session 4096 
  tunnel state: up 
  source IP: 10.0.0.1 
  destination IP: 20.0.0.1 
  source mac: 0001.7a00.5278 
  destination mac: 0001.7a21.81e7 
  vlan: 3 
  control interface: interface tengigabitethernet0/2 
  vxlan list: 100 
  vxlan unicast list: 100 
  vxlan multicast list: 100

#View the VXLAN session of Leaf2.

Leaf2#show vxlan session 4096 
 vxlan session 4096 
  tunnel state: up 
  source IP: 20.0.0.1 
  destination IP: 10.0.0.1 
  source mac: 0001.7a21.81e7 
  destination mac: 0001.7a00.5278 
  vlan: 3 
  control interface: interface tengigabitethernet0/2 
  vxlan list: 100 
  vxlan unicast list: 100 
  vxlan multicast list: 100

It can be seen that dynamic unicast sessions have been established and the L2 unicast traffic can be forwarded.

Step 8: Check the result

#VM1 of Server1 pings VM1 of Server2.

C:\Documents and Settings\ Server 1> ping 1.0.0.2 
 
Pinging 1.0.0.2 with 32 bytes of data: 
 
Reply from 1.0.0.2: bytes=32 time<1ms TTL=255
Reply from 1.0.0.2: bytes=32 time<1ms TTL=255
Reply from 1.0.0.2: bytes=32 time<1ms TTL=255
Reply from 1.0.0.2: bytes=32 time<1ms TTL=255 
 
Ping statistics for 1.0.0.2: 
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0m 

You can see that Server1 and Server2 can cross the L3 network between Leaf1 and Leaf2 to realize the intercommunication.

note


  • BGP EVPN supports IBGP and EBGP.
  • After BGP enables the EVPN VXLAN capability, the BGP neighbor will be re-set up automatically.