GRE - Recursive routing error - AD solution
One of the solutions to the GRE - Recursive routing error is to make sure the AD of the tunnel destination IP address through the tunnel is higher (worse) than what you have in the routing table, thus the router will not choose the tunnel itself as the path to reach the tunnel endpoint:
Based on this topology, the following configurations would resolve the issue assuming we are using RIP:
interface Tunnel0 ip address 192.168.13.1 255.255.255.0 tunnel source 22.214.171.124 tunnel destination 126.96.36.199 router rip version 2 network 188.8.131.52 network 192.168.12.0 network 192.168.13.0 no auto-summary distance 150 192.168.13.1 0.0.0.0
Here, we've set the AD for routes learned via the tunnel interface on R1 to
150. The command
distance 150 192.168.13.1 0.0.0.0 tells RIP on R1 to assign an AD of 150 for any routes learned through the interface with IP
192.168.13.1 (the tunnel interface).
interface Tunnel0 ip address 192.168.13.3 255.255.255.0 tunnel source 184.108.40.206 tunnel destination 220.127.116.11 router rip version 2 network 18.104.22.168 network 192.168.23.0 network 192.168.13.0 no auto-summary distance 150 192.168.13.3 0.0.0.0
Similarly, on R3, we've set the AD for routes learned via the tunnel interface to
By adjusting the AD for routes learned through the GRE tunnel, we can ensure that R1 and R3 prefer routes learned through their direct links to R2, rather than those learned through the GRE tunnel.