Hello Matteo
There are several ways in which you can resolve the recursive routing problem. As stated in the lesson, these include:
- Don’t advertise the tunnel destination IP address on the tunnel interface. Don’t advertise it or use route filtering.
- Make sure the administrative distance of the tunnel destination IP address through the tunnel is higher (worse) than what you have in the routing table now.
- Make sure the metric to the tunnel destination IP address through the tunnel is worse than what you have in the routing table now.
These suggestions are based on the use of RIP as the routing protocol. But because RIP doesn’t establish neighbor adjacencies, it is somewhat different for OSPF. The first suggestion will not work with OSPF because then the adjacency won’t form over the link.
The other two however are possibilities. My suggestion would be to do the following:
In R1, create a more specific static route to the tunnel destination of R2 via the physical interface. Specifically:
R1(config)# ip route 172.16.10.2 255.255.255.255 10.0.149.1 gigabitethernet 0/0
(I’m assuming the IP address of Gi0/0 of the Internet router is 10.0.149.1)
And do the same (in reverse) for R2:
R2(config)# ip route 10.0.149.220 255.255.255.255 172.16.10.1 gigabitethernet 0/1
(I’m assuming the IP address of Gi0/1 of the Internet router is 172.16.10.1)
Now, because the static route has a lower AD than the OSPF route, the physical interface will be used for all traffic to the tunnel destination IPs in both directions. Note that this will only change the routing for that particular destination. That’s why we made the static route so specific. All other OSPF routing will remain the same, i.e. over the tunnel, which is the result we want.
Alternatively you can change the metric that OSPF gives for that particular destination as well using a route map, but that is slightly more complex.
I hope this has been helpful!
Laz