EVPN config Vs VRF config for L2VPN & L3VPN

 

Excellent question — this is a subtle but very important design point in EVPN VXLAN architecture on platforms like Cisco NX-OS (and also Juniper, Arista, etc.).
Let’s unpack it clearly 👇


1️⃣ Two Different Types of VNIs

VXLAN has two classes of VNIs in EVPN designs:

TypePurposeRoute TypeControl Plane Role
L2 VNIRepresents a broadcast domain (VLAN)EVPN Type-2 (MAC/IP routes)Part of EVI (Ethernet VPN Instance)
L3 VNIRepresents a tenant’s IP VRF / routing domainEVPN Type-5 (IP Prefix routes)Part of VRF (IP VPN Instance)

2️⃣ EVPN = Ethernet VPN

The “E” in EVPN literally stands for Ethernet — it’s fundamentally an L2 service that’s extended over BGP.
That’s why:

  • EVPN configuration (under BGP → address-family l2vpn evpn) manages L2 VNIs.

  • Each EVI represents an L2 broadcast domain (MAC learning, ARP suppression, etc.).

So, L2 VNI configs live under the EVPN context.


3️⃣ L3 VNI = Routed VRF

A Layer-3 VNI is not an Ethernet domain. It’s an IP routing domain (VRF) that uses VXLAN to interconnect distributed gateways.

Therefore:

  • The L3 VNI belongs under the VRF configuration, not under EVPN.

  • BGP VPNv4/VPNv6 or EVPN Type-5 is used to advertise prefixes, but the association happens through the VRF, not the EVPN EVI.


🔹 Cisco NX-OS Example

! --- Layer 2 EVPN configuration --- evpn vni 1010 l2 rd 1.1.1.1:1010 route-target import 65001:1010 route-target export 65001:1010 vni 1020 l2 rd 1.1.1.1:1020 route-target import 65001:1020 route-target export 65001:1020 ! --- Layer 3 VNI under VRF --- vrf context TENANT-A vni 50000 rd 1.1.1.1:50000 route-target import 65001:50000 route-target export 65001:50000

✅ Notice:

  • vni 1010 and 1020 (L2 VNIs) live under evpn.

  • vni 50000 (L3 VNI) lives under vrf context TENANT-A.


4️⃣ Why They’re Separated

ReasonExplanation
Different forwarding planesL2 VNIs perform MAC learning (bridge domain); L3 VNIs perform IP routing (VRF).
Different route typesEVPN Type-2 (MAC/IP) vs Type-5 (IP Prefix).
Different associationsL2 VNI → VLAN / bridge domain; L3 VNI → VRF.
Operational flexibilityYou can have multiple L2 VNIs mapped into one L3 VNI (many VLANs, one VRF).

Summary

  • L2 VNI = under EVPN, part of EVI (Ethernet VPN instance).

  • L3 VNI = under VRF, part of IP VPN instance.

  • They are both advertised via BGP EVPN, but managed in different parts of the config because they belong to different layers (L2 vs L3).

Comments

Popular posts from this blog

gNMI_with_grafana on containerlabs

EVPN Route type-1 & type-4 in action

Network Automation with ROBOT Framework