BGP Attributes help Border Gateway Protocol finding the best path. These attributes can be tuned, this makes BGP a flexible protocol. In this example “BGP Tuning Attributes Configuration” is examined deeply.

bgp tuning attrib

R1#sh ip BGP sum

Router-3 and Router-2 have different paths for 200.50.2.0/24 network, and they send it to Router-1.

Neighbor
10.1.12.2
10.1.13.2
R1#sh ip BGP
Network         Next hop
*i200.50.2.0    10.1.24.2
*>;i            10.1.36.2

10.1.36.2 is the best route because it transists less AS.

           R1# show ip bgp

Network       Next Hop              metric               weight           local pref.      path

*:150.1.0.0 10.1.36.2 0 0 100 777 711 911?
*: 10.1.24.2 0 0 100 777 911 ?
*:150.2.0.0 10.1.36.2 0 0 100 777 711 911?
*: 10.1.24.2 0 0 100 777 911 ?
*:200.50.2.0 10.1.36.2 0 0 100
*: 10.1.24.2 0 0 100
*:200.60.2.0 10.1.36.2 0 0 100
 *: 10.1.24.2 0 0 100

As seen above, non of these routes are best path. First “no sync” command must be implemented on Router – 1 , Router -2 and Router -3. Because of IBGP doesn’t change the next hop, next hops are appearing as 10.1.36.2 and 10.1.24.2 on Router -1. Ping for 10.1.26.2 is unsuccessful from Router-1 also. To resolve that issue , “next-hop-self” command must be used or networks between Router – 2 / Router -4 and Router -3 / Router -6 must be learnt to Router -1.

R2(config)# router bgp 5500
R2(config-router)#neighbor 10.1.12.1 next-hop-self

R3(config)#router bgp 500
R3(config-router)#neighbor 10.1.13.1 next-hop-self
R1#clear ip bgp *       // BGP process is cleared after configuration  changes //
R1#show ip bgp

 

Network                                   Next Hop      ….. …..             Path

*: 150.1.0.0 10.1.13.2 777 711 911 ?
 *>:  10.1.12.2 777 911 ?
*: 150.2.0.0  10.1.13.2
 *>;i  10.1.12.2
*>: 200.50.2.0  10.1.13.2
*:  10.1.12.2
*>;:200.60.2.0  10.1.13.2 777 711 i
 *:  10.1.12.2 777 911 711 i
R1(conf)#router bgp 5500
R1(config-router)#neighbor 10.1.13.2 weight 500     // Weight is a Cisco proprietary attribute and configured locally on each router //
clear ip bgp *

It’s seen that next hop addresses for 10.1.13.2 are marked as best (>;) if we run “sh ip bgp” command //

Local Preference

Local preference value is an industry standart. For instance if there would be 50 more routers next to Router – 1 and if we would want to prefer Router -3 instead of Router – 2, we should have configured “weight” on 50 routers which is really hard. So that, “local preference” value is configured on Router-3 and advertised to all other routers.

R3(config)# router bgp 5500
R3(config-router)#bgp default local-preference 500

 

If “sh ip bgp” command is run on Router – 1 , it is seen that all routers prefer Router – 3. But how Router – 3 can be best path for 150.x.x.x , Router -2 can be best path for 200.x.x.x network ? //

R3(config)#ip access-list standart ROUTES-FOR-R3
R3(config-acl)#permit 150.1.50.0  0.0.0.255
R3(config-acl)#permit 150.2.50.0  0.0.0.25
exit
R3(config)#ip access-list standart ROUTES-FOR-R2
R3(config-acl)permit 200.0.0.0  0.255.255.255
exit
R3(config)#route-map LOCAL-PREF permit 10
R3(config-route-map)#match ip add ROUTES-FOR-R3
R3(config-route-map)#set local-preference 1000
exit
R3(config)#route-map LOCAL-PREF permit 20
R3(config-route-map)#match ip add ROUTES-FOR-R2
R3(config-route-map)#set local-preference 10

Router -3 advertises 150.x.x.x routes with 1000, 200.x.x.x.x routes with 10 local preference value to Router -1. Because of default local preference value is 100, Router – 3 is preferred for 150.x.x.x network and is not preferred for 200.x.x.x network.

R3(config)#neighbor 10.1.36.2 route-map LOCAL-PREF in
R5(config)#router bgp 911
R5(config-router)#no auto