1

While configuring BGP on Cisco IOS, the

sh ip bgp

command lists the local preference of each of the learnt routes. I understand the default is 100. However for some routes, it is explicitly stated as 100 while for others it is simply blank. Why this discrepancy.

Secondly I have confusion on how local preference works. Is local preference set for a neighboring router, for an neighboring AS or it is set per router interface.

I know it is local per router and hence not propagated, but on what basis is it assigned to ?

1

So, let's go one by one.

On Cisco IOS, the 'sh ip bgp' will not show Local Preference for routes received from eBGP peers, but it will show Local Preference on iBGP peers. Here's example:

 *>   12.39.0.0/16     41.61.16.1                             0 3356 1239 i
 * i                   172.16.7.7               0    100      0 3356 1239 i
 *>   33.56.0.0/16     41.61.16.1                             0 3356 i
 * i                   172.16.7.7               0    100      0 3356 i

The '172.16.7.7' is iBGP neighbor, thus Local Preference is shown, while 41.61.16.1 is eBGP and Local Preference is NOT shown, however you can ask BGP for the prefix and then Local Preference as resulting from policies/etc will be shown. For 12.39.0.0/16 above:

 CEL6#sh ip bgp 12.39.0.0
 BGP routing table entry for 12.39.0.0/16, version 17
 [...]
 3356 1239, (aggregated by 1239 12.39.3.3)
  41.61.16.1 from 41.61.16.1 (33.56.1.1)
   Origin IGP, localpref 100, valid, external, atomic-aggregate, best
   rx pathid: 0, tx pathid: 0x0
 3356 1239, (aggregated by 1239 12.39.3.3)
  172.16.7.7 (metric 2) from 172.16.7.7 (172.16.7.7)
   Origin IGP, metric 0, localpref 100, valid, internal, atomic-aggregate
   rx pathid: 0, tx pathid: 0

For the Local Preference in general - it is propagated, but only within the local AS. Weight (Cisco specific attribute) is not propagated even between routers within the same AS.

You can set Local Preference on prefix, be it either per neighbor (all prefixes received from peer) or with some more granularity (like for example, adjust Local Preference only for specific AS_PATHs).

Please sit down and read more about BGP - starting from here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.