cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
490
Views
0
Helpful
1
Replies

Easy bgp local_pref question

I have the following network (full internal AS 34 bgp mesh):

bgp question.png

I applied the bgp default local-preference 400 command on R3 and as I suspected nothing changed (it only has iBGP peers).

I applied the same command on R1 and it changed the local preference throughout the AS for all AS 21 and AS 67 originating routes. This is fine.

However my question is:

Local preference is only ever applied on routes coming in from eBGP peers (or redistribution), correct?

There isn't some strange rule like "for local pref to work on any route you must have one eBGP peer" or something is there? I dont think this is the case because the local preference was only changed on bgp routes with from an external AS and not the loopback networks that R4 redistributed into ebgp (however if I put bgp default local-preference 400 on R4 the local-preference for those loopbacks does change .... hence me mentioning redistribution above).

I hope my query makes sense. My notes are not crystal clear on this.

Thanks in advance

1 Reply 1

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Steven,

the command bgp default local-preference is thought to be used when you want to give preference to a border router in your case R1 over R2 for all routes received from eBGP peers or locally generated.

see

http://www.cisco.com/en/US/docs/ios-xml/ios/iproute_bgp/command/bgp-a1.html#GUID-27B4D198-B4FB-46DC-A6D1-19DAD1CCC210

In this way all routers in AS 34 use R1 as preferred exit point for all routes  that R1 generates locally or passes from eBGP peers.

The local preference is meaningful only within a single AS in your case within AS 34.

To be noted locally generated routes can be simply generated with the network command not only using redistribute commands.

In your test R3 is not generating any local route and has no eBGP peers.

So it has no route to pass to any other peer. As a result of this the command looks like ineffective, but if you add a network command for a loopback address on R3 you will see the effects.

By the way, have you implemented an iBGP full mesh in AS 34 or are you using route reflectors ?

The big difference is that iBGP routes are not passed to other iBGP peers (iBGP split horizon rule)

Generally speaking when using route-maps you can set the local preference selectively on received iBGP routes to pick a preferred route from a specific remote iBGP peer.

At least in the context of MPLS L3 VPN we used this technique to perform some load sharing (per  VRF IP prefix) before the introduction of the feature iBGP multipath and it worked.

Hope to help

Giuseppe

Review Cisco Networking for a $25 gift card