I’m setting up an hAP ax2 with dual WAN failover. A Netgear LM1200 modem is on ether2, configured with a DHCP client. The DHCP client script updates the gateway for a route:
:if ($bound=1) do={
/ip route set [find where comment="dhcp2"] gateway=$"gateway-address" disabled=no
/ip route set [find where comment="LM1200"] gateway=$"gateway-address" disabled=no
} else={
/ip route set [find where comment="dhcp2"] disabled=yes
/ip route set [find where comment="LM1200"] disabled=yes
}
I can access the admin service for the LM1200 at its gateway IP address; however, I need to set up a static IP address, 10.1.10.106, since the gateway address is variable. But adding the route:
The way I read the route you posted is:
to reach the IP address 10.1.10.106/32 you have to go through gateway x.y.z.1
But 10.1.10.106 is assigned to ether2?
Im a bit confused by the approach.
Why are you putting script on LAN subnets DHCP when the proper place to address routing is the WANs??
Is it that you want users to always use the primary and if that is not available then use the backup WAN??
This is one of the common approaches and would look like so…
In this setup, all users will always go out WAN1, unless its not reachable and traffic diverted to WAN2, until WAN1 comes back online.
The only reason for scripts is if the the ISP WANs, do not update the gateway IP automatically when the IP changes ( assuming dynamic WANIPs of course )