Routing – Using Non-Recursive BGP Route for Next-Hop Determination

bgpnext-hoprouterrouting

In BGP recursive scenario, the recursive route is taking an unexpected next-hop. Here is the routing table:

S* 0.0.0.0/0 [10/0] via 10.10.10.1, wan

B 172.16.5.0/24 [20/0] via 172.80.80.1, MPLS, 2d18h20m

B 192.168.250.0/24 [20/0] via 172.16.5.1 (recursive via 10.10.10.1), 1d1h10m

The next-hop of the recursive route should be the second route in the table which is another BGP route. However, it's taking the default route on top.

When adding a static route which is exactly the same as the second BGP route, next-hop is determined correctly:

S* 0.0.0.0/0 [10/0] via 10.10.10.1, wan

S 172.16.5.0/24 [20/0] via 172.80.80.1, MPLS

B 192.168.250.0/24 [20/0] via 172.16.5.1 (recursive via 172.80.80.1), 1d1h10m

Is this an expected behavior?

Best Answer

IOS will not use another BGP route for recursive lookup for a BGP route. This is somewhat hinted at in the "Why Routers Ignore Paths" section of the "BGP Best Path Selection Algorithm" documentation:

[Routers ignore] paths for which the NEXT_HOP is inaccessible.

Be sure that there is an Interior Gateway Protocol (IGP) route to the NEXT_HOP that is associated with the path.

So yes, this is expected behavior on IOS. Other routing platforms may behave differently. There is also an article describing further how the lookup works.

Related Topic