Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this article, we will look at another advanced method of failover using recursive routing and scopes from the routing section. Recursive routing occurs when a rout (either static or dynamically learned) has a next-hop that is not directly connected to the local router. In RouterOS,  nexthop nexthop lookup is done only in the main routing the main routing table, even for routes with different values of routingof routing-mark. It is necessary to restrict a set of routes that can be used to look up immediate nexthops. Nexthop values of RIP or OSPF routes, for example, are supposed to be directly reachable and should be looked up only using connected routes. This is achieved using a scope and target-scope propertiesusing scope and target-scope properties.

Setup Overview

Let`s assume we have the following setup: our gateway device has two public network uplinks. Then we mark traffic in two parts, one with the name "ISP1" and the second as "ISP2" which goes through the ether1 and ether2 accordinglyether2 accordingly. In this setup, we want to monitor two hosts: Host1 and Host2. We will use Google DNS servers with IP 8.8.8.8 (Host1) and 8.8.4.4 (Host2), but it is not mandatory to use specifically these addresses.


Image Modified

Before detailed example overview, in a setup where we have private IP addresses behind the public IP, we should configure source NAT:

...

Code Block
languageros
/ip/route/ 
add dst-address=8.8.8.8 scope=10 gateway=10.111.0.1
add dst-address=8.8.4.4 scope=10 gateway=10.112.0.1

Now configure routes which that will be resolved recursively, so they will only be active when they are reachable with ping:

...