6

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?

5

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.

  • Thanks. This was useful. I wonder if this is a standard BGP behavior or vendor specific. – onlyforthis Mar 21 at 8:18
  • @onlyforthis: I suspect it's mostly standard. For example, RouterOS requires the nexthop scope to be lower than the route's own. – grawity Mar 21 at 14:01
  • @onlyforthis It depends on the vendor, Juniper can use BGP routes for recursive lookup. If this answers you question please accept it as answer. – Sebastian Wiesinger Mar 21 at 15:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.