simple routing problem

I have server connected with failover (bonding = one IP ). Main server interface is connected through secondary router and secondary server interface is connected through wifi directly to mikrotik. How to make simple routing policy decision as follow:

  • If server is not answering through secondary router gateway then disable static route (and enable if server start answering). Let’s assume secondary router gateway is always pingable.

I have one dynamic route to wifi server network and secondary static to server IP via secondary router gateway with default scope=30 and target-scope=10

When i simulate failure - bring main server interface down I have to manually disable static route to secondary router to work. I have already tried ip/route:

  • dst-address=server_IP gateway=secondary_router_IP scope=10 target-scope=10


  • dst-address=server_IP gateway=server_IP check-gateway=ping scope=11 target-scope=11

but without success. Check gateway route become inactive on failure (as supposed) but it does nothing (not related) to first route. How to do it right with ROS 7.11.2 ?

PS.
When i start changing scope and target scope sometimes main default rote gone and autosupout.rip is created. Looks like ROS crashed. Still terribly buggy, definitely not stable.

What are the distance values for all routes?
Try a larger distance value for backup route.

Backup route is through wifi interface and this is dynamically created route to wifi network so distance=0
Main route is static route to server_IP and distance=1

Dynamically created routes can’t be changed. I can add additional static route through backup wifi but setting larger distance imho will be even worse because I can’t make ROS to route traffic through backup wifi network, because router always consider that static route to server_IP is always valid (can always reach secondary router).