Routing FailOver with 2 ISP (gateway) - MikroTik Script RouterOS

Using more than one internet gateway (ISP) allows us to fail over where one link can be used as the main gateway and the other becomes the backup link. For these needs, the usual configuration is to define a check-gateway and differentiate the distance value for each routing rule.

WAN-1 = IP
WAN-2 = IP

/ip route
add check-gateway=ping distance=1 gateway= target-scope=10
add check-gateway=ping distance=2 gateway= target-scope=10