When two or more EVPN routes are received at a PE, BGP route selection typically takes place when the route key or the routes are equal. When the route key is different, but the PE has to make a selection (for example, the same MAC is advertised in two routes with different RDs), BGP hands over the routes to EVPN and the EVPN application performs the selection.
EVPN and BGP selection criteria are as follows:
EVPN route selection for MAC routes
When two or more routes with the same mac-length/mac but different route key are received, BGP transfers the routes to EVPN. EVPN selects the route based on the following tie-breaking order:
conditional static MACs (local protected MACs)
EVPN static MACs (remote protected MACs)
data plane learned MACs (regular learning on SAPs/SDP-bindings)
EVPN MACs with higher SEQ number
lowest IP (next-hop IP of the EVPN NLRI)
lowest Ethernet tag (that is zero for MPLS)
lowest RD
BGP route selection for MAC routes with the same route-key
The priority order is as follows:
EVPN static MACs (remote protected MACs)
EVPN MACs with higher sequence number
regular BGP selection (local-pref, aigp metric, shortest as-path, …, lowest IP)
BGP route selection for the rest of the EVPN routes follows regular BGP selection
If BGP runs through the selection criteria and a specified and valid EVPN route is not selected in favor of another EVPN route, the non-selected route is displayed by the show router bgp routes evpn evpn-type detail command with a tie-breaker reason.