Another EVPN reader question, this time focusing on auto-RD functionality and how it works with duplicate MAC addresses:
If set to Auto, RD generated will be different for the same VNI across the EVPN switches. If the same route (MAC and/or IP) is present under different leaves of the same L2VNI, since the RD is different there is no best path selection and both will be considered. It’s a misconfiguration and shouldn’t be allowed. How will the BGP deal with this?
Let's start with an interesting fact: while we usually had to specify VRF RD values in MPLS/VPN, EVPN standard defined a procedure where RD would be auto-generated from a PE IP address and VLAN ID. That means that the same MAC address would appear as two distinct EVPN Type-2 prefixes when coming from two different PE-devices. BGP will happily process the two prefixes and tag them for inclusion into the local MAC table… and that’s where it gets interesting:
- If an EVPN PE-device figures out it has learned the same MAC address locally (through dynamic MAC learning) and through EVPN BGP update, the observed MAC address duplication might have been caused by a MAC (VM) move. MAC mobility procedures kick in, and eventually we’re left with a single MAC address.
- In case of true misconfiguration, the MAC mobility procedure goes into an endless loop, and EVPN RFC addresses that with a duplicate-MAC timer.
Long story short: BGP has nothing to do with duplicate MAC addresses, it’s just passing prefixes around the network. The EVPN devices discover duplicate MAC addresses when importing Type-2 EVPN routes into local MAC-VRF tables, and try to rectify the situation using MAC mobility procedures defined in RFC 7432.