Hello everyone,
Today, I'll show you which route is preferentially selected between EVPN and L3VPN when two routes have the same attributes.
As we all know, EVPN supports both L2VPN and L3VPN, simplifying network protocols. As EVPN becomes more mature, more and more customers are considering evolving traditional L3VPN services to EVPN. The evolution of L3VPN is relatively simple. In addition to the BGP EVPN AF configuration, you only need to run the evpn mpls routing-enable command in the ip vpn-instance view and do not need to change the UNI.
However, if a device learns two routes with the same attributes (EVPN and L3VPN) during the cutover, who will be selected as the optimal route? The answer is L3VPN (current implementation, which may be changed in the future).
Now, let's try to prove it. In the experiment, the VRF routes of 52.52.52.52/32 are from EVPN and L3VPN, respectively. The inner label 48224 is an L3VPN route, and the inner label 48225 is an EVPN route. Let's see how two routes with different BGP attributes are selected.
Round 1: Different peer addresses
Similar to the comparison rules of two L3VPN routes, the route with the optimal peer address is preferentially selected. Therefore, the L3VPN route wins.
![]()
Round 2: Router-IDs are different
Similar to the two L3VPN routes, the route with a smaller router ID is preferred. Therefore, the L3VPN route wins.
![]()
Round 3: IGP costs are different
Similar to the rules for comparing two L3VPN routes, the route with a smaller IGP cost is preferred. Therefore, the L3VPN route wins.
![]()
Round 4: MEDs are different
Similar to the comparison rules of two L3VPN routes, the route with the smallest MED value is preferentially selected. Therefore, the L3VPN route wins.
![]()
Round 4: All BGP attributes are the same
The L3VPN route wins. The reason why EVPN is not preferentially selected is not preferred for import-rib route. It is suspected that the rule that L3VPN routes take precedence over EVPN routes is hardcoded when all BGP attributes are the same.
![]()
![]()
This is what I want to share with you today, thank you!
