Routing - what is recursive routing

Recursive routing takes place when multiple router lookups are necessary to determine the exit interface of an outgoing packet from a router. For example, refer to the following topology:


R3 has a loopback interface that we want to reach from R1. Static routing will be configured in R1 so that this destination is reachable. The static routes configured in R1 are the following:

R1(config)#ip route R1(config)#ip route

The first static route is used to reach the L0 interface of R3 and has a next hop address of, which is the** FastEthernet0/0 interface of R3**. Notice the next hop address of this entry is** not on a directly connected network**.

The second static route is required to be able to reach that next hop address of Examine the routing table of R1:

R1#show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 -IS-IS level-2 ia - IS-IS inter area, * - candidate default, per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set C is directly connected, FastEthernet0/0 is subnetted, 1 subnets S [1/0] via S [1/0] via

Whenever R1 wants to reach, three lookups must take place:

  • The first lookup is to check the entry for /24. It’s there and the next hop IP address is
  • The second lookup is to determine how to get to that next hop IP of There’s an entry there and the next hop IP address is
  • The third and last lookup is for There’s an entry and it is directly connected.

Note the following:

  • The last lookup in a recursive lookup scenario is always a lookup that results in an exit interface.
  • Any entry with a next hop IP address will always require a recursive lookup to determine the exit interface.
  • The only entry that does not require a recursive lookup is one with an explicitly defined exit interface. For example: ip route fastethernet 0/0