08-06-2023 11:25 PM - last edited on 10-17-2023 03:57 AM by Translator
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 !
Solved! Go to Solution.
08-09-2023 10:39 PM - last edited on 10-17-2023 05:03 AM by Translator
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.
08-06-2023 11:32 PM - last edited on 10-17-2023 04:04 AM by Translator
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".
08-07-2023 12:59 AM
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"
08-07-2023 01:35 AM - last edited on 10-17-2023 04:06 AM by Translator
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
08-07-2023 02:29 AM - edited 08-07-2023 02:30 AM
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.
08-08-2023 11:31 PM - last edited on 10-17-2023 04:38 AM by Translator
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 ?
08-09-2023 12:24 AM - last edited on 10-17-2023 04:39 AM by Translator
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.
08-09-2023 10:08 PM - last edited on 10-17-2023 05:29 AM by Translator
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 ?
08-07-2023 03:21 AM - last edited on 10-17-2023 05:31 AM by Translator
yes, using LocalPref with iBGP between your routers will enable full view of the per router imported EBGP routes:
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.
08-07-2023 04:52 AM - edited 08-07-2023 04:55 AM
M02@rt37 @r.heitmann I just made a diagram to show the current situation :
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
08-09-2023 01:55 AM - last edited on 10-17-2023 05:15 AM by Translator
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
08-09-2023 10:15 PM - last edited on 10-17-2023 05:01 AM by Translator
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
08-09-2023 10:39 PM - last edited on 10-17-2023 05:03 AM by Translator
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.
08-09-2023 11:37 PM - last edited on 10-17-2023 04:57 AM by Translator
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.
08-09-2023 11:45 PM - last edited on 10-17-2023 04:56 AM by Translator
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide