Guide to BGP and VXLAN/L2EVPN in GNS3 SONiC DataCenter v2.1.0

[stordis-toc]

Introduction

Welcome to the STORDIS GNS3 SONiC DataCenter guide.

In this guide, we will walk you through the configuration and use cases for the Spine-Leaf Clos topology available in your GNS3 project. This setup leverages eBGP for underlay and overlay routing, alongside VXLAN and EVPN for Layer 2 extension across the data center fabric.

Prerequisites

To run GNS3 SONiC DataCenter v2.1.0 You will need:

  • Running GNS3 project containing the Spine-Leaf topology. You can download it HERE by filling out the form.

  • Basic understanding of BGP, VXLAN, and EVPN concepts.

  • Terminal access to the Spine and Leaf nodes.

Topology Overview

The project architecture represents a standard Layer 2 EVPN VXLAN Data Center deployment.
You can view the full visual layout in the provided diagram:

 

Network Addressing Strategy

Node Name

Loopback0 (Router ID)

Loopback1

BGP AS number

Spine-1

1.1.1.1/32

-

65103

Spine-2

2.2.2.2/32

-

65104

Leaf-1

3.3.3.3/32

4.4.4.4/32

65101

Leaf-2

6.6.6.6/32

8.8.8.8/32

65102

Leaf-3

12.12.12.12/32

16.16.16.16/32

65105

Leaf-4

18.18.18.18/32

20.20.20.20/32

65106

VNI and VLAN Mapping

VLAN

VNI

Anycast IP Address

60 60 192.168.60.254/24
70 70 192.168.70.254/24
80 80 192.168.80.254/24
90 90 192.168.90.254/24

Spine Configuration (eBGP & EVPN)

The Spine switches act as the high-speed backbone of the fabric. They are configured with eBGP to establish both the IPv4 Unicast underlay and the L2VPN EVPN overlay.

Below is the standard configuration applied to the Spines:

! Spine-1 Configuration Example (Spine-2 follows identically with IP 2.2.2.2 and AS 65104)
interface Loopback 0
ip address 1.1.1.1/32
exit

interface range Ethernet 0-3
ipv6 enable
no shutdown
exit

router bgp 65103
router-id 1.1.1.1

peer-group leafswitch
remote-as external
address-family ipv4 unicast
activate
exit
address-family l2vpn evpn
activate
exit
exit

neighbor interface Ethernet 0
peer-group leafswitch
exit
! ... (Repeated for Ethernet 1 through 3)
end

Leaf Configuration (VTEP, Anycast GW & EVPN)

The Leaf switches operate as VTEPs (VXLAN Tunnel Endpoints) and handle the encapsulation/decapsulation of VXLAN traffic. They also advertise VNI information into the BGP EVPN overlay.

Key elements of the Leaf configuration include:

  • Anycast Gateway: Enables active-active gateway redundancy.

  • VXLAN VTEP Mapping: Maps local 802.1Q VLANs to their respective VXLAN Network Identifiers (VNIs).

  • Advertise-all-vni: Automatically injects all configured VNIs into the EVPN control plane.

! Leaf-1 Configuration Example
configure
interface loopback 0
ip address 3.3.3.3/32
no shutdown
exit

interface loopback 1
ip address 4.4.4.4/32
no shutdown
exit

interface Ethernet 7
switchport trunk allowed vlan all
no shutdown
exit

ip anycast-address enable
ip anycast-mac-address 00:00:22:33:44:55

interface Vlan 60
ip anycast-address 192.168.60.254/24
exit
! ... (Repeated for VLANs 70, 80, 90)

interface vxlan vtep_sw1
source-ip 3.3.3.3
map vni 10060 Vlan 60
map vni 10070 Vlan 70
map vni 10080 Vlan 80
map vni 10090 Vlan 90

router bgp 65101
router-id 4.4.4.4

neighbor interface Ethernet 0
remote-as external
address-family ipv4 unicast
activate
exit
address-family l2vpn evpn
activate
exit
! ... (Repeated for Ethernet 1)

address-family l2vpn evpn
advertise-all-vni
exit

address-family ipv4 unicast
network 3.3.3.3/32

Management Network

A dedicated Out-of-Band (OOB) management switch ensures independent administrative access to all nodes in the fabric without relying on the data plane.

! mgmt-0 Configuration
configure terminal

interface vlan 124
exit

interface range Ethernet 0-10
no shutdown
switchport access Vlan 124
exit

Use Case Scenarios

This GNS3 project is designed to help you validate and test the following scenarios:

Scenario 1 – End-to-End Inter-VLAN Connectivity

 

 

Purpose

Verify that hosts connected to different VLANs can communicate through the distributed Anycast Gateway implemented on all Leaf switches.

Test Procedure

  1. From PC1 (VLAN 60), send ICMP echo requests to:
    • PC2 (VLAN 70)
    • PC3 (VLAN 80)
    • PC4 (VLAN 90)
  2. Verify connectivity using ping.
  3. Execute traceroute to observe the forwarding path.

Expected Results

  • All EVPN neighbors are established.
  • Remote MAC/IP routes are present.
  • All configured VNIs are advertised.

Scenario 2 – Distributed Anycast Gateway Verification

 

Purpose

Verify that each Leaf switch provides the same default gateway for locally connected hosts.

Test Procedure

  1. Check the configured default gateway on each host.
  2. Ping the default gateway.
  3. Verify that the gateway is reachable from every VLAN.

Expected Results

  • Each VLAN uses the configured Anycast Gateway address.
  • The gateway is locally available on every Leaf switch.
  • First-hop routing is performed locally.

Scenario 3 – EVPN Route Advertisement

Purpose

Verify that EVPN advertises MAC/IP reachability information between all Leaf switches.

Test Procedure

  1. Generate traffic between hosts.
  2. Inspect the EVPN control plane
    1. Helpful commands

      show bgp l2vpn evpn summary
      show bgp l2vpn evpn route type macip
      show mac address-table

Expected Results

  • All EVPN neighbors are established.
  • Remote MAC/IP routes are present.
  • All configured VNIs are advertised.

Do You have more questions?

If you have any questions, encounter issues, or if any part of the configuration is unclear, please contact STORDIS Technical Support.

Our team will be happy to assist you.

You can reach us via the support portal:

https://support.stordis.com/hc/en-us

For more free resources, visit: https://stordis.com/free-resources/

Comments 0

Articles in this section