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
Just basically need to check if the connection is active or not… The IP-assigned route does not work, any other way to see if a connection is up / down?
I use netwatch for watching my other connections, but in this scenario it won’t work due to the fact that the backup line is not always connected. I know I can have a watch on my primary line, but this can also cause havoc…
All I need is to get the STATUS of a pppoe-client connection. On the Interface page, whether is is R (Running) or not… I cannot find any script that can return the ‘Status’ of an interface.
:local dns-ip [/ip dns static get [/ip dns static find name $dns-name] address]
:local pppoe1-status ([/interface pppoe-client get [/interface pppoe-client find name $pppoe1-name] running ])
:local pppoe2-status ([/interface pppoe-client get [/interface pppoe-client find name $pppoe2-name] running ])
:local pppoe2-dg ([/interface pppoe-client get [/interface pppoe-client find name $pppoe2-name] add-default-route])
:local pppoe2-dns ([/interface ppoe-client get [/interface pppoe-client find name $pppoe2-name] use-peer-dns])
:if ($pppoe1-status = false) do {/interface pppoe-client enable [/interface pppoe-client find name $pppoe1-name]
:if ($pppoe2-dg = false) do [/interface pppoe-client set [/interface pppoe-client find name $pppoe2-name] add-default-route=yes]
:if ($pppoe2-dns = false) do [/interface pppoe-client set [/interface pppoe-client find name $pppoe2-name] use-peer-dns=yes]
:if ($pppoe2-status = false) do [/interface pppoe-client enable [/interface pppoe-client find name $pppoe2-name]]
:if ($dns-ip = 196.26.208.190) do [/ip dns static set [/ip dns static find name $dns-name] address 196.30.31.207]
:log info “Running on IBurst!”} else={:if ($pppoe2-dg = true) do [/interface pppoe-client set [/interface pppoe-client find name $pppoe2-name] add-default-route=no]
:if ($pppoe2-dns = true) do [/interface pppoe-client set [/interface pppoe-client find name $pppoe2-name] use-peer-dns=no]
:if ($pppoe2-status = false) do [/interface pppoe-client enable [/interface pppoe-client find name $pppoe2-name]]
:if ($dns-ip = 196.30.31.207) do [/ip dns static set [/ip dns static find name $dns-name] address 196.26.208.190]
}