BGP Attribute : Local Preference
BGP Attribute : Local Preference
BGP is used to exchange routing information between multiple autonomous systems (AS) on the Internet. An autonomous system is a group of networks that share a common administrative area.
BGP is used to route traffic across multiple independent systems and is the protocol used by Internet Service Providers (ISPs) to communicate routing information with one another.
What is BGP Local Preference ?
The BGP Local Preference attribute is used to influence the outbound routing decision to choose the exit path for traffic destination in a different AS. LOCAL_PREF is not advertised to external BGP neighbors. It only affects routing decisions within your AS. The default value is 100.
The BGP attribute Local Preference is the second on the list in terms of the order priority; and it can be used to inform internal BGP routers how to exit the AS if multiple paths exist. It is applied to inbound external routes, where decisions about the best exit (outbound) path for an autonomous system are made. Here are some key points you need to know about Local Preference:
- Local preference is sent to all internal BGP routers in your AS when sending updates
- It’s not passed between external BGP neighbors
- Local preference is a well-known discretionary BGP attribute, therefore it must be recognized by all BGP routers
- Its presence in a BGP update is optional
- The default value is 100
- The path with the highest local preference is preferred
⭐Related : 51 facts about BGP routing Protocol for Network Engineers
BGP Local Preference Scenario
Fig 1.1- BGP Local Preference Scenario |
One way of doing it as below where we set the BGP with the default local preference values on the router as shown below
- R2 connects to AS200 and learns about the 1.1.1.1/32 network.
- R2 connects to AS300 and learns about the same 1.1.1.1/32 network.
- You want to prefer traffic destined for 1.1.1.1/32 to exit AS100 through R2 (connected to AS200).
- Local preference only affects path selection within your AS. It's not advertised to external BGP neighbors.
- Local preference works alongside other BGP attributes like AS path length and Multi-Exit Discriminator (MED) to determine the best path.
Continue Reading...
- Why BGP-SRx is a Must-Have for Large Enterprises
- 51 facts about BGP routing Protocol for Network Engineers
- BGP Conditional Advertisement Feature
- Quick facts on BGP for interviews
- BGP Protocol : iBGP vs MP-iBGP protocol
- BGP : bgp deterministic-med and bgp always-compare-med
- BGP Attribute : AIGP-BGP Accumulative IGP