BGP
BGP Route Black Holes
BGP Route Control: MED Control
BGP Route Control (Local Preference Path Selection)
Brief
When a BGP router has many BGP routes to the same destination, it compares them and finally determines the best one.
- First, it compares the Preferred Value (PrefVal).
- If the first criterion is the same, it then compares the Local Preference (LocPrf for short); the one with the higher LocPrf value wins.
- LocPrf is advertised only to IBGP peers. If it is an EBGP peer, then the LocPrf is not carried during the advertisement process.
- By default, when you advertise a route with network or import it into BGP, the LocPrf value is empty. When the received LocPrf value is empty, it uses 100 as the LocPrf value for this route (meaning it changes the Local Preference value to 100); if the received LocPrf value is not empty, then it is not modified.
- Local Preference (LocPrf for short) is a 32-bit integer, ranging from 0 to 4294967295.
Experiment Verification

- Configure basic IP addressing.
- Advertise the complete neighbor routes in the OSPF area, and verify by pinging the neighbor interfaces.
- Configure the BGP protocol, with R1 in AS 100 and the rest in AS 200.
- When configuring, pay attention to
peer next-hop-local. - Since this is an IBGP peer experiment, for example: if R2 does not configure
peer 10.0.3.3 next-hop-local, then when R2 receives the route from R1 via EBGP and passes it to its neighbor R4, R4 will find that the next hop is too far away and unreachable, so the route cannot become active (meaning it is useless). - So we need to configure
peer next-hop-local, so that the next hop of the route it sends to its IBGP neighbors is its own address. After the neighbor receives it (since IGP is configured throughout the domain), it will find the route reachable, i.e., an active route (meaning it is useful). - Reference: Huawei Explanation
- When configuring, pay attention to
Command details reference: Click to view
If you enjoyed this, leave a comment~