2 WAN Failover Script :: Problem

GW1 - 10.1.1.1 (Goes to ADSL modem so this is a private IP)
GW2 - 203.114.162.1 (Public IP address)

How can I successfully do failover with GW1 being my primary GW and GW2 being the failover?
Someone suggested I use check-gateway PING for GW1 and Distance 2 for GW2, problem is if the ADSL modem is still powered on but the ADSL connection is dead for whatever reason it will still think its active.. how can I make it ping the actual WAN address?

Put the adsl modem in bridge mode and use the mikrotik pppoe client to call the line.
This way you know when the pppoe-client1 interface or whatever is called is up and running and when not.
You should have ppp packet installed and enabled on the router.

Modem uses PPPoA

what would that be ? pppoa ? point to point over adsl ?!?

Point to Point Protocol over ATM

but i think as you said “jorj” , your solution will work because there is no big different between PPPoA and PPPoE, we tested this solution ‘not the WAN Failover Script but PPPoE’ several times and its work good.

For me it is working.
And even if you don’t get a fixed ip from your provider, usually you get the same gateway everytime. Or there is a tax for fixed ip. And you can check that gateway.
Now, the trouble is that you cannot always test the gateway with ping, cause it can be reached sometimes trough the other link you have. This is for me. So you should check if the ppp interface is up and running, and you’re done.

/system script add name=gw_1 source={/ip route set [/ip route find comment=“Default Route To Internet”] gateway 10.1.1.1}
/system script add name=gw_2 source={/ip route set [/ip route find comment=“Default Route To Internet”] gateway 203.114.162.1}
/tool netwatch add host=203.114.162.1 interval=10s timeout=998ms up-script=gw_2 down-script=gw_1

That would partially resolve the issue. 10.1.1.1 should be, from what i see, the adsl router. Pinging it will always reply, even if it is not connected to the other end. It is the local address of the modem. The address on the other side of the modem cannot be known this way. Also you cannot verify if it is even connected.

Not need to “ping 10.1.1.1”. Default gateway is always into Public IP. Script
just check is Public IP reachable. If not it change default to 10.1.1.1

Public ip - the gateway of the adsl modem might be reached trough the other gateway, and thus answer to ping even if the adsl is down.

If you want to say public ip meaning the public ip assigned to the adsl modem, than this could be one answer, if the ip is known, and not dynamic.