BGP Path Attributes – Local Preference

bgp-path-attribute-local-preference-ipcisco-

What is BGP Local Preference Attribute?

In BGP Path selection algorithm, if your device is a different vendor product (not Cisco), the first BGP Path Attribute that is taken into account during Path Selection is Local Preference attribute.

 

Local Preference is not a vendor specific BGP Path Attribute like all the BGP path attributes except Weight Attribute.

 

Local Preference attribute is used to choose external BGP paths. Different edge routers has different Local Preferences to an external destination. These values are sent between IBGP (Interior BGP) neighbours and according to these values, the AS (Autonomous System) exit point is determined. Local Preference is applied to the inbound interface and shows the best outbound interface towards another AS. In other words, here, it shows the exit point of your AS towards another AS.

 

The default value of Local Preference is 100. According to BGP Best Path Algorithm, the router which has the Highest Local Preference value is selected as a Best BGP path towards outside the Autonomous System.

 

Think about the previous Weight Attribute. Weight attribute was configured as local to that router. But Local Preference attribute is not like this. Different routers has different Local Preference values for that destination. And these Local Preference values are shared withing the AS (Autonomous System).

 

Local Preference attribute is a Well-known and Discretionary BGP Path Attribute. As we mentined before, this means, it is supported by every BGP implementation (well-known) and every BGP router recognize it, but optionally present in the BGP Update packet (discretionary).


How to Assign BGP Local Preference to a Router?

BGP Local Preference value can be assigned to a router in two ways:

  • By BGP default local-preference command
  • By Route Maps

 

Let’s give an example for each of these BGP Local Preference assign ways. As a reference topology, we will use the below basic topology:

bgp path attribute, local preference
BGP Path Attribute, Local Preference

RouterA(config)# router bgp 10
RouterA(config-router)# neighbour 10.10.10.1 remote-as 10
RouterA(config-router)# neighbour 20.20.20.20 remote-as 20
RouterA(config-router)# bgp default local-preference 100

 

RouterB(config)# router bgp 10
RouterB(config-router)# neighbour 10.10.10.2 remote-as 10
RouterB(config-router)# neighbour 30.30.30.30 remote-as 30
RouterB(config-router)# bgp default local-preference 200

 


You can also test yourself with BGP Tests and Questions.


Lesson tags: BGP, routing, path attributes, Local Preference
Back to: CCNP Enterprise 350-401 ENCOR v1.1 > BGP

Leave a Reply

Your email address will not be published. Required fields are marked *

CCNP Enterprise 350-401 ENCOR v1.1

Collapse
Expand