[c-nsp] BGP Path Selection and next-hop reachability (IGP vs BGP)

Pete Templin petelists at templin.org
Sat Dec 1 12:49:24 EST 2012


On 11/30/12 7:15 PM, John Neiberger wrote:
> I thought I'd post an update since I found my answer. Marko Milivojevic
> answered on another mailing list. As it turns out, the router still
> compares metrics for the next hop even if they're not both learned from
> IGPs. So, the path with an OSPF metric of 101 is losing out to a path with
> a BGP-learned next hop with a MED of 0. I wouldn't have expected that
> behavior at all!

I'll certainly defer to Marko, but I think your next-to-last sentence 
should finish with "with an IGP metric of 0".  IGP metric and MED are 
two separate concepts, which unfortunately appear in the 'sh ip b' 
output both as "metric":

R2#show ip bgp 100.100.100.0/24
BGP routing table entry for 100.100.100.0/24, version 12
Paths: (3 available, best #3, table Default-IP-Routing-Table)
Flag: 0x900
   Advertised to update-groups:
         1    2    3
   Local, (Received from a RR-client)
     5.5.5.5 (metric 102) from 5.5.5.5 (100.100.100.100)
       Origin incomplete, metric 0, localpref 100, valid, internal

Here, "(metric 102)" is the IGP cost to egress point, and "metric 0" is 
the BGP MED value.

When the IGP path disappears and the router reverts to 0/0 as 
reachability for the egress point, (metric 102) becomes (metric 0), 
which as 0 disappears from the command output.

R2#show ip bgp 100.100.100.0/24
BGP routing table entry for 100.100.100.0/24, version 13
Paths: (3 available, best #1, table Default-IP-Routing-Table)
Flag: 0x900
   Advertised to update-groups:
         1    2    3
   Local, (Received from a RR-client)
     5.5.5.5 from 5.5.5.5 (100.100.100.100)
       Origin incomplete, metric 0, localpref 100, valid, internal, best

It sounds to me like you're experiencing stale BGP routes.  You might 
want to explore shortening your BGP timers and/or whether BFD would 
allow BGP to dump paths learned from an (now-unreachable) OSPF neighbor.

Or, random thought, no idea if this would work, what if you put "ip ospf 
cost 103' on the interface towards the source of your EBGP 0/0? 
Grabbing at straws here...coffee hasn't kicked in.

Also, what about carrying 0/0 in OSPF instead?

pt




More information about the cisco-nsp mailing list