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 ?


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:

 *>                             0 3356 1239 i
 * i                        0    100      0 3356 1239 i
 *>                             0 3356 i
 * i                        0    100      0 3356 i

The '' is iBGP neighbor, thus Local Preference is shown, while 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 above:

 CEL6#sh ip bgp
 BGP routing table entry for, version 17
 3356 1239, (aggregated by 1239 from (
   Origin IGP, localpref 100, valid, external, atomic-aggregate, best
   rx pathid: 0, tx pathid: 0x0
 3356 1239, (aggregated by 1239 (metric 2) from (
   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.