03-14-2013 05:56 AM - edited 03-04-2019 07:17 PM
Hello,
If router get the same prefix from 3 sources in two cases:
case A
- ebgp med 100
- ospf
- ibgp med 100
case B
- ospf
- ibgp med 100
- ebgp med 80
AD is default, which path will be chosen in which order ? I put source protocol in order which i suppose is correct. Am i right ?
thanks for help
Peter
03-14-2013 06:15 AM
AD is going to be the winner when talking about different protocols. In your case, the order of preference would be:
ebgp
ospf
ibgp
Look at the following article for when med is used:
http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080b79d32.shtml
HTH,
John
*** Please rate all useful posts ***
03-14-2013 06:15 AM
Hi,
in both cases it will depend which path BGP considers as best then the router will consider AD to install the route in the RIB:
if the BGP best path was the iBGP then OSPF will win but if the best path was eBGP then BGP will win.
in case A if there is a tie up to MED then the eBGP route will be considered best path
in case B if there is a tie up to MED then the lower MED will win
Regards
Alain
Don't forget to rate helpful posts.
03-14-2013 06:47 AM
Alain,
I labbed this up and to my surprise got a totally different result than what I was expecting and was hoping you could shed some light on it.
I have 3 routers:
one with ibgp
one with ebgp
one with ospf
All of them are advertising 1.1.1.1/3 and all are peering with a single router with subinterfaces. I would have though once the external bgp neighbor came up, the router would put it in the RIB, but the ospf route is staying and I'm getting a RIB failure:
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.168.1.1 4 1 9 8 3 0 0 00:05:16 1
192.168.2.2 4 2 9 9 3 0 0 00:05:13 1
R4#sh ip ospf neigh
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 1 FULL/DR 00:00:35 192.168.3.3 FastEthernet0/0.30
R4#sh ip bgp rib-failure
Network Next Hop RIB-failure RIB-NH Matches
1.1.1.1/32 192.168.1.1 Higher admin distance n/a
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
r 1.1.1.1/32 192.168.2.2 0 0 2 i
r>i 192.168.1.1 0 100 0 i
R4#sh ip route 1.1.1.1
Routing entry for 1.1.1.1/32
Known via "ospf 1", distance 110, metric 11, type intra area
Last update from 192.168.3.3 on FastEthernet0/0.30, 00:03:18 ago
Routing Descriptor Blocks:
* 192.168.3.3, from 1.1.1.1, 00:03:18 ago, via FastEthernet0/0.30
Route metric is 11, traffic share count is 1
Being that the AD is higher than ebgp, I'm wondering why the routing table isn't being updated. Any thoughts?
03-14-2013 07:12 AM
Hello John,
I think that your case is:
- iBGP route win over eBGP because of AS_PATH, 0 vs 1
- OSPF route wins over iBGP because of lower AD
So overall winer is OSPF route.
In general, Alain mentioned rules which apply when deciding which routes will be in routing table and which will not, so Alain is right.
Best Regards
Please rate all helpful posts and close solved questions
03-14-2013 07:14 AM
You are EXACTLY correct. I've been playing around with things after posting that and that's what I noticed.
03-14-2016 09:21 PM
Hi Alain,
Hope you are doing fine, are you working in networking now?
Wish you all the best!!
03-14-2013 08:49 AM
Regards, Peter
The question presents some ambiguity, however if we separate two ecenarios.
1) The router must select a route for RIB table and the route is learned by various routing protocols. For example: OSPF, eBGP, iBGP.
Here it is useful the following link: http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094823.shtml
2) The router will select a route from the BGP table that have different origins (whether you use the network command or redistribute the BGP routing protocol) for RIB table.
Here it is useful the following link:
http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094431.shtml
http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080b79d32.shtml
Importantly, the route selection algorithm used by BGP, takes multiple criteria in a sequential order where the MED (metric in BGP), which is located in 6th place of criteria to compare or take into account, it makes it unlikely in the selection, unless multiple conditions are met and / or use the command
---------------
Importantly, the response was preparing and translating had to go because my native language is Spanish. Respond when I saw that you already rated it respodieron correctly and then you gave important information to give you an answer.
But I did not stop publishing my response, I mention two technical documents that can be valuable to other people who see the future discucion.
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