Refer to http://forum.mikrotik.com/viewtopic.php?t=7528
I have 2 PPPoE connections on different interfaces. As soon as my primary connection drops, it should connect on my secondary interface.
The proposed solution under refered thread does not work - I cannot work with the IP address of the interface to determine the PPPoE connection status, this IP is fixed...
My complete script is as follows
:global pppoe1-name ADSL_Connection
:global pppoe2-name ADSL_Backup
-- The following statement works ONLY if there is an IP assigned. If not, it bombs out
:local pppoe1-ip [ /ip address get [/ip address find interface=$pppoe1-name] address]
-- If the connection is not established, the rest DOES NOT execute ; not even this log info messages
:log info $pppoe1-ip
:if ([ :typeof $pppoe1-ip ] != nil ) do={
/interface pppoe-client disable [/interface pppoe-client find name $pppoe2-name]
:log info ("Conected to " . $pppoe1-name)
} else={
/interface pppoe-client set [/interface pppoe-client find name $pppoe2-name] add-default-route=yes
/interface pppoe-client enable [/interface pppoe-client find name $pppoe2-name]
:log info ("Conected to " . $pppoe2-name)
}
Any other to check if a connection is active? I have also tried the "get Status" on the pppoe-client interface, doesn't work.