Routing – How to Point a Route to a Next-Hop That Isn’t Directly Attached

routerrouting

Is it possible to point a route to a next hop that isn't directly attached to my router?

For instance:

Router A owns the subnet 10.10.10.0/24
Router A and Router B communicate on the 10.0.1.0/24 subnet
Router B and Router C communicate on the 10.0.2.0/24 subnet

Router C has learned the 10.0.1.0/24 subnet from Router B with Router B as a next hop

Can I put a route for the 10.10.10.0/24 subnet on Router C and point it straight to Router A?

Is Router C smart enough to figure out that it would need to send to Router B to get to Router A? I know the normal practice is to tell Router C that Router B is the next hop for Router A's subnet.

Best Answer

That's called recursive next-hop lookup (or something along those lines) by most vendors. Most equipment will handle that just fine, but its not a particularly good practice to get into for static routing.

FWIW, iBGP typically works this way. The "next-hop" carried in an iBGP session is the next-hop on the far side of the autonomous system and some sort of IGP (typically OSPF, less commonly, IS-IS, RIP, or even static routing) is used to recursively resolve that iBGP next-hop to an immediate next-hop.

If you do too much of this, the gear is having to do more and more layers of recursion to find the real next-hop. I've never really tested any gear to see how many times it would recurse to find a real next-hop, but I wouldn't be surprised if the limit were 3 or 4.

Related Topic