10-12-2023 01:55 PM
Hi,
I'm having trouble with BGP's route selection criteria. I have a network with NCS 5500; one of them is route reflector and receives route 1.46.0.0/19 via iBGP through three of my routers (R1, R2 and R3) with the following metric.
R1:
AS-PATH: 2914 10089 9587 24378
MED: 30263
IGP Metric: 12609
R2:
AS-PATH: 6939 10089 9587 24378
MED: 2179
IGP Metric: 13103
R3:
AS-PATH: 6939 10089 9587 24378
MED: 3664
IGP Metric: 952
My route reflector is choosing R2's route as best.
I understand the Route Reflector is comparing the route with next hop R2 and R3 through the MED, but it is not comparing the route of R1. I understand that this behavior should not be appropriate, since R1's route is learned by AS 21914 and not 6939, so the selected route should be that of R3 due the lower IGP Metric.
The problem that is arising is that when router R3 receives from the reflector that the best route is that of R2, MED assumes that the one it learns through iBGP is better and stops announcing the route to the reflector. This has the consequence that the reflector now receives the routes of R1 and R2 and between the two it takes the route of R1 as the best, thereby announcing the route to R3 with next hop R1. This causes R3 to announce the route again since the one learned by eBGP is preferred over the one learned by R1.
This situation is constantly repeating itself, so my routers have the route in the routing table for a few seconds and are constantly changing.
I would appreciate if someone can help me understand how to solve this problem.
Kind regards
José
Solved! Go to Solution.
10-18-2023 11:22 PM
Ok'
there are 5/6 paths
The important is path1'2'3
The router select path2 even if the med is higher.
Did you apply med compare in RR??
The RR scape med step until I think it reach router-id.
10-18-2023 10:48 AM - edited 10-18-2023 10:50 AM
Hi @j.restaino ,
Thanks for the additional information. Analyzing the output you just provided, I see a couple of weird things:
- The preferred path is from R1.
Path #2: Received by speaker 0
Flags: 0x2000000085058205, import: 0x9f
Advertised to update-groups (with more than one peer):
0.3 0.4 0.5 0.6
Advertised to peers (in unique update groups):
192.168.197.72
2914 10089 9587 24378, (Received from a RR-client), (received & used)
192.168.194.1 (metric 12608) from 192.168.194.1 (192.168.194.1), if-handle 0x00000000
Received Label 24001
Origin EGP, metric 30263, localpref 100, valid, internal, best, group-best, multipath, import-candidate, imported
Received Path ID 0, Local Path ID 1, version 2716483273
Community: 6057:1010 6057:32306
Extended community: RT:6057:6057
best of AS 2914, Overall best
Source AFI: VPNv4 Unicast, Source VRF: Internet, Source Route Distinguisher: 7167:6057
- Two paths are received from R1. One from AS2914 and the other from AS6939.
- According to the last topology you provided, the path from AS6939 with a MED of 2179 is received from R2, not R1.
Regards,
10-19-2023 08:25 AM
Sorry @Harold Ritter, i attached the wrong file. Here i go again.
Regards
10-19-2023 03:52 PM
Hi @j.restaino ,
It looks like the best path is the one received from R1. So it is correct, right?
Path #2: Received by speaker 0
Flags: 0x2000000085058205, import: 0x9f
Advertised to update-groups (with more than one peer):
0.3 0.4 0.5 0.6
Advertised to peers (in unique update groups):
192.168.197.72
2914 10089 9587 24378, (Received from a RR-client), (received & used)
192.168.194.1 (metric 12608) from 192.168.194.1 (192.168.194.1), if-handle 0x00000000
Received Label 24001
Origin EGP, metric 30263, localpref 100, valid, internal, best, group-best, multipath, import-candidate, imported
Received Path ID 0, Local Path ID 1, version 2716483273
Regards,
10-17-2023 09:11 PM
https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13753-25.html
You need to start searching in RR and R1 and R2.
The MED is 6th in best path order. And also there is prefix not enter in best path selection.
So check weight check LP check AS-path check reachability of prefix next-hop.
Note:- metric to next-hop of prefix is come later all above criteria can effect selection of best path.
10-18-2023 06:40 AM
I did, but looking the documentation i do not understand why the router choose that route.
Regards
José
10-18-2023 06:42 AM
Can you share
Show ip bgp x.x.x.x <- x.x.x.x is the prefix you face problems with
10-12-2023 08:55 PM
I will test this and check. But I don't think it MED issue.
10-13-2023 07:30 AM
So what do you think is the issue here?
10-13-2023 11:01 AM - edited 10-13-2023 11:02 AM
Thanks @MHM Cisco World, i will appreciate if you can help us.
Regards
José
10-15-2023 10:31 AM - edited 10-16-2023 02:09 AM
MHM
10-16-2023 02:13 AM
there are two approach here,
R4 set MED 2000 toward R2 and MED 3000 toward R3
R6 set MED 500 toward R5
we want RR and R5 path for LO 44.44.44.44 be via R5->R6 then config always med in R5 and RR only
this make RR have three path (show ip bgp) and select lowest MED
we want RR and R5 and R2 and R3 path for LO 44.44.44.44 be via R5->R6 then config always med in all routers (R5,R1:RR:,R2,R3)
10-17-2023 12:01 PM
@MHM Cisco World Thanks for the time that you take it did the test. It´s much clear now how "always med" works; but we don´t want to use due the different criteria that our serveral Carriers are using.
Regards
10-19-2023 01:44 AM
BGP routing table entry for 1.46.0.0/19, Route Distinguisher: 7167:6057 Versions: Process bRIB/RIB SendTblVer Speaker 2716599647 2716599647 Flags: 0x00363201+0x00010000; multipath; Last Modified: Oct 18 09:23:07.418 for 03:52:51 Paths: (6 available, best #2) Advertised to update-groups (with more than one peer): 0.3 0.4 0.5 0.6 Advertised to peers (in unique update groups): 192.168.197.72 Path #1: Received by speaker 0 Flags: 0x2000000084028205, import: 0x94 Not advertised to any peer 6939 10089 9587 24378, (Received from a RR-client), (received & used) 192.168.194.1 (IGP metric 13102) from 192.168.194.1 (192.168.194.1), if-handle 0x00000000 Received Label 16 Origin EGP, MED metric 2179, localpref 100, valid, internal, import-candidate, imported Received Path ID 0, Local Path ID 0, version 0 Community: 6057:1002 6057:33323 6057:48401 Extended community: RT:6057:6057 Source AFI: VPNv4 Unicast, Source VRF: Internet, Source Route Distinguisher: 7167:6057 Path #2: Received by speaker 0 Flags: 0x2000000085058205, import: 0x9f Advertised to update-groups (with more than one peer): 0.3 0.4 0.5 0.6 Advertised to peers (in unique update groups): 192.168.197.72 2914 10089 9587 24378, (Received from a RR-client), (received & used) 192.168.194.1 (IGP metric 12608) from 192.168.194.1 (192.168.194.1), if-handle 0x00000000 Received Label 24001 Origin EGP, MED metric 30263, localpref 100, valid, internal, best, group-best, multipath, import-candidate, imported Received Path ID 0, Local Path ID 1, version 2716483273 Community: 6057:1010 6057:32306 Extended community: RT:6057:6057 best of AS 2914, Overall best Source AFI: VPNv4 Unicast, Source VRF: Internet, Source Route Distinguisher: 7167:6057 Path #3: Received by speaker 0 Flags: 0x2000000084018205, import: 0x96 Not advertised to any peer 6939 10089 9587 24378, (Received from a RR-client), (received & used) 192.168.194.11 (IGP metric 12608) from 192.168.194.11 (192.168.194.11), if-handle 0x00000000 Received Label 24003 Origin EGP, MED metric 2354, localpref 100, valid, internal, multipath, import-candidate, imported Received Path ID 0, Local Path ID 0, version 0 Community: 6057:1002 6057:33351 Extended community: RT:6057:6057 iBGP multi-path Source AFI: VPNv4 Unicast, Source VRF: Internet, Source Route Distinguisher: 7167:6057
path 2 have higher MED than path 3
but both have equal IGP metric so
path 2 have lowest router ID so it select as best
and paht 3 is also select as ibgp multipath since you config multipath iBGP.
there is nothing I see wrong
you dont config MED compare in RR and what you see normal
10-19-2023 09:31 AM
Thanks for your response @MHM Cisco World .I undestand that Path 1 and 3 could be compare using MED because they have the same AS-PATH, but Path 2 comes from a different AS, so Path 1 and 2 could not be compare using MED. I don´t have configured "always compare med"
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