cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
cancel
1792
Views
11
Helpful
26
Replies

BGP MED

RobotAjay
Level 1
Level 1

2023-12-29_17-20.png

 

Please find the attached diagram.

 

Neighborship is formed and Below is the configuration on AS2 router.

router bgp 2
bgp log-neighbor-changes
network 4.4.4.0 mask 255.255.255.0
network 192.168.24.0
network 192.168.34.0
neighbor 192.168.24.2 remote-as 1
neighbor 192.168.24.2 route-map MED out
neighbor 192.168.34.3 remote-as 1

access-list 1 permit 4.4.4.0 0.0.0.255

route-map MED permit 10
match ip address 1
set metric 4444

After this configuration when i check the router "Suriname", I see only one path.

Suriname#sh ip bgp

*>i 4.4.4.0/24 192.168.34.4 0 100 0 2 i
May I know why the second path is not showing? The moment I remove the router map on AS2 router it works as expected.

Even on the router "CUBA" I see only one route when MED is applied. can you please explain why the redundant path is not showing??

26 Replies 26

Please find the output.
Unicast.png


As you can see cuba has only one route while haiti has 2 routes, for some reason Haiti  is not sending 4.4.4.0/24 to Cuba (When MED is applied only for 1 peer in As2 router).
Routes.png

That why Suriname is not receive two path.

1- MED is used and it same' the cuba and Haiti use MED to select path if same then router select the ebgp path than ibgp and advertise the best path to Suriname.

2- MED is push to one cuba or Haiti' cuba and Haiti select path with lowest MED and since missing MED is 0 then it always select it as best path' but ibgp neighbor (cuba and Haiti  ibgp) will also select same path so' Suriname see only one path

We can override missing med with 

bgp bestpath med missing-as-worst

3-MED is use but it not same' this case is same as case 2' the ibgp neighbor (cuba and Haiti) select one path and advertise to Suriname.

So solution from above as I mention push MED or remove ibgp between cuba and Haiti

MHM

Yes @RobotAjay 

Same MED, so you see the 2 paths with the one in eBGP prefered.

Add MED on the other neighbor and check.

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

Ruben Cocheno
Spotlight
Spotlight

@RobotAjay 

Consider the following document if you want to use Equal cost Multipath (ECMP), and play around.

https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13762-40.html

Tag me to follow up.
Please mark it as Helpful and/or Solution Accepted if that is the case. Thanks for making Engineering easy again.
Connect with me for more on Linkedin https://www.linkedin.com/in/rubencocheno/

neighbor 192.168.34.3 route-map MED out

you need to add MED to both Peer 
then check 
MHM

you dont get the idea, so I will more explain 
what is first rule between iBGP ? the path learn from iBGP never re-advertise to other iBGP

NOW 
one path use MED (red line) other not 
the BGP best path selection use lowest MED to select the path 
Cuba have lowest path (no MED so it assume it 0)
Haiti select path via Cuba and Haiti never resend this path to Suriname 
Cuba own of this path send this path to Suriname

MHM MED1.png

Here same as above but Now we make two path have same MED and hence the Haiti BGP select path not depend on MED but it prefer eBGP over iBGP 
here both Cuba and Haiti advertise the path to Suriname 

MHM MED2.png

Thanks for the clarification.
I do understand the IBGP rule, so as per the rule anything Cuba learnt from haiti or haiti learnt from cuba will not be forwarded to "Suriname"(As per IBGP rule)

But whatever Haiti/cuba learnt from jamaica(AS2) will be forwarded to Suriname.

The only point that confused me is, what ever Jamaica sends to Haiti will have MED value as 400, and also Haiti has already learnt 4.4.4.0/24 via Cuba which has less MED(0).
So ideally, the router "HAITI" is not forwarding the route (learned via Jamaica with MED 400) to other routers, and this is because of the MED.
I hope my understanding is correct,

Please correct me if I am wrong.

The only point that confused me is, what ever Jamaica sends to Haiti will have MED value as 400, and also Haiti has already learnt 4.4.4.0/24 via Cuba which has less MED(0).

Which path will win, from the lower MED which is Cuba, since this path is ibgp haiti never resend it to Suriname
why?
why ibgp need full mesh why? because each ibgp never send path learn from ibgp to other ibgp.
the reason for above the ebgp use AS to detect loop, ibgp dont have this capability because the AS is same so it depend on split horizon (full mesh need) that make ibgp never re advertise the path learn from ibgp. 

when we config same MED to both Cuba and Haiti 
both now have ebgp path not ibgp and hence it can advertise this path to Suriname 

MHM

rule 1- ibgp never re-advertise iBGP BEST path to other iBGP 
rule 2- ibgp or ebgp advertise only best path (there is special cases but not time to explain here now)

this lab config MED toward only R2 
R2 have two path one for R4 and other from R3 via iBGP 
R3 have only one path toward R4, since it path is select as best in it Neighbor R2 then in logic the R2 not need to send it best path to R3 (best path is it from R3)

Screenshot (647).pngScreenshot (648).png

I shut the interface between R2 and R3 then R2 have best path via R4 ONLY and R3 have best path vai R4 ONLY

Screenshot (649).pngScreenshot (650).png

Thanks @MHM Cisco World 

I just do the same things on GNS3 lol

Thanks for that sharing. I have the same conclusion as you.

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

Understood, since the MED value is higher  the R2 will not advertise 4.4.4.0/24 to R3(because it is not best path)

Thanks for helping me out, Have a nice day...

have a nice new year eve 
MHM

Review Cisco Networking for a $25 gift card