How does BGP choose the route?
BGP choice principle of Huawei NE serials router:
1. First drop unreachable route of next-hop.
2. Give priority to optimal route of local_preference.
3. Give priority to initialized route of the router.
4. Give priority to the shortest route of AS-path.
5. Choose routes with origin type as IGP, EGP and Incomplete in turn.
6. Give priority to the route with the lowest MED.
7. Give priority to the route learned form EBGP.
8. If it is configured with load balance and many external routes to the same AS, many routes are chosen to have load balance.
9. Give priority to the route advertised by router with the smallest Router ID.
Note: The attachment has detailed BGP choice principle (not limit to Huawei device), parts of commands are offered in Huawei router (refer to blue parts). For reference.