This guide shows how to configure a Spine-Leaf topology using Asymmetric Integrated Routing and Bridging (IRB) Ethernet VPN (EVPN), with SONiC leaves and Cisco Nexus 9000v spines. The SONiC leaves exchange EVPN routes and terminate the VXLAN tunnels, while the Cisco spines provide IPv4 underlay routing. It covers VLAN setup, IP address configuration, VxLAN creation, and BGP establishment for EVPN.
In our previous article, "Spine-Leaf Topology with Asymmetric IRB EVPN in SONiC," we thoroughly explained the Spine-Leaf architecture and its significance in modern data center environments.
These results come from virtual switches in GNS3 and show selected bridged and routed ICMP traffic. They do not demonstrate hardware forwarding, traffic performance, ARP or ND suppression, multihoming or failover.
The Cisco spines exchange no EVPN routes and terminate no VXLAN tunnels, so the lab does not test EVPN or VXLAN interoperability between SONiC and Cisco. The gateways use a different IP address on each leaf, so the lab does not test a distributed anycast gateway. Before production use, test the design on the intended hardware and software releases.
Testbed & NOS Version
- GNS3
- SONiC 202311 (build SONiC.202311.528792-c609af64d)
- Cisco Nexus 9000v running NX-OS 9.2(3)
The figures below display the versions of SONiC and Cisco, respectively.
Topology
Steps to Configure Asymmetric IRB EVPN Fabric
- Set Up VLAN Environment
- Configure IP addresses
- Create VxLAN
- Establish BGP environment for EVPN
Note: The above steps are only for Leaf switches. For Spine switches there is no need to create VLANs and VxLAN.
SONiC Switches
The leaf layer is composed of SONiC switches.
Use clean lab switches, and configure the host addresses and gateways shown in the topology. The sonic# commands in Step 4 run in the FRR shell, so enter sudo vtysh from the SONiC shell first.
The no router bgp 65100 line removes an existing BGP instance with AS 65100 and all of its settings. Run it only if the switch has that instance from an earlier configuration.
The wr command at the end of Step 4 saves the FRR configuration files. It does not change Config DB, and sudo config save -y does not copy these FRR settings into Config DB.
Check docker_routing_config_mode before you restart the BGP container or reload a leaf. In SONiC 202311, the separated and unified modes rebuild the FRR files from Config DB when the BGP container starts, which replaces the FRR settings made here. The split mode reuses the saved per-daemon files, and the split-unified mode reuses a saved frr.conf file.
Configurations on LEAF-1:
Step 1. Set up VLAN environment as per topology.
admin@sonic:~$ sudo config vlan add 10
admin@sonic:~$ sudo config vlan add 20
admin@sonic:~$ sudo config vlan member add -u 10 Ethernet8
admin@sonic:~$ sudo config vlan member add -u 20 Ethernet12
Step 2. Configure IP addresses.
admin@sonic:~$ sudo config interface ip add Ethernet0 192.168.11.1/24
admin@sonic:~$ sudo config interface ip add Ethernet4 192.168.12.1/24
admin@sonic:~$ sudo config interface ip add Loopback10 1.1.1.1/32
admin@sonic:~$ sudo config interface ip add Vlan10 192.168.10.254/24
admin@sonic:~$ sudo config interface ip add Vlan20 192.168.17.254/24
Below is the status of the VLAN table.
Step 3. Create VxLAN
admin@sonic:~$ sudo config vxlan add vtep 1.1.1.1
admin@sonic:~$ sudo config vxlan evpn_nvo add nvo vtep
admin@sonic:~$ sudo config vxlan map add vtep 10 10
admin@sonic:~$ sudo config vxlan map add vtep 20 20
admin@sonic:~$ sudo config save -y
Below is the status of the VxLAN Tunnel.
The output below shows the VTEP with source IP 1.1.1.1, its NVO and the source interface Loopback10. The first command fails because the valid command is show vxlan interface, in the singular.
Step 4. Establish a BGP environment for EVPN
sonic# configure
sonic(config)# no router bgp 65100
sonic(config)# router bgp 65000
sonic(config-router)# bgp router-id 1.1.1.1
sonic(config-router)# bgp bestpath as-path multipath-relax
sonic(config-router)# neighbor 192.168.11.2 remote-as 65000
sonic(config-router)# neighbor 192.168.12.2 remote-as 65000
sonic(config-router)# neighbor 192.168.13.1 remote-as 65000
sonic(config-router)# neighbor 192.168.15.1 remote-as 65000
sonic(config-router)# neighbor 192.168.14.1 remote-as 65000
sonic(config-router)# neighbor 192.168.16.1 remote-as 65000
sonic(config-router)# neighbor 192.168.13.1 update-source 192.168.11.1
sonic(config-router)# neighbor 192.168.15.1 update-source 192.168.12.1
sonic(config-router)# neighbor 192.168.14.1 update-source 192.168.11.1
sonic(config-router)# neighbor 192.168.16.1 update-source 192.168.12.1
sonic(config-router)# address-family ipv4
sonic(config-router-af)# network 1.1.1.1/32
sonic(config-router-af)# exit
sonic(config-router)# address-family l2vpn evpn
sonic(config-router-af)# neighbor 192.168.13.1 activate
sonic(config-router-af)# neighbor 192.168.15.1 activate
sonic(config-router-af)# neighbor 192.168.14.1 activate
sonic(config-router-af)# neighbor 192.168.16.1 activate
sonic(config-router-af)# advertise-all-vni
sonic(config-router-af)# end
sonic# wr
Configurations on LEAF-2:
Step 4. Establish a BGP environment for EVPN.
sonic# configure
sonic(config)# no router bgp 65100
sonic(config)# router bgp 65000
sonic(config-router)# bgp router-id 2.2.2.2
sonic(config-router)# bgp bestpath as-path multipath-relax
sonic(config-router)# neighbor 192.168.13.2 remote-as 65000
sonic(config-router)# neighbor 192.168.15.2 remote-as 65000
sonic(config-router)# neighbor 192.168.11.1 remote-as 65000
sonic(config-router)# neighbor 192.168.12.1 remote-as 65000
sonic(config-router)# neighbor 192.168.14.1 remote-as 65000
sonic(config-router)# neighbor 192.168.16.1 remote-as 65000
sonic(config-router)# neighbor 192.168.11.1 update-source 192.168.13.1
sonic(config-router)# neighbor 192.168.12.1 update-source 192.168.15.1
sonic(config-router)# neighbor 192.168.14.1 update-source 192.168.13.1
sonic(config-router)# neighbor 192.168.16.1 update-source 192.168.15.1
sonic(config-router)# address-family ipv4
sonic(config-router-af)# network 2.2.2.2/32
sonic(config-router-af)# exit
sonic(config-router)# address-family l2vpn evpn
sonic(config-router-af)# neighbor 192.168.11.1 activate
sonic(config-router-af)# neighbor 192.168.12.1 activate
sonic(config-router-af)# neighbor 192.168.14.1 activate
sonic(config-router-af)# neighbor 192.168.16.1 activate
sonic(config-router-af)# advertise-all-vni
sonic(config-router-af)# end
sonic# wr
Configurations on LEAF-3:
Step 4. Establish a BGP environment for EVPN.
sonic# configure
sonic(config)# no router bgp 65100
sonic(config)# router bgp 65000
sonic(config-router)# bgp router-id 3.3.3.3
sonic(config-router)# bgp bestpath as-path multipath-relax
sonic(config-router)# neighbor 192.168.14.2 remote-as 65000
sonic(config-router)# neighbor 192.168.16.2 remote-as 65000
sonic(config-router)# neighbor 192.168.11.1 remote-as 65000
sonic(config-router)# neighbor 192.168.12.1 remote-as 65000
sonic(config-router)# neighbor 192.168.13.1 remote-as 65000
sonic(config-router)# neighbor 192.168.15.1 remote-as 65000
sonic(config-router)# neighbor 192.168.11.1 update-source 192.168.14.1
sonic(config-router)# neighbor 192.168.12.1 update-source 192.168.16.1
sonic(config-router)# neighbor 192.168.13.1 update-source 192.168.14.1
sonic(config-router)# neighbor 192.168.15.1 update-source 192.168.16.1
sonic(config-router)# address-family ipv4
sonic(config-router-af)# network 3.3.3.3/32
sonic(config-router-af)# exit
sonic(config-router)# address-family l2vpn evpn
sonic(config-router-af)# neighbor 192.168.11.1 activate
sonic(config-router-af)# neighbor 192.168.12.1 activate
sonic(config-router-af)# neighbor 192.168.13.1 activate
sonic(config-router-af)# neighbor 192.168.15.1 activate
sonic(config-router-af)# advertise-all-vni
sonic(config-router-af)# end
sonic# wr
Cisco Switches
The Spine Layer is composed of Cisco switches.
Configurations on SPINE-1:
In this lab, the spines reflect IPv4 unicast routes between the leaves. EVPN routes travel directly between the SONiC leaves in a full iBGP mesh, with two sessions between each pair of leaves.
Step 1. Configure IP addresses.
switch(config-if)# interface e1/1
switch(config-if)# no switchport
switch(config-if)# ip address 192.168.11.2 255.255.255.0
switch(config-if)# no shutdown
switch(config-if)# interface e1/2
switch(config-if)# no switchport
switch(config-if)# ip address 192.168.13.2 255.255.255.0
switch(config-if)# no shutdown
switch(config-if)# interface e1/3
switch(config-if)# no switchport
switch(config-if)# ip address 192.168.14.2 255.255.255.0
switch(config-if)# no shutdown
Step 2. Configure IPv4 unicast BGP route reflection.
These spines use BGP only for IPv4 unicast route reflection, and they forward the outer IP packets of the VXLAN traffic. Apart from feature bgp, the feature commands and nv overlay evpn below are not required for this role.
switch(config)# feature bgp
switch(config)# feature vn-segment-vlan-based
switch(config)# feature vn-segment
switch(config)# feature nv overlay
switch(config)# feature interface-vlan
switch(config)# nv overlay evpn
switch(config)# router bgp 65000
switch(config-router)# bestpath as-path multipath-relax
switch(config-router)# neighbor 192.168.11.1 remote-as 65000
switch(config-router-neighbor)# address-family ipv4 unicast
switch(config-router-neighbor-af)# route-reflector-client
switch(config-router-neighbor-af)# exit
switch(config-router-neighbor)# exit
switch(config-router)# neighbor 192.168.13.1 remote-as 65000
switch(config-router-neighbor)# address-family ipv4 unicast
switch(config-router-neighbor-af)# route-reflector-client
switch(config-router-neighbor-af)# exit
switch(config-router-neighbor)# exit
switch(config-router)# neighbor 192.168.14.1 remote-as 65000
switch(config-router-neighbor)# address-family ipv4 unicast
switch(config-router-neighbor-af)# route-reflector-client
switch(config-router-neighbor-af)# exit
switch(config-router-neighbor)# exit
switch(config-router)# address-family ipv4 unicast
switch(config-router-af)# network 192.168.11.0 mask 255.255.255.0
switch(config-router-af)# network 192.168.13.0 mask 255.255.255.0
switch(config-router-af)# network 192.168.14.0 mask 255.255.255.0
switch(config-router-af)# exit
switch(config-router)# exit
switch(config)# exit
switch# copy running-config startup-config
Configurations on SPINE-2:
Step 1. Configure IP addresses.
switch(config-if)# interface e1/1
switch(config-if)# no switchport
switch(config-if)# ip address 192.168.12.2 255.255.255.0
switch(config-if)# no shutdown
switch(config-if)# interface e1/2
switch(config-if)# no switchport
switch(config-if)# ip address 192.168.15.2 255.255.255.0
switch(config-if)# no shutdown
switch(config-if)# interface e1/3
switch(config-if)# no switchport
switch(config-if)# ip address 192.168.16.2 255.255.255.0
switch(config-if)# no shutdown
Step 2. Configure IPv4 unicast BGP route reflection.
switch(config)# feature bgp
switch(config)# feature vn-segment-vlan-based
switch(config)# feature vn-segment
switch(config)# feature nv overlay
switch(config)# feature interface-vlan
switch(config)# nv overlay evpn
switch(config)# router bgp 65000
switch(config-router)# bestpath as-path multipath-relax
switch(config-router)# neighbor 192.168.12.1 remote-as 65000
switch(config-router-neighbor)# address-family ipv4 unicast
switch(config-router-neighbor-af)# route-reflector-client
switch(config-router-neighbor-af)# exit
switch(config-router-neighbor)# exit
switch(config-router)# neighbor 192.168.15.1 remote-as 65000
switch(config-router-neighbor)# address-family ipv4 unicast
switch(config-router-neighbor-af)# route-reflector-client
switch(config-router-neighbor-af)# exit
switch(config-router-neighbor)# exit
switch(config-router)# neighbor 192.168.16.1 remote-as 65000
switch(config-router-neighbor)# address-family ipv4 unicast
switch(config-router-neighbor-af)# route-reflector-client
switch(config-router-neighbor-af)# exit
switch(config-router-neighbor)# exit
switch(config-router)# address-family ipv4 unicast
switch(config-router-af)# network 192.168.12.0 mask 255.255.255.0
switch(config-router-af)# network 192.168.15.0 mask 255.255.255.0
switch(config-router-af)# network 192.168.16.0 mask 255.255.255.0
switch(config-router-af)# exit
switch(config-router)# exit
switch(config)# exit
switch# copy running-config startup-config
Results
The result below shows that LEAF-1 has learned remote VTEPs 2.2.2.2 and 3.3.3.3 through EVPN, with local source IP 1.1.1.1. Both entries show oper_down, as do the LEAF-2 and LEAF-3 results further below, so these outputs do not confirm that the tunnels are operational.
The figures below show the MAC addresses of PC6 and PC3. LEAF-1's VXLAN remote MAC table, shown further below, contains both entries.
Four Hosts are attached on LEAF-2 and LEAF-3 switches. In Asymmetric IRB EVPN, the MAC address of the destination host is learned. The figure below shows that destination MAC addresses of four Hosts have been learned on LEAF-1.
The figure below lists VNI 10 and VNI 20 as L2 VNIs in the default VRF on LEAF-1, with no L3 VNI. This matches the asymmetric IRB design, while the later packet captures and pings show the traffic that was tested.
The figure below shows the BGP summary of LEAF-1. It lists six IPv4 unicast neighbors and four L2VPN EVPN neighbors. The EVPN neighbors are interface addresses on LEAF-2 and LEAF-3, with no spine. The router ID in this output is 192.168.17.254, which differs from the 1.1.1.1 set in Step 4.
The figure below displays the IPv4 routes learned through BGP by LEAF-1, to the remote VTEP loopbacks and the remote link subnets. It does not show the EVPN MAC and IP routes.
The figure below is the result of LEAF-2.
The figure below is the result of LEAF-3.
The figure below shows the established iBGP session between SPINE-1 and LEAF-1 at 192.168.11.1, with AS 65000 on both ends.
Below is the result of routes learned by SPINE-1 through BGP.
The figure displays the result of SPINE-1.
To verify the use of two VNIs in the network, packets were captured using Wireshark. The captures below show echo replies from LEAF-3 to LEAF-1. The reply to PC1 uses VNI 10 for VLAN 10, and the reply to PC2 uses VNI 20 for VLAN 20. In asymmetric IRB, the ingress leaf routes the packet and sends it in the L2VNI of the destination subnet.
PC1
PC1 receives a successful reply from PC6 and TTL is decremented by one because both are in different subnets.
PC1 receives a successful reply from PC5 and TTL remains the same because both are in the same subnet.
PC6
PC6 receives a successful reply from PC4 and TTL remains the same because both are in the same subnet.
PC6 receives a successful reply from PC1 and TTL is decremented by one because both are in different subnets.
References
About Hardware Nation:
Hardware Nation is a professional services company that accelerates network transformation through an open networking approach, enabling freedom of choice, flexibility, and cost efficiency. Our seasoned experts have worked on projects for some of the world’s leading organizations, leveraging a hybrid cloud-first and AI-enabled approach. We help our customers navigate the ecosystem, drawing on decades of experience. Our deployments are powered by leading white box and OEM network, compute, and storage vendors. Our expertise encompasses a wide range of industries and use cases, including enterprise, cloud, data center, AI, 5G/ISP infrastructure, and edge IT.
Humza Altaf
Network Engineer
Humza is a network engineer at Hardware Nation Labs, where his passion for Open Networking drives his work. With a blend of deep expertise and innovative approaches, he designs robust, scalable networks of the future. His practical experience includes configuring and deploying a range of protocols such as LACP, VLANs, MPLS, and VRRP. At his previous role, he was part of a SONiC testing team, further honing his skills in network setup and troubleshooting. Humza is also adept at network analysis with tools like Wireshark, enhancing his ability to manage complex network environments.
Alex Cronin
Co-Founder and Solutions Architect
Alex Cronin is the founder of Hardware Nation and Nanites AI. He is a graduate of Georgia Tech with 20 years of experience in networking and data center infrastructure across enterprises, service providers and hyperscalers. His work spans traditional and open networking, production SONiC deployments, multivendor integration and direct collaboration with manufacturers and engineering teams. Hardware Nation has served organizations including NASA, Lockheed Martin, Accenture, Stanford University and Georgia Tech.
Alex leads engineering teams and contributes directly to architecture, code, integration and evaluation. At Nanites AI, he has led nearly two years of development of an agentic NetOps platform for network troubleshooting. He also develops AI automation for product research and leads business operations at Hardware Nation.
Nanites AI has been cited in Gartner’s Market Guide for Agentic NetOps Software, covered by InformationWeek and discussed by Cisco DevNet. It was selected as one of 12 finalists from more than 400 applicants in the 2025 T Challenge, organized by T-Mobile and Deutsche Telekom. Alex has presented his work at Deutsche Telekom in Bonn, CableLabs and Network X Americas.