Underlay and overlay sessions
The underlay is plain IP routing between the switches. Each leaf has a /31 to the spine and a loopback (10.0.0.11, 10.0.0.12) that will be its VTEP address. eBGP with one AS per switch is the usual data-centre choice: simple, scales well, and needs no IGP.
The same BGP sessions also carry the overlay: the l2vpn evpn address family. On the leaves, advertise-all-vni tells FRR to advertise every VNI it finds in the kernel.
The spine is only a route server for EVPN. It has no VNIs and no VTEP. By default, an eBGP speaker sets itself as the next hop when it passes a route on. For EVPN that would be wrong: the next hop is the VTEP, and traffic must go leaf to leaf, not into the spine. So on the spine, the EVPN address family uses attribute-unchanged next-hop.
Before any VNIs exist, the EVPN sessions are up but carry no routes. The underlay works: each leaf reaches the other's loopback.
frr defaults traditional
hostname spine
!
interface eth0
ip address 10.1.1.0/31
!
interface eth1
ip address 10.1.2.0/31
!
interface lo
ip address 10.0.0.1/32
!
router bgp 65000
bgp router-id 10.0.0.1
no bgp ebgp-requires-policy
neighbor 10.1.1.1 remote-as 65001
neighbor 10.1.1.1 description leaf1
neighbor 10.1.2.1 remote-as 65002
neighbor 10.1.2.1 description leaf2
!
address-family ipv4 unicast
network 10.0.0.1/32
exit-address-family
!
address-family l2vpn evpn
neighbor 10.1.1.1 activate
neighbor 10.1.1.1 attribute-unchanged next-hop
neighbor 10.1.2.1 activate
neighbor 10.1.2.1 attribute-unchanged next-hop
exit-address-family
exit
!- Lines 16–19: eBGP to each leaf.
- Lines 21–23: Underlay: the spine's own loopback.
- Lines 25–30: Overlay: EVPN to both leaves…
- Line 27: …keeping the leaves' VTEP addresses as next hops.
frr defaults traditional
hostname leaf1
!
interface eth0
ip address 10.1.1.1/31
!
interface lo
ip address 10.0.0.11/32
!
router bgp 65001
bgp router-id 10.0.0.11
no bgp ebgp-requires-policy
neighbor 10.1.1.0 remote-as 65000
neighbor 10.1.1.0 description spine
!
address-family ipv4 unicast
network 10.0.0.11/32
exit-address-family
!
address-family l2vpn evpn
neighbor 10.1.1.0 activate
advertise-all-vni
exit-address-family
exit
!- Line 7: The VTEP address.
- Line 13: eBGP to the spine.
- Line 17: Advertise the loopback into the underlay.
- Line 21: EVPN on the same session…
- Line 22: …advertising every VNI in the kernel.
leaf1# ping -c 2 -I 10.0.0.11 10.0.0.12
PING 10.0.0.12 (10.0.0.12) from 10.0.0.11: 56 data bytes
64 bytes from 10.0.0.12: seq=0 ttl=63 time=0.062 ms
64 bytes from 10.0.0.12: seq=1 ttl=63 time=0.338 ms
--- 10.0.0.12 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.062/0.200/0.338 ms- Lines 3–4: Loopback to loopback, through the spine.