cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2232
Views
15
Helpful
9
Replies

Local Preference and AS path prepend between different remote BGP AS

Hi Experts,

 

I want to know if Local preference and AS path prepend will work or not in my Scenario.

 

Scenario : At my customer edge side I have two routers which are in AS 100 and have IBGP, these both Customer edge routers are making the eBGP with different AS numbers. like Customer Edge Router1 is making the eBGP with AS 200 and  Customer Edge Router2 is making the eBGP with AS 300.

 

Questions :

  1. If I want to implement Local preference on both Customer Edge routers like Router 1 (LP 200) Router 2 (LP 100) then will my traffic will go outside from Router 1 or not. or LP will not work because my Customer edge routers are making the eBGP with different AS numbers and it should be with same AS number ?
  2. If I want to implement AS path prepend on both Customer Edge routers like Router 1 (Nothing) Router 2 (AS path prepend 100 100) then will my traffic come inside from Router 1 or not. or AS path prepend will not work because my Customer edge routers are making the eBGP with different AS numbers and it should be with same AS number ?

Please provide your expert inputs.

 

Thanks

Gurbinder

1 Accepted Solution

Accepted Solutions

Gurbinder

If both EBGP peers are advertising exactly the same prefixes then Local Preference should work very well. If both EBGP sessions are actually to the same ISP then I would feel fairly confident that perpending should also work. I am a bit puzzled if it is to the same ISP that 2 AS numbers are used. But perhaps that is not important.

If it is to a single ISP and if you are not sure about prepending then perhaps there is another alternative to consider. Perhaps you could ask the ISP about the possibility of advertising some community value from Router1. When the ISP receives an advertisement with that particular community value then it would set its Local Preference to prefer this advertisement. 

HTH

Rick

View solution in original post

9 Replies 9

 EdgeRouterR1-EdgeRouterR2
1-LP in R1 with route-map set LP toward R2 with high value make R2 prefer the path through R1
note:- even if eBGP not carry any LP attribute the router set the LP of eBGP route with default value "100".
2-config the AS prepend 
R1 100,100
R2 100,100,100
even if the same AS number but the No. of AS appear in as path is different so the BGP prefer the R1 because it have two AS and R2 have three AS.


Hi

 Looks like you doubt is around the fact that due the remote AS is different, it may interfere on the decision, right? But, in fact, it does not.

 Local Preference is advertised between iBGP router but not between e BGP and you are going to apply it on the customer side only, of course. So, if you make the Local Preference on R1 higher then R2, the exit traffic will go through R1, for sure. Considering all the other parameter are default.

 In the other hand, you mention AS Prepend which is the opposite direction and the answer is the same. The different AS number will not interfere.

 If you do as you told, adding AS Path 100 100 on the router 2, this means that you are interfering on how the world will send traffic to your client and it will happen through R1 as well.

 

 

Gurbinder
We do not know much about this environment and that might impact the advice that we give. In general I believe that what you suggest should work. We should remember that Local Preference is applied to routes that we learn (and therefore influences how you forward traffic TO the Internet, while Prepend is applied to routes that we advertise (and therefore influences how the Internet forwards traffic TO you.
So if you configure Local Preference appropriately you should be able to achieve that your AS uses R1 to forward traffic to the Internet. It would not matter whether the external routers are in different AS (as you describe is the case) or external routers are in the same AS. And if you configure Prepend appropriately you should be able to achieve that the Internet uses R1 to forward traffic to you. It would not matter whether the external routers are in different AS (as you describe is the case) or external routers are in the same AS.
I would comment that Local Preference is generally quite effective since you are controlling which advertisements you prefer (this assumes that you receive the same prefix advertisement from both peer routers). And I would comment that Prepend is less effective. When you prepend you are suggesting to Internet routers that they prefer R1. But they are free to make their own forwarding decisions and may choose to forward to R2 despite the prepend of the advertisement. For example if R1 is advertising to a tier 2 ISP and R2 is advertising to a tier 1 ISP then many Internet routers may prefer to forward using the tier 1 alternative.
And I would comment that even if you have correctly configured Local Preference it may not achieve what you want. For example if the peer of R1 is advertising to you only a default route and if R2 is advertising selected routes, or the complete Internet routing table, then much of your traffic to the Internet would go through R2. Local Preference is effective only if both peers are advertising the same prefix (and same prefix length).

HTH

Rick

Thanks All for your expert answers.


From Both AS numbers I am getting exact same prefixes. Moreover, It is same ISP with which i am creating the eBGP (with two AS numbers) with different AS numbers. Now I think my Local preference will work in this case.

But i still have doubt about AS path prepend that R1 will be preferred for incoming traffic or not.

 

Regards,

Gurbinder

What your concerns about as prepend ?

Gurbinder

If both EBGP peers are advertising exactly the same prefixes then Local Preference should work very well. If both EBGP sessions are actually to the same ISP then I would feel fairly confident that perpending should also work. I am a bit puzzled if it is to the same ISP that 2 AS numbers are used. But perhaps that is not important.

If it is to a single ISP and if you are not sure about prepending then perhaps there is another alternative to consider. Perhaps you could ask the ISP about the possibility of advertising some community value from Router1. When the ISP receives an advertisement with that particular community value then it would set its Local Preference to prefer this advertisement. 

HTH

Rick

Hello


@gurbinder.kabbay wrote:
  1. If I want to implement Local preference on both Customer Edge routers like Router 1 (LP 200) Router 2 (LP 100) then will my traffic will go outside from Router 1 or not. or LP will not work because my Customer edge routers are making the eBGP with different AS numbers and it should be with same AS number ?  <-- router 1 will be the egress for your local ASN


@gurbinder.kabbay wrote:

If I want to implement AS path prepend on both Customer Edge routers like Router 1 (Nothing) Router 2 (AS path prepend 100 100) then will my traffic come inside from Router 1 or not. or AS path prepend will not work because my Customer edge routers are making the eBGP with different AS numbers and it should be with same AS number ?


Not necessary, As when you pre-pend you are doing so towards external peers and those peers may allow relax the same as-path number/length ruling (bgp bestpath as-path multipath-relax), but has @Richard Burts stated we don't know enough about you network to provided a definitive answer

 

 

 

 

 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello @gurbinder.kabbay 

your scenario is typical of a big enterprise multi homed to the internet I assume you have your own BGP AS number and your own IP address block allocated to you by your RIR  ( ARIN for USA, RIPE for EUROPE and so on)

 

the key point is the iBGP session between the two Edge routers in AS 100 you need it to make this scenario to work.

 

Q1) yes outbond to the internet traffic will go via Edge router R1 to AS 200 if you set LP 200 on eBGP session using:

on R1

router bgp 100

neighbor <ISPA-direct.link> local-preference 200

Warning: this is true for prefixes of same lenghts if ISP B AS 300 provides an advertisement for a more specific prefix it will be used regarldless of LP settings i.e. prefix 195.20.200.0/24 from ISP B is preferred over 195.20.200.0/23 from ISP A.

 

Q2)  Prepending your own AS number is the only safe way to use prepend, but results are not guaranteed consider it as an attempt to influence what remote AS will choice as return path. Other solutions are possible splitting your own public address block in order to use both ISP A and ISP B at the same time for different subprefixes. It requires the use of route-maps that will perform multilple actions like advertising a subprefix taken from your own public address pool in different ways on the two Edge routers R1 and R2 towards ISP A AS 200 and ISP B respectively.

Note 1:

The use of prefixes more speciific then /24 like 196.50.50.128/25 is usually unsupported and it would require cooperation with ISP A and ISP B stuff.

Note 2:

if you have not your own BGP AS number you can still be multhomed but it will require to get NAT pools from both providers and the scenario becomes much more complex and usually firewalls are deployed

 

In real world scenarios firewalls are deployed also in case you have your own BGP AS number and your own public address block.

 

Hope to help

Giuseppe

Richard Burts
Hall of Fame
Hall of Fame

I am glad that our explanations and suggestions have been helpful.  Thank you for marking this question as solved. This will help other participants in the community to identify discussions which have helpful information. This community is an excellent place to ask questions and to learn about networking. I hope to see you continue to be active in the community.

HTH

Rick
Review Cisco Networking products for a $25 gift card