cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1400
Views
4
Helpful
17
Replies

BGP dual homing same ISP

sebastien3
Level 4
Level 4

Hi,

I have 2 sites running eBGP on the same ASN peering with same ISP but at different locations. I use communities to prefer a prefix on each router.

R1 and R2 are connected together with iBGP and exchange full-view. R1 and R2 are the same local-preference.

I get a metric from the BGP neighbors of the ISP...I would like to be able to remove this metric so that it is 0.

What do you recommend ? set metric 0 in

route-map

in with match ASN of ISP ?

Thanks !

1 Accepted Solution

Accepted Solutions

Hello @sebastien3,

Thanks for your clarification.

How to avoid this?

In inbound, from eBGP on R1, R2 and R3 add LP 500 to the received-routes.

AS174 --- eBGP --- R1 LP 500 to received-routes.

AS174 --- eBGP --- R2 LP 500 to received-routes.

AS6939 --- eBGP --- R3 LP 500 to received-routes.

In your iBGP configuration between R1, R2 and R3 ensure that LP for all prefixes is set to default (100). Is it full mesh our do you have RR?

Also, keep your idea of the

default-route

injected by R1 R2 and R3.

R1, R2 and R3 would prefer their own eBGP peering to reach 1.1.1.1 for example and not iBGP. 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

View solution in original post

17 Replies 17

M02@rt37
VIP
VIP

Hello @sebastien3,

Yes

Route-Map

apply to your Routers R1 and R2 coud be the "one" to achieve this. You don't need to match ISP's ASN, apply the

route-map

to the inbound direction of your eBGP neighbor.

You could also check the community ISP's list. Sometimes ISP provide specific community values for specific "manipulation". 

 

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

r.heitmann
Level 1
Level 1

I'd like to recommend

a) interconnect your routers using iBGP

b) use local-preference to set your desired exit-path per prefix

It's enough to implement this policy at one device:

* set it to "101" if you want to prefer at the router with the policy and to "99" if the other router should be used - the other per default imports everything with "100"

sebastien3
Level 4
Level 4

Hello M02@rt37 @r.heitmann 

I had the idea to make this configuration (R1 and R2 using iBGP) :
- Have an identical local-preference on R1/R2 for the full-view of the ISP (same for R1 and R2).
- Remove the metric because a router is preferred via lower MED if the local-preference is the same.

For example if I use the next-hop from R2 to reach 1.1.1.1, if on R2 the BGP route is known by R1 (because the metric is lower) then the path will be

R0->R2->R1-->ISP=1.1.1.1

While I would like the path to be

R0->R2-->ISP=1.1.1.1

@sebastien3

In R1 and R2 configure LP 200 in inbound from eBGP peering with their ISP. 

Between R1 and R2, the iBGP, let default LP (100) in inbound and outbound.

LP is the highest tie breaker after weight.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Hi M02@rt37 

I have doubts about your answer. In my case I am in local preference 100 in Inbound peering with ISP 174. If I set 200 it won't change anything. As I said in my message I retrieve a metric from eBGP neighbors of 174.

R1 outpout for 1.1.1.1

Local eBGP with 174 = Origin IGP, metric 24010, localpref 100, weight 50, valid, external, best
Local iBGP with R2 = Origin IGP, metric 18030, localpref 100, valid, internal

R2 outpout for 1.1.1.1

Local eBGP with 174 = Origin IGP, metric 18030, localpref 100, weight 50, valid, external, best
Local iBGP with R1 = Origin IGP, metric 24010, localpref 100, valid, internal

It will be the same. NO ?

Hello @sebastien3,

Since the metric is originating from the eBGP peers, it might not be straightforward to manipulate it using standard BGP attributes within your own network.

You mentioned that you retrieve a MED from eBGP neighbors of AS174. If the MED values are consistent and reflect the AS path length, you can try to manipulate the MED attribute. However, this approach might be challenging if the MED values are different for different prefixes or are not directly related to the AS path length.

LP value attached to

default route

from R1/R2 and R3 is a good idea.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Hello M02@rt37

 

You mentioned that you retrieve a MED from eBGP neighbors of AS174. If the MED values are consistent and reflect the AS path length, you can try to manipulate the MED attribute. However, this approach might be challenging if the MED values are different for different prefixes or are not directly related to the AS path length.

 

Yes that's right, the MED comes from AS174's eBGP peer. On my routers there is no modifying configuration of the MED on the eBGP AS174 neighbors.

 

LP value attached to default route from R1/R2 and R3 is a good idea.

 

The LP configured for the

default route

on RA and RB works but the problem is on R1/R2/R3 on choosing the "right" output.

FROM RA : If I use the next-hop R1 to reach 1.1.1.1, on R1 there is a second know route BGP for 1.1.1.1 by R2 (because the metric is lower) then the path will be

RA->R1->R2-->ISP=1.1.1.1

While I would like the path to be

RA->R1-->ISP=1.1.1.1
R1 outpout for 1.1.1.1

Local eBGP with 174 = Origin IGP, metric 24010, localpref 100, weight 50, valid, external, best
Local iBGP with R2 = Origin IGP, metric 18030, localpref 100, valid, internal

R2 outpout for 1.1.1.1

Local eBGP with 174 = Origin IGP, metric 18030, localpref 100, weight 50, valid, external, best
Local iBGP with R1 = Origin IGP, metric 24010, localpref 100, valid, internal

How to avoid this ?

yes, using LocalPref with iBGP between your routers will enable full view of the per router imported EBGP routes:

  • each of your router sees it's per EBGP imported routes and the routes the other router got
  • LocalPref has been invented exactly for the purpose to get Control over your local exit routing policy

at router "1" you need a prefix-list to permit all routes to exit via this router "1".

and a 2-statement

route-map

bound in inbound direction to the EBGP neighbor.

statement "10"

...match prefix list ...

...set local pref 101

statement "20"

...set local pref 99

 

that's all.

at router "2" no routing policy is required.

...if your external transit subnet is not redistributed via your IGP you should consider "next hop self" of course at both routers.

 

Forum Tips: 1. Paste images inline - don't attach. 2. Always mark helpful and correct answers, it helps others find what they need.

sebastien3
Level 4
Level 4

M02@rt37 @r.heitmann I just made a diagram to show the current situation : net.JPG

In the iBGP between R1/R2/R3 I have a default local-pref (100).

R1 and R2 have the same routing table from 174 but not with the same next-hop because they are two different routers.

R1 and R2 also retrieve the routing table from R3 (6939). Same thing for R3 which retrieves the routing table from R1 and R2 (174).

What do you think is the best configuration to apply ?

Thanks

Hello
BGP med can be problematic in terms of best path selection, as by default with (IOS,XE) any missing med has a default value of 0 which is most preferred upon med calculation, also med is usually only compared on prefixes that originate from the same ASN (identical as-path information) but again you can tell the rtr to compare metric regardless of the as-path information

To negate any unforeseen med calculation you could append the following:

(all rtrs in same AS)
bgp bestpath med missing as-worst
bgp always-compare-med
bgp deterministic-med

Alternatively you could also set default metric values to peers that you find don't send any med

router bgp xx
default-metric xxx

 


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

Hello @paul driver 

I am using Cisco IOS XE Software, Version 03.16.10.S. I am also concerned by this BGP med problem that you indicate ?

My problem here is that if I'm not mistaken, routers use MED to select the output. Here is the path used to join 1.1.1.1, we note that R1 returns to R2 due to an identical local-pref but a lower MED.

FROM RA : If I use the next-hop R1 to reach 1.1.1.1, on R1 there is a second know route BGP for 1.1.1.1 by R2 (because the metric is lower) then the path will be

RA->R1->R2-->ISP=1.1.1.1

While I would like the path to be

RA->R1-->ISP=1.1.1.1
R1 outpout for 1.1.1.1

Local eBGP with 174 = Origin IGP, metric 24010, localpref 100, weight 50, valid, external, best
Local iBGP with R2 = Origin IGP, metric 18030, localpref 100, valid, internal

R2 outpout for 1.1.1.1

Local eBGP with 174 = Origin IGP, metric 18030, localpref 100, weight 50, valid, external, best
Local iBGP with R1 = Origin IGP, metric 24010, localpref 100, valid, internal

 

Hello @sebastien3,

Thanks for your clarification.

How to avoid this?

In inbound, from eBGP on R1, R2 and R3 add LP 500 to the received-routes.

AS174 --- eBGP --- R1 LP 500 to received-routes.

AS174 --- eBGP --- R2 LP 500 to received-routes.

AS6939 --- eBGP --- R3 LP 500 to received-routes.

In your iBGP configuration between R1, R2 and R3 ensure that LP for all prefixes is set to default (100). Is it full mesh our do you have RR?

Also, keep your idea of the

default-route

injected by R1 R2 and R3.

R1, R2 and R3 would prefer their own eBGP peering to reach 1.1.1.1 for example and not iBGP. 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

M02@rt37 

 

In inbound, from eBGP on R1, R2 and R3 add LP 500 to the received-routes.
AS174 --- eBGP --- R1 LP 500 to received-routes.
AS174 --- eBGP --- R2 LP 500 to received-routes.
AS6939 --- eBGP --- R3 LP 500 to received-routes.

 

Ok I have to apply this :

ip as-path access-list 1 permit ^174_

route-map eBGP_AS174 permit 10
match as-path 1
set local-preference 500
!
router bgp X
address-family ipv4
neighbor X.X.X.X route-map eBGP_AS174 in

 

In your iBGP configuration between R1, R2 and R3 ensure that LP for all prefixes is set to default (100). Is it full mesh our do you have RR?

 

Yes, LP is well defined at 100 for iBGP full-mesh between R1/R2/R3. I'm not in RR.

@sebastien3

It's mandatory to match AS path 174 in your

Route Map

 You only need to set LP to the received-routes, then in inbound from the eBGP peering.

route-map eBGP_AS174 permit 10
set local-preference 500
!
router bgp X
address-family ipv4
neighbor X.X.X.X route-map eBGP_AS174 in

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.
Review Cisco Networking for a $25 gift card