Simpler Failover for two Gateways I found working

Indeed, just reading this over again, funny how we follow threads like crumbs on a trail LOL.
It would seem based on Ammo's input, that my new preferred course of action is to
Combine Netwatch with Masquerade as the default failover approach.
It can react faster than simple recursive, is easy more intuitive to config, clears existing connections effectively.
Exceptions:
flaky in and out connections --> use srcnat vice masquerade
real time needs --> not likely a router solution to start with ( like who has two cables to ones PC) :stuck_out_tongue_winking_eye:

+++++++++++++++++++++++++++++
As per Jaclaz but with MORE REALISM! - thus for starters, assuming dynamic ISPs, the only difference is that the initial gateway IP suffices but will not in the future. We take care of this detail outside this work but in the IP DHCP or pppoe script areas where we use comments to update the gateway IP, when it changes for whatever reason. In this case using two comments PW and CHECK WAN1, for ISP1 and SW and CHECK WAN2 for ISP2. Thus the comments on the appropriate lines below is for that purpose, not for the purpose of pure failover ( added at end for completeness )

  1. Prerequirements:
  • Network with DHCP done by MicroTik (in this case: 192.188.1.0/24)
  • Standard Gateway in DHCP will be the MikroTik (here: 192.188.1.1)
  • Internet available at (for Example) 192.168.1.1 ( starting off WANIP ISP1 )
  • Internet available at (for Example) 192.168.2.1 (starting off WANIP ISP2 )
  • Both interfaces connected to the two devices above characterized as WAN in interface list and masqueraded in /ip firewall nat
  1. Routing: My approach assumes that the second WAN will likely be used regardless if WAN1 is the primary for most traffic, so unlike jaclazs approach I prefer to keep both enabled/up/available. Typically and again, outside this narrow scope, mangling or routing rules (plus table and routes) would be used for
    such extra needs. Routes are shown as an example.
  • Standard Route distance=2 0.0.0.0/0 set to gwy-IP=192.168.1.1 comment=PW
  • Narrow Route 8.8.4.4/32 set to gwy-IP=192.168.1.1 with Distance 2 comment=PW
  • Narrow Blackhole route 8.8.4.4/32 with Distance 3
    ====================
  • Standard Route distance=4 0.0.0.0/0 set to gwy-IP=192.168.2.1 comment=SW
  • Narrow Route 1.0.0.1/32 set to gwy-IP=192.168.2.1 with Distance 4 comment=SW
  • Narrow Blackhole route 1.0.0.1/32 with Distance 5
  • +++++++++++++++++++
  • (additional special table routes if required, for traffic going to WAN2 regardless)
    add dst-address=0.0.0.0/0 set to gwy-IP=192.168.2.1 routing-table=To-WAN2 comment=SW
    add distance=2 dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-table=To-WAN2 comment=PW
  1. ~~ 3.Go to TOOLS → NETWATCH ( to improve timeliness, event occurs after 15 sec )

/tool netwatch
add comment="CHECK WAN1" down-script="/ip route disable [find dst-address=0.0.0.0/0 and gateway=192.168.1.1]" host=8.8.4.4 type=simple interval=15s Timeout=5s
up-script="/ip route enable [find dst-address=0.0.0.0/0 and gateway=192.168.1.1]
/tool e-mail send to=youremail@address subject=“Primary WAN" body=“Now back UP”

/tool netwatch
add comment="CHECK WAN2" down-script="/ip route disable [find dst-address=0.0.0.0 and gateway=192.168.2.1]" host=1.0.0.1 type=simple interval=10s Timeout=5s
up-script="/ip route enable [find dst-address=0.0.0.0/0 and gateway=192.168.2.1]"
/tool e-mail send to=youremail@address subject=“Secondary WAN" body=“Now back UP”

+++++++++++++++++++
for the IP DHCP script example:

ISP1
:if ($bound=1) do={
:local gw $"gateway-address"
/ip route set [ find comment="PW" gateway!=$gw ] gateway=$gw
/ip route set [ find comment="CHECK WAN1" gateway!=$gw ] gateway=$gw
/tool e-mail send to="youremail@address" subject=([/system identity
get name]) body=" This is your new gateway IP: $gw";
:local sub3 ([/system clock get time])
}

ISP2
:if ($bound=1) do={
:local gw $"gateway-address"
/ip route set [ find comment="SW" gateway!=$gw ] gateway=$gw
/ip route set [ find comment="CHECK WAN2" gateway!=$gw ] gateway=$gw
/tool e-mail send to="youremail@address" subject=([/system identity
get name]) body=" This is your new gateway IP: $gw";
:local sub3 ([/system clock get time])
}