Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

BGP local prefrence question

I have following set up

Rtr A

|

|

Rtr B----------Rtr C  AS1

|                  |

|                  |

Rtr D----------Rtr E  AS2

|

|

Rtr F

|

|

144.14 network.

Rtr B & Rtr C are using IBGP in AS 1

Rtr D & Rtr E are using IBGP in AS2

Rtr B & Rtr D are using EBGP

Rtr C & Rtr E are using EBGP

I want to use link between Rtr C & Rtr E as the primary traffic to reach 144.14 network from Rtr A.

So i have a route map on Rtr D & Rtr E which is advertising local prefrence.

Route map is configured to set the local prefrence on Rtr D for network 144.144 to be 100 and LP on Rtr E is set to 200.

So whenever  Rtr B or Rtr C receives traffic destined for 144.14 network it uses the link between Rtr C & Rtr E as the primary link due to higher LP.

OK this is the way i have it configured in my production network.

But now i have a question regarding the way Local prefernce is used to influence the incoming routes in AS2.

What i understand is LP is used to influence the way traffic is supposed to exit out of AS2.

So can anybody explain the way LP is used  for traffic incoming to AS2 and not to exit out of AS2

I am a bit confused.

Any help will be highly appreciated.

Thanks

2 REPLIES
Cisco Employee

Re: BGP local prefrence question

Hello,

Route map is configured to set the local prefrence on Rtr D for network 144.144 to be 100 and LP on Rtr E is set to 200.

I am sorry but is this correct? Setting the LP on D and E for a network that is located within the AS 2 does not make much sense in your case. If the C-E link is to be preferred when sending data from AS1 to the network 144.14 then the LP should have been set on the B and C routers.

So can anybody explain the way LP is used  for traffic incoming to AS2 and not to exit out of AS2

It cannot. The LP is local to the AS and is never advertised across autonomous system boundaries, thus it cannot influence routing decisions in a neighboring AS. This is an excerpt from the RFC 4271:

   A BGP speaker MUST NOT include this attribute in UPDATE messages it
   sends to external peers, except in the case of BGP Confederations
   [RFC3065].  If it is contained in an UPDATE message that is received
   from an external peer, then this attribute MUST be ignored by the
   receiving speaker, except in the case of BGP Confederations
   [RFC3065].

If you want to influence routing decisions in a neighboring AS, you either must modify the Multi-Exit-Discriminator attribute (MED, or the metric), or modify the AS_PATH attribute using prepending operations.

Once more, the Local Preference modifies route selection only in your own AS. It cannot directly influence how other AS decides about its own best path back to your own AS.

Best regards,

Peter

Re: BGP local prefrence question

Hi Vikas,

See Local preference is local to AS so even if you set Rtr D/E advt. local preference it will not be visible to
Rtr B/C/A because both are in different AS. Moreover LP is used for exit traffic from your AS to neighboring AS

For your requirement the best way is to use

1- Increase local preference of >100 on Rtr C for network 144.14 and apply it on EBGP between C and E
2- Leave Local preference of 100 for EBGP link between B and D. (Nothing is required)
3- For return traffic put as-path prepending on router B towards D which leaves default AS-pATH between C and E.

So all you need is to apply below route-map

route-map LP permit 10
match ip address prefix-list PRIMARY
set local-preference 150

ip prefix-list PRIMARY permit 144.14.x.x/y

Apply above route-map to ebgp between C and D

neighbor x.x.x.x route-map LP in

route-map AS-PATH permit 10
set as-path-prepend
(2-3 times your As number of C or B)

apply it on ebgp between B and D

neighbor y.y.y.y route-map AS-PATH out

Hope this helps

Regards
Mahesh

266
Views
0
Helpful
2
Replies