I'm using MikroTik for a year now, and until now I din't need to use "special" scripts. All these, which is available in the net was satisfying, but this time I can't find anything apropriate. Let's start from the beginning.
From 2 weeks I am facing issues with my ISP. It disconnects my ADSL modem and doesn't want to reconnect. Well, it looks like it is still connected (all the LEDs are on, modem web interface says "CONNECTED"), the only problem is, that there is no route to the Internet. There are only 2 things that can help:
1) modem restart,
2) PPPoE client restart on MikroTik (disable then enable the PPPoE connection).
I have already applied a claim to ISP, but of course it will take time when they will start doing anything. There was no problem when I was at home all the time, but now it will change. I need the MikroTik to check ping, and whenever it fails (ususaly after every 24-27 hours), disable and enable PPPoE interface. Here is configuration of my Interfaces:
Code: Select all
interface print
Flags: D - dynamic, X - disabled, R - running, S - slave
# NAME TYPE MTU L2MTU MAX-L2MTU
0 R ;;; WAN
ether1 ether 1500 1526 1526
1 R ;;; LAN
wlan1 wlan 1500 2290
2 ;;; VPN
PPTP VPN pptp-in
3 X ;;; WAN
Multimedia pppoe-out
4 ;;; HotSpot
wlan2 wlan 1500 2290
I have something in the net in the meantime, but I think it needs a bit of correcting.
Code: Select all
:local int3 "Multimedia"; :local ip1 "8.8.8.8";
# watchdog
:if ([/ping $ip1 count=3] = 0) do={
/interface disable $int3;
delay delay-time=3;
/interface enable $int3;
}
How to add this (coreected) script to scheduler, to make it work all the time, so it react immediately, when the connection is lost?
Thanks in advance.
Seems this one will be easier:
Code: Select all
:if ([/ping 8.8.8.8 count=3] = 0) do={
/interface disable Multimedia;
delay delay-time=2;
/interface enable Multimedia
}