Question
What is the rule for BGP path selection when there is no AS path comparison due to the reception of same route with same preference from SDWAN and EBGP?
Solution
Versa does not compare AS-path when same route with same preference is received from SDWAN and EBGP, in 16.1R1.
This is the Versa BGP Path selection algorithm:
- Compare local preference.
- Prefer path with highest local preference.
- Compare locally originated routes
- Prefer locally originated routes.
- Compare the AS path length.
- Prefer lowest AS path, if there is no configuration to ignore the AS path length.
- Compare the origin code number, if origin code is different.
- Prefer the lower number.
- IGP is preferred to EGP, and EGP is preferred to INCOMPLETE.
- Compare the MED.
- Prefer routes with lower MED.
- Compare remote AS number.
- Prefer routes received from EBGP. This is checked by comparing the remote AS number for the neighbor with the local AS number.
- Compare IGP cost for BGP nexthop.
- Prefer lower IGP cost. IGP cost is compared only if both routes have a valid IGP cost.
- Compare the BGP identifier of the neighbor.
- Prefer lower BGP identifier. If the routes have an ORIGINATOR_ID, this is used as the BGP identifier (in accordance with draft-ietf-idr-rfc2796bis-01).
- Compare the CLUSTER_LIST lengths of the routes.
- Prefer a route with shorter CLUSTER-LIST length. A route with no CLUSTER_LIST is considered to have a zero length.
- Compare the peer addresses.
- First compare the address type - IPv6 is preferred to IPv4.
- If both peer addresses are same address type, lower peer IP is preferred.
- Compare remote ports – Lower port is preferred.
- Compare path IDs.
- Prefer lower path ID. This ensures deterministic results when a peer re-advertises the same route with a different path ID, and advertises the new route before withdrawing the old one.