Below is the BGP path selection criteria.
1.
Highest Weight
Highest Weight
2.
Highest local preference
Highest local preference
3.
Locally generated routes
Locally generated routes
4.
Shortest AS Path
Shortest AS Path
5. Origin Code
6. Lowest MED
7.
eBGP over iBGP
eBGP over iBGP
8.
Lowest IGP metric to the BGP next hop.
Lowest IGP metric to the BGP next hop.
9.
Oldest Route in case of ebgp
Oldest Route in case of ebgp
10. BGP router with the lowest router ID.
11.
Minimum cluster id
Minimum cluster id
12.
Lowest neighbor address.
Lowest neighbor address.