BGP LOCAL PREFERENCE ATTRIBUTE

The Local Preference attribute is used to manipulate the best outbound path and applied on inbound external routes. Unlike the Weight attribute, Local Preference is passed on to iBGP peers. If multiple paths exist, Local Preference informs iBGP routers how to exit the AS ie which path to prefer for outgoing traffic. Local Preference is a 32-bit number, and can range from 0 to 4294967295.

Default preference value is 100 .The greater the Local preference e value, more it becomes the preferred path

 

Local preferences can be applied in 2 ways –

1. Directly putting default local preference by iBGP router to its neighbors. Eg –

R3(config)# router bgp 1
R3(config-router)# bgp default local-preference 200

2. On per route basis by calling a Route-map and access/prefix list through a neighbour. Eg –

R3(config)# ip prefix-list net4 4.4.4.0/24
R3(config)# route-map PREF permit 10
R3(config-route-map)# match ip address prefix-list net4
R3(config-route-map)# set local-preference 300
R3(config)# router bgp 1
R3(config)# neighbor 192.168.35.5 route-map PREF in

Below scenario will help in clarifying how local preference can be configured –

bgp-local-preference-attribute

 

As in above diagram, we are required to have R1 prefer R3 instead of R2 as best path for reachability to network 4.4.4.0/24 (Loopback of R4).

Under normal case, R1 will receive route for R4 loopback from both iBGP neighbors R2 and R3 .R2 will be the preferred path based on BGP path preference criteria of R2 having lower Router ID ie 192.168.12.2 and R3 with Router ID 192.168.13.3.Below is the snapshot.

bgp-local-preference-attribute

Now , we configure the R3 to advertise itself as preferred path by manipulating the “Local Preference” value as below –t

R3(config)# ip prefix-list net4 4.4.4.0/24
R3(config)# route-map PREF permit 10
R3(config-route-map)# match ip address prefix-list net4
R3(config-route-map)# set local-preference 300
R3(config)# router bgp 1
R3(config)# neighbor 192.168.35.5 route-map PREF in

Once the above configuration is performed on R3 and the same information is learned by its iBGP neighbour i.e. R1, the best path for R1 changes from R2 to R3 since R3 has Higher (more preferred) Local preference than R2.

bgp-local-preference-attribute

Please follow and like us:

Related Post

Tags:

Add Comment

Select your currency