I have a scenario (see attached image) where I have 3 routers, and 3 networks:
router 1<---Network A---> router 2 <--- Network B ---> router 3 <--- Network C ---> route 1
My question is, Router 2 for example is directly connected to Network A, but if it's interface that is connected to Network A is down it can reache that Network through router 3 that reaches it through router 1.
This is easly done, I have my automatic routes in router 2 routing table because it is directly connect to network A, then I add a static route to network A through router 3 with an higher metric, and when the router 2 interface that is connected to network A goes down, the static route takes place and everything works. However if the interface connected to network A in router 2 does not go down, but instead the problem occurs for example in the connection between the switches then router 2 does not detect this does not apply the static route.
What I would like is to apply the static route no when the physical interface link goes down, but when the other router becomes unreachable.
Is there any way to do this?
This should be made with configurations only in router 2 because that is the only router controled by me at this point, all the switches in my example are just for demonstrating the scenario, in fact I do not know what is between my two routers, there is a cloud of network devices from the ISP .
Is there any way of aplying the static route when the logical link goes down?