In this morning’s lab exercise I intentionally designed and configured a network to cause recursively looped routing lookups. When I started the experiment, I did not know this is the term for this condition. I simply wanted to see what would happen if the route to the destination was also the route to the next hop address.
The design I settled on would cause R2 to have a recursive loop condition when trying to forward packets to 172.16.0.0/16. The 3750 in BGP AS 65002 has an SVI configured for 172.16.1.1/16. This switch also has a static route for 172.16.0.0/16 null0 so the BGP “network” statement would be effective. As you can see, this prefix overlaps with the subnet used on the link between R1 and R3. R1’s interface toward R3 is using 172.16.0.1. Since R1 and R2 are peering via iBGP and next-hop-self is not configured, R2 will attempt to install a route to 172.16.0.0/16 with 172.16.0.2 as the next hop. This caused a CEF “recursive-looped” condition and 172.16.1.1 is unreachable via R2.
Below are some of my CLI, Syslog and traceroute observations:
Critical condition syslog appeared: “*Feb 4 12:23:13.147: %IPRT-3-RIB_LOOP: Resolution loop formed by routes in RIB”
RoutingLoop_R2#show ip route 172.16.1.1
Routing entry for 172.16.0.0/16
Known via “bgp 65001”, distance 200, metric 0
Tag 65002, type internal
Last update from 172.16.0.2 00:07:06 ago
Routing Descriptor Blocks:
- 172.16.0.2, from 10.0.0.1, 00:07:06 ago
Route metric is 0, traffic share count is 1
AS Hops 1
Route tag 65002
MPLS label: none
RoutingLoop_R2#show ip route 172.16.0.2
Routing entry for 172.16.0.0/16
Known via “bgp 65001”, distance 200, metric 0
Tag 65002, type internal
Last update from 172.16.0.2 00:07:18 ago
Routing Descriptor Blocks:
- 172.16.0.2, from 10.0.0.1, 00:07:18 ago
Route metric is 0, traffic share count is 1
AS Hops 1
Route tag 65002
MPLS label: none
RoutingLoop_R2#show ip route loops
->default:ipv4:base 172.16.0.0/16 -> base 172.16.0.2 bgp 00:42:52 N
RoutingLoop_R2#
RoutingLoop_R2#show ip cef 172.16.0.0
172.16.0.0/16
unresolved via 172.16.0.2
recursive-looped
RoutingLoop_R2#
RoutingLoop_R2#show ip cef 172.16.0.2
172.16.0.2/32
unresolved via 172.16.0.0/16
recursive-looped
RoutingLoop_R2#show ip cef unresolved detail
IPv4 CEF is enabled and running
VRF Default
23 prefixes (23/0 fwd/non-fwd)
Table id 0x0
Database epoch: 0 (23 entries at this epoch)
172.16.0.0/16, epoch 0, flags [cover dependents, rib only nolabel, rib defined all labels]
Covered dependent prefixes: 1
notify cover updated: 1
recursive via 172.16.0.2, unresolved
recursive-looped
172.16.0.2/32, epoch 0
1 RR source [active source]
Dependent covered prefix type rr, cover 172.16.0.0/16
recursive via 172.16.0.0/16, unresolved
recursive-looped
Traceroute from the Raspberry Pi using R2 as its gateway router
pi@routerberrypi:~ $ traceroute 172.16.1.1
traceroute to 172.16.1.1 (172.16.1.1), 30 hops max, 60 byte packets
1 10.0.1.2 (10.0.1.2) 0.613 ms 0.448 ms 0.405 ms < R2’s LAN side IP
2 * * *
3 * * *
4 * * *
5 * * *
6 * * *
7 * * *
8 * * *
9 * * *
10 * * *
11 * * *
12 * * *
Lines omitted for brevity
pi@routerberrypi:~ $ ping 172.16.1.1
PING 172.16.1.1 (172.16.1.1) 56(84) bytes of data.
^C
— 172.16.1.1 ping statistics —
5 packets transmitted, 0 received, 100% packet loss, time 187ms
Reconfigured the Pi to use R1 as its next hop and the SVI on the AS 65002 switch is reachable.
pi@routerberrypi:~ $ sudo ip route del 172.16.0.0/16 via 10.0.1.2
pi@routerberrypi:~ $ sudo ip route add 172.16.0.0/16 via 10.0.1.1
pi@routerberrypi:~ $ traceroute 172.16.1.1
traceroute to 172.16.1.1 (172.16.1.1), 30 hops max, 60 byte packets
1 10.0.1.1 (10.0.1.1) 0.513 ms 0.397 ms 0.308 ms
2 172.16.0.2 (172.16.0.2) 0.755 ms 0.613 ms 0.591 ms
3 192.168.2.2 (192.168.2.2) 0.874 ms * *
pi@routerberrypi:~ $ ping 172.16.1.1
PING 172.16.1.1 (172.16.1.1) 56(84) bytes of data.
64 bytes from 172.16.1.1: icmp_seq=1 ttl=253 time=1.06 ms
64 bytes from 172.16.1.1: icmp_seq=2 ttl=253 time=1.01 ms
64 bytes from 172.16.1.1: icmp_seq=3 ttl=253 time=1.01 ms
^C
— 172.16.1.1 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 5ms
rtt min/avg/max/mdev = 1.008/1.026/1.062/0.036 ms