According to BGP best Path Selection process, here is the order of BGP preference:
- Prefers the highest weight
- Prefer the Highest local preference
- Prefer Locally Originated routes
- Prefer the shortest AS path
- Prefer the lowest Origin Code
- Prefer the Lowest MED value
- Prefer the routes learned by EBGP over the routes learned by IBGP
- Prefer the routes learned with the lowest router ID
- Keep in Mind the “Weight” attributes is locally significant and is Cisco proprietary, the default value for locally originated routes are 32678
- The default Local preference attribute value for all learned routes is 100 “IF is not modified”
- The default Origin Code is “IGP” if learned and advertised by Network Statement, while “Incomplete” If the route is redistributed into BGP
- The default MED value for all learned route is 0 “Unless modified”, bear in mind MED is compared by default from routed learned from the Same AS number