My question is, can we do failover with this 3 WAN connections, without using balancing? If WAN1 is unaccessable, it should switch to WAN2, and if both WAN1 and WAN2 are down, it should switch to WAN3 3g. When WAN1 or WAN2 is up, it should switch back from 3g router.
Is it possible to do this without writing a script, or somebody already did some configuration similar like this? Can somebody send me a link with a similar configuration?
/ip firewall nat
add chain=srcnat chain=srcnat out-interface=WAN1 to-addresses=10.1.1.2
add chain=srcnat chain=srcnat out-interface=WAN2 to-addresses=10.2.2.2
add chain=srcnat chain=srcnat out-interface=WAN3 to-addresses=10.3.3.2I know you have static IPs, but in the event that someone would need to do this with dynamic WAN addresses, just run a script periodically to check your WAN IP(s) and update your NAT rule(s).
Just to be clear, if you have two or more ISP’s coming in and you want them configured for weight based failover…
The only way RouterOS will support this is by setting a static IP and distance, or if dynamic WAN addresses you must run a script to periodically check for a new address and update the route and NAT table appropriately.
Correct?
If yes, is there a reason the distance can’t be set on a dynamically assigned IP? (beyound RouterOS won’t let you)
Yes, with static routes, I believe this would be the only way. To disable a gateway, you’ll need to use the check-gateway option. Without a valid GW IP, this won’t work, and the route will not fail over to the next gateway.
RouterOS will not let you set the distance on a route installed by the dhcp client. The DHCP client in a generic Linux box does have the ability to run a script, which would allow you to do so.
It would be nice if MT would have a hook in the dhcp client to run a script. Useful not only for setting route information, but would also be a nice place for poeple to update their dynamic DNS servers and update any DST NAT rules.