BGP Path Attributes - Local Preference - www.ipcisco.com : www.ipcisco.com
Content Protection by DMCA.com

BGP Path Attributes – Local Preference

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, Local Preference shows the exit point of your AS towards another AS.

The default value of Local Preference is 100. And always the highest Local Preferece is choosen as a Best BGP path.

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).

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 180

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 150

With this configuration, the Local Preference values will be shared between IBGP neighbours and RouterA will be selected as the best exit point from the existing Autonomous System 10. So, traffic will be routed towards RouterA if you want to reach to the other ASs from your own AS.

The second way to configure Local Preference attribute is using Route Maps. You can make the same configuration above with Route Maps. Let’s check:

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)# neighbour 20.20.20.20 route-map LocalPrefConfig in
RouterA(config-router)# exit
RouterA(config)# ip as-path access-list 3 permit ^20$
RouterA(config)# route-map LocalPrefConfig permit 10
RouterA(config-route-map)# match as-path 3
RouterA(config-route-map)# set local-preference 180
RouterA(config-route-map)# exit

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)# neighbour 30.30.30.30 route-map LocalPrefConfig in
RouterB(config-router)# exit
RouterB(config)# ip as-path access-list 3 permit ^30$
RouterB(config)# route-map LocalPrefConfig permit 10
RouterB(config-route-map)# match as-path 3
RouterB(config-route-map)# set local-preference 150
RouterB(config-route-map)# exit

With this configuration, Local Preference values will be configured for two of these exit point routers. The highest Local Preference value will be selected as BGP BestPath and the traffic will go outside the AS through this router (Here, Router A).

You can find other BGP Path Attribute Articles below:

BGP Path Attributes – Weight
BGP Path Attributes – Local Preference
BGP Path Attributes – AS Path
BGP Path Attributes – Origin
BGP Path Attributes – MED

Main BGP Article Series :

BGP – Part 1
BGP – Part 2 (BGP Peers, BGP Sessions, BGP Messages)
BGP – Part 3 (IBGP, IBGP Topologies and EBGP)
BGP – Part 4 (BGP Administrative Distance and BGP Path Attributes)
BGP – Part 5 (Packet Tracer BGP Configuration Example)

Youn can join OUR Facebook Group with the below links!!!




About the Author
Gokhan Kosem is a telecommunation and network engineer. His ambition to IP networks and end-to-end system installation made him to prepare this web-site. By sharing his experiences about various networking protocols beside different system installation experiences and Cisco, Juniper, Alcatel-Lucent devices configurations, he is aimed to be helpful for his collegues in all over the world. He is currently lives in Istanbul, Turkey.

Leave a Reply


Copy Protected by Chetan's WP-Copyprotect.