/tool traffic-monitor add name=CheckPPPoE interface=pppoe-out1 traffic=received trigger=always threshold=0 on-event=SystemScriptNameToRun comment="ThanxToSiB" disabled=no
/interface pppoe-client enable pppoe-out1;
This mean the 0 at Rx is your normal behavior and you not gave many traffic/customers behind your device and then TrafficMonitor generate 298 fail-possitive check's I assume.When the threshold 0, the trigger hit run time 298 times
Re-enable TrafficMonitor script or ppppoe interface?re-enable manually and the pppoe connected and back to normal. Any advice please?
Maybe you should change your request.Again happened this morning
Single/One pppoe with ISP in standard situation newer reach 0 and the traffic monitor is good idea to check if problem exist.
You situation I think is other. When you not have a "big transfer" as normal traffic then you should change a checking way. Before, I answer you a generic information to generic question.
This mean the 0 at Rx is your normal behavior and you not gave many traffic/customers behind your device and then TrafficMonitor generate 298 fail-possitive check's I assume.When the threshold 0, the trigger hit run time 298 times
Re-enable TrafficMonitor script or ppppoe interface?re-enable manually and the pppoe connected and back to normal. Any advice please?
I think the pppoe interface - this means the TrafficMonitor generate failse possitive re-enable and ROS cannot do connection?
Maybe the proper way to re-enabled in ROS is disable and separate enable the pppoe interface to do re-connection.
Maybe you should change your request.Again happened this morning
This Rx=0 show at pppoe even when he works well and you have "not use of internet" - this give you info that way of checking interface are bad and you need other way.
Please write more about you situation.
Maybe you should have something like
* Netwatch who will be checking accessibility to remote host?
* Recursive Routing who will be checking this pppoe as accessibility to remote host?
* Own script who will be checking traffic via this pppoe and do action if no-internet will be detected by this intereface.
Many ways but you must write more about your situation.
/system scheduler
add disabled=no interval=20m name=check-ppp-client on-event=":log info message=\"*** start check any ppp client connection ***\";\r\
\n:local pppTest value=[/ppp active find];\r\
\n:local pingNumber value=2;\r\
\n:local pingMin value=1;\r\
\n:foreach userTest in=\$pppTest do={\r\
\n :local pingOk value=[:ping [/ppp active get \$userTest value-name=address] count=\$pingNumber]\r\
\n :if ( \$pingOk < \$pingMin) do={\r\
\n :log warning message=([/ppp active get \$userTest value-name=service] . \" auto disconnected: \". \$pingOk . \" ping ok over \" . \$pingNumber . \" \" . [/ppp active get \$userTest value-name=name] . \" \" . [/ppp active get \$userTest value-\
name=address])\r\
\n /ppp active remove \$userTest\r\
\n }\r\
\n};\r\
\n:log info message=\"*** end check any ppp client connection ***\";\r\
\n" policy=ftp,read,write,test start-date=jan/01/2002 start-time=00:20:00
Re-enable manually the PPPoE, because the TM generate big false re enable.I think the pppoe interface - this means the TrafficMonitor generate failse possitive re-enable and ROS cannot do connection?
Single/One pppoe with ISP in standard situation newer reach 0 and the traffic monitor is good idea to check if problem exist.
You situation I think is other. When you not have a "big transfer" as normal traffic then you should change a checking way. Before, I answer you a generic information to generic question.
This mean the 0 at Rx is your normal behavior and you not gave many traffic/customers behind your device and then TrafficMonitor generate 298 fail-possitive check's I assume.When the threshold 0, the trigger hit run time 298 times
Re-enable TrafficMonitor script or ppppoe interface?re-enable manually and the pppoe connected and back to normal. Any advice please?
I think the pppoe interface - this means the TrafficMonitor generate failse possitive re-enable and ROS cannot do connection?
Maybe the proper way to re-enabled in ROS is disable and separate enable the pppoe interface to do re-connection.
Maybe you should change your request.Again happened this morning
This Rx=0 show at pppoe even when he works well and you have "not use of internet" - this give you info that way of checking interface are bad and you need other way.
Please write more about you situation.
Maybe you should have something like
* Netwatch who will be checking accessibility to remote host?
* Recursive Routing who will be checking this pppoe as accessibility to remote host?
* Own script who will be checking traffic via this pppoe and do action if no-internet will be detected by this intereface.
Many ways but you must write more about your situation.
/interface pppoe-client enable pppoe-out1;
# or
/interface pppoe-client disable pppoe-out1; /interface pppoe-client enable pppoe-out1;
interface pppoe-client print detail
put [interface pppoe-client monitor pppoe-out1 once as-value ]
Hello again,
Give me materials to work, means.
*) What do a proper re-connection?
..Code: Select all/interface pppoe-client enable pppoe-out1; # or /interface pppoe-client disable pppoe-out1; /interface pppoe-client enable pppoe-out1;
- Yes disable and enable pppoe1
*) Internet Detection.
You have internet only from pppoe-out1 and when it's have Rx=0 and Tx=0 then what is a status of this connection?
-Yes I have internet only from pppoe1. When Rx=0 The connection status = Connected
Provide me a cli print without login/pass:.Code: Select allinterface pppoe-client print detail put [interface pppoe-client monitor pppoe-out1 once as-value ]
and/or screenshot from Status tab.
We can connect TrafficMonitor with one of those status infrormation to do proper checking and restarting pppoe.
Alternative will be scheduler and netwatch since.
And main question. In Status Tab is a different value when internet is online?
-- I guess yes
I know Rx=0 but I search some additional who is other in offline and online mode.
But you not share both screenshot to compare.SiB-- I guess yesAnd main question. In Status Tab is a different value when internet is online?
/tool netwatch add host=1.1.1.1 interval=10s timeout=500ms disabled=no comment=InternetWatchDog
/system scheduler remove [find where name~"SiBexInternetWatchDog_"];
/log warning "RESET Netwatch scheduled DOWN-script... ISP WORKS";
log error "start Netwatch DOWN-script...";
# ################ MAIN PROGRAM BELOW, NOT HERE ##############
# ################ DEFINE FUNCTION SOLVING Crossing Midnight ###########################
# Fix Crossing 24:00:00=00:00:00
/local SiBFixDateTime do={
/local SiBTimeToChange "23:45:00";
/local SiBTimeToChange $2;
/local SiBTimeDiffToAdd "60m2s"; # diff time < 24h
/local SiBTimeDiffToAdd $3; # diff time < 24h
#/local SiBDate "dec/31/2020"
/local SiBDate $1
/local SiBDateCorrected;
#log warning ("Source: ".$SiBDate." ".$SiBTimeToChange." + ".$SiBTimeDiffToAdd);
#put ("Source: ".$SiBDate." ".$SiBTimeToChange." + ".$SiBTimeDiffToAdd);
# Add diff time <=24h
/local SiBTimeAndDiffTime ($SiBTimeToChange + $SiBTimeDiffToAdd );
/if ([/len $SiBTimeAndDiffTime]=8) do={/set $SiBDateCorrected ($SiBDate." ".$SiBTimeAndDiffTime); };
/if ([/len $SiBTimeAndDiffTime]>8) do={
/set $SiBTimeAndDiffTime ($SiBTimeAndDiffTime-1d);
## Add 24h to date, copy time if exist.
set $SiBDateCorrected ($SiBDate." ".$SiBTimeAndDiffTime);
# Days: 01-27
local SiBDayToChange [/pick $SiBDateCorrected 4 6;];
if ($SiBDayToChange<=27) do={
set $SiBDayToChange ($SiBDayToChange+1);
if ([/len $SiBDayToChange]=1) do={set $SiBDayToChange ("0".$SiBDayToChange)}
set $SiBDateCorrected ( [/pick $SiBDateCorrected 0 4].$SiBDayToChange.[/pick $SiBDateCorrected 6 20] );
} else={
if ($SiBDayToChange!=31) do={
# Days: 28..30; Main magic do internal scheduler.
/system scheduler remove [find name=SiBTempScheduler2qw34er5v78bn90m];
/system scheduler add name=SiBTempScheduler2qw34er5v78bn90m on-event={nothing } start-time=00:00:01 start-date=( [/pick $SiBDateCorrected 0 4].($SiBDayToChange+1).[/pick $SiBDateCorrected 6 11 ] );
set $SiBDateCorrected ([system scheduler get [find name=SiBTempScheduler2qw34er5v78bn90m] start-date].[/pick $SiBDateCorrected 11 20 ]);
/system scheduler remove [find name=SiBTempScheduler2qw34er5v78bn90m];
} else={
# Day 31 for Jan..Nov
/local SiBMonths ("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec");
/local SiBMounthToChange [/pick $SiBDateCorrected 0 3];
for x from=0 to=10 do={if ([/pick $SiBMonths $x]=$SiBMounthToChange) do={ set $SiBDateCorrected ([pick $SiBMonths ($x+1)]."/01".[/pick $SiBDateCorrected 6 20 ]) }}
# Day 31 for Dec
if ($SiBMounthToChange="dec") do={ set $SiBDateCorrected ("jan/01/".([/pick $SiBDateCorrected 7 11]+1).[/pick $SiBDateCorrected 11 20] )}
};
};
};
#log warning ("New date time: ".$SiBDateCorrected);
#put ("New date time: ".$SiBDateCorrected);
:return $SiBDateCorrected
};
# ################ MAIN PROGRAM ###########################
# Select a proper Netwatch
local LocNetWatchHost 1.1.1.1;
local LocNetWatchHostComment "InternetWatchDog";
# Still is status down?
local LocStatus [/tool netwatch get [find host=$LocNetWatchHost comment=$LocNetWatchHostComment ] status];
if ($LocStatus != "down") do={/quit;}
# Convert the Netwatch SINCE to separate date and time of current down-time.
local LocSince [/tool netwatch get [find host=$LocNetWatchHost comment=$LocNetWatchHostComment status=down ] since];
local LocSinceDate ([/pick $LocSince 0 11]);
local LocSinceTime ([/pick $LocSince 12 20]);
# Add action to future via scheduler
/system scheduler remove [find where name~"SiBexInternetWatchDog_v"];
# Try MAIN ACTION 1 - PPPoE ReEnable after 1m
local SiBCrossMid [$SiBFixDateTime $LocSinceDate $LocSinceTime 1m ];
local SiBStartDate [pick $SiBCrossMid 0 11];
local SiBStartTime [pick $SiBCrossMid 12 20];
/system scheduler add name=SiBexInternetWatchDog_v1 on-event={/interface pppoe-client disable pppoe-out1; /interface pppoe-client enable pppoe-out1;} start-date=$SiBStartDate start-time=$SiBStartTime;
# Try MAIN ACTION 2 - Reboot after 2m
local SiBCrossMid [$SiBFixDateTime $LocSinceDate $LocSinceTime 2m ];
local SiBStartDate [pick $SiBCrossMid 0 11];
local SiBStartTime [pick $SiBCrossMid 12 20];
/system scheduler add name=SiBexInternetWatchDog_2 on-event={/system reboot;} start-date=$SiBStartDate start-time=$SiBStartTime;
log error "stop Netwatch DOWN-script, Future action are scheduled";
WinBox > Tools > NetWatch - here a place with 3 tabs, up and down tab are two script who are running when access to remote host change to up (work) or down (failure).Can we just ignore the rebooting please? Just want to Disable the pppoe and enable it after 25 second
/tool netwatch add host=1.1.1.1 interval=5s timeout=500ms disabled=no comment=InternetWatchDog
/system scheduler remove [find where name~"SiBexInternetWatchDog_"];
/log warning "RESET Netwatch scheduled DOWN-script... ISP WORKS";
log error "start Netwatch DOWN-script...";
# ################ MAIN PROGRAM BELOW, NOT HERE ##############
# ################ DEFINE FUNCTION SOLVING Crossing Midnight ###########################
# Fix Crossing 24:00:00=00:00:00
/local SiBFixDateTime do={
/local SiBTimeToChange "23:45:00";
/local SiBTimeToChange $2;
/local SiBTimeDiffToAdd "60m2s"; # diff time < 24h
/local SiBTimeDiffToAdd $3; # diff time < 24h
#/local SiBDate "dec/31/2020"
/local SiBDate $1
/local SiBDateCorrected;
#log warning ("Source: ".$SiBDate." ".$SiBTimeToChange." + ".$SiBTimeDiffToAdd);
#put ("Source: ".$SiBDate." ".$SiBTimeToChange." + ".$SiBTimeDiffToAdd);
# Add diff time <=24h
/local SiBTimeAndDiffTime ($SiBTimeToChange + $SiBTimeDiffToAdd );
/if ([/len $SiBTimeAndDiffTime]=8) do={/set $SiBDateCorrected ($SiBDate." ".$SiBTimeAndDiffTime); };
/if ([/len $SiBTimeAndDiffTime]>8) do={
/set $SiBTimeAndDiffTime ($SiBTimeAndDiffTime-1d);
## Add 24h to date, copy time if exist.
set $SiBDateCorrected ($SiBDate." ".$SiBTimeAndDiffTime);
# Days: 01-27
local SiBDayToChange [/pick $SiBDateCorrected 4 6;];
if ($SiBDayToChange<=27) do={
set $SiBDayToChange ($SiBDayToChange+1);
if ([/len $SiBDayToChange]=1) do={set $SiBDayToChange ("0".$SiBDayToChange)}
set $SiBDateCorrected ( [/pick $SiBDateCorrected 0 4].$SiBDayToChange.[/pick $SiBDateCorrected 6 20] );
} else={
if ($SiBDayToChange!=31) do={
# Days: 28..30; Main magic do internal scheduler.
/system scheduler remove [find name=SiBTempScheduler2qw34er5v78bn90m];
/system scheduler add name=SiBTempScheduler2qw34er5v78bn90m on-event={nothing } start-time=00:00:01 start-date=( [/pick $SiBDateCorrected 0 4].($SiBDayToChange+1).[/pick $SiBDateCorrected 6 11 ] );
set $SiBDateCorrected ([system scheduler get [find name=SiBTempScheduler2qw34er5v78bn90m] start-date].[/pick $SiBDateCorrected 11 20 ]);
/system scheduler remove [find name=SiBTempScheduler2qw34er5v78bn90m];
} else={
# Day 31 for Jan..Nov
/local SiBMonths ("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec");
/local SiBMounthToChange [/pick $SiBDateCorrected 0 3];
for x from=0 to=10 do={if ([/pick $SiBMonths $x]=$SiBMounthToChange) do={ set $SiBDateCorrected ([pick $SiBMonths ($x+1)]."/01".[/pick $SiBDateCorrected 6 20 ]) }}
# Day 31 for Dec
if ($SiBMounthToChange="dec") do={ set $SiBDateCorrected ("jan/01/".([/pick $SiBDateCorrected 7 11]+1).[/pick $SiBDateCorrected 11 20] )}
};
};
};
#log warning ("New date time: ".$SiBDateCorrected);
#put ("New date time: ".$SiBDateCorrected);
:return $SiBDateCorrected
};
# ################ MAIN PROGRAM ###########################
# Select a proper Netwatch who is ENABLE and have:
local LocNetWatchHost 1.1.1.1;
local LocNetWatchHostComment "InternetWatchDog";
# Still is status down?
local LocStatus [/tool netwatch get [find host=$LocNetWatchHost comment=$LocNetWatchHostComment disabled=no] status];
if ($LocStatus != "down") do={/quit;}
# Convert the Netwatch SINCE to separate date and time of current down-time.
local LocSince [/tool netwatch get [find host=$LocNetWatchHost comment=$LocNetWatchHostComment status=down disabled=no] since];
local LocSinceDate ([/pick $LocSince 0 11]);
local LocSinceTime ([/pick $LocSince 12 20]);
# Add action to future via scheduler
/system scheduler remove [find where name~"SiBexInternetWatchDog_v"];
# Try MAIN ACTION 1 - PPPoE ReEnable after 20s
local SiBCrossMid [$SiBFixDateTime $LocSinceDate $LocSinceTime 20s ];
local SiBStartDate [pick $SiBCrossMid 0 11];
local SiBStartTime [pick $SiBCrossMid 12 20];
/system scheduler add name=SiBexInternetWatchDog_v1 on-event={/interface pppoe-client disable pppoe-out1; /interface pppoe-client enable pppoe-out1;} start-date=$SiBStartDate start-time=$SiBStartTime;
log error "stop Netwatch DOWN-script, Future action are scheduled";
And after beeing connected also to a device behind it so the firewall has to forward a few packets:/interface monitor-traffic ppp-wan once
name: ppp-wan
rx-packets-per-second: 8
rx-bits-per-second: 5.2kbps
fp-rx-packets-per-second: 8
fp-rx-bits-per-second: 5.2kbps
rx-drops-per-second: 0
rx-errors-per-second: 0
tx-packets-per-second: 11
tx-bits-per-second: 101.3kbps
fp-tx-packets-per-second: 0
fp-tx-bits-per-second: 0bps
tx-drops-per-second: 0
tx-queue-drops-per-second: 0
tx-errors-per-second: 0
No issue./interface monitor-traffic ppp-wan once
name: ppp-wan
rx-packets-per-second: 15
rx-bits-per-second: 9.8kbps
fp-rx-packets-per-second: 15
fp-rx-bits-per-second: 9.8kbps
rx-drops-per-second: 0
rx-errors-per-second: 0
tx-packets-per-second: 18
tx-bits-per-second: 166.4kbps
fp-tx-packets-per-second: 5
fp-tx-bits-per-second: 54.2kbps
tx-drops-per-second: 0
tx-queue-drops-per-second: 0
tx-errors-per-second: 0
Stop traffic on pppoe-out1 who stuck on be running but not transfer any traffic. Similar situation is at l2tp tunnels, after reboot the one direction is not work and tunnel must be re-enabled and this can be happend with low probably but I see this in few mth again for years.Tried to understand something out of this "issues" but I just don't get it.
What is the initial issue?
It's symptom. Autor of post cannot write other difference on working and stuck connection without this Rx=0.The FP Tx = 0 ?
On links who have small traffic yes but not if you have got constancy traffic. You mean main optic links in ocean have got sometimes Rx=0 ?That's normal.
Congratulation. Not every ROS and RB works well, I hope your luck will be permanent.While connected to a router which is mostly idle, from outside.:
And after being connected also to a device behind it so the firewall has to forward a few packets:
No issue.
ppp-wan wasn't reconnected since boot. (link downs = 0).
YES, I agree.Weird.
/interface set pppoe-out1 disabled=yes
:delay 25
/interface set pppoe-out1 disabled=no
log error "start Netwatch DOWN-script...";
# ################ MAIN PROGRAM BELOW, NOT HERE ##############
# ################ DEFINE FUNCTION SOLVING Crossing Midnight ###########################
# Fix Crossing 24:00:00=00:00:00
/local SiBFixDateTime do={
/local SiBTimeToChange "23:45:00";
/local SiBTimeToChange $2;
/local SiBTimeDiffToAdd "60m2s"; # diff time < 24h
/local SiBTimeDiffToAdd $3; # diff time < 24h
#/local SiBDate "dec/31/2020"
/local SiBDate $1
/local SiBDateCorrected;
#log warning ("Source: ".$SiBDate." ".$SiBTimeToChange." + ".$SiBTimeDiffToAdd);
#put ("Source: ".$SiBDate." ".$SiBTimeToChange." + ".$SiBTimeDiffToAdd);
# Add diff time <=24h
/local SiBTimeAndDiffTime ($SiBTimeToChange + $SiBTimeDiffToAdd );
/if ([/len $SiBTimeAndDiffTime]=8) do={/set $SiBDateCorrected ($SiBDate." ".$SiBTimeAndDiffTime); };
/if ([/len $SiBTimeAndDiffTime]>8) do={
/set $SiBTimeAndDiffTime ($SiBTimeAndDiffTime-1d);
## Add 24h to date, copy time if exist.
set $SiBDateCorrected ($SiBDate." ".$SiBTimeAndDiffTime);
# Days: 01-27
local SiBDayToChange [/pick $SiBDateCorrected 4 6;];
if ($SiBDayToChange<=27) do={
set $SiBDayToChange ($SiBDayToChange+1);
if ([/len $SiBDayToChange]=1) do={set $SiBDayToChange ("0".$SiBDayToChange)}
set $SiBDateCorrected ( [/pick $SiBDateCorrected 0 4].$SiBDayToChange.[/pick $SiBDateCorrected 6 20] );
} else={
if ($SiBDayToChange!=31) do={
# Days: 28..30; Main magic do internal scheduler.
/system scheduler remove [find name=SiBTempScheduler2qw34er5v78bn90m];
/system scheduler add name=SiBTempScheduler2qw34er5v78bn90m on-event={nothing } start-time=00:00:01 start-date=( [/pick $SiBDateCorrected 0 4].($SiBDayToChange+1).[/pick $SiBDateCorrected 6 11 ] );
set $SiBDateCorrected ([system scheduler get [find name=SiBTempScheduler2qw34er5v78bn90m] start-date].[/pick $SiBDateCorrected 11 20 ]);
/system scheduler remove [find name=SiBTempScheduler2qw34er5v78bn90m];
} else={
# Day 31 for Jan..Nov
/local SiBMonths ("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec");
/local SiBMounthToChange [/pick $SiBDateCorrected 0 3];
for x from=0 to=10 do={if ([/pick $SiBMonths $x]=$SiBMounthToChange) do={ set $SiBDateCorrected ([pick $SiBMonths ($x+1)]."/01".[/pick $SiBDateCorrected 6 20 ]) }}
# Day 31 for Dec
if ($SiBMounthToChange="dec") do={ set $SiBDateCorrected ("jan/01/".([/pick $SiBDateCorrected 7 11]+1).[/pick $SiBDateCorrected 11 20] )}
};
};
};
#log warning ("New date time: ".$SiBDateCorrected);
#put ("New date time: ".$SiBDateCorrected);
:return $SiBDateCorrected
};
# ################ MAIN PROGRAM ###########################
# Select a proper Netwatch who is ENABLE and have:
local LocNetWatchHost 1.1.1.1;
local LocNetWatchHostComment "InternetWatchDog";
# Still is status down?
local LocStatus [/tool netwatch get [find host=$LocNetWatchHost comment=$LocNetWatchHostComment disabled=no] status];
if ($LocStatus != "down") do={/quit;}
# Convert the Netwatch SINCE to separate date and time of current down-time.
local LocSince [/tool netwatch get [find host=$LocNetWatchHost comment=$LocNetWatchHostComment status=down disabled=no] since];
local LocSinceDate ([/pick $LocSince 0 11]);
local LocSinceTime ([/pick $LocSince 12 20]);
# Add action to future via scheduler
/system scheduler remove [find where name~"SiBexInternetWatchDog_v"];
# Try MAIN ACTION 1 - PPPoE ReEnable after 20s
local SiBCrossMid [$SiBFixDateTime $LocSinceDate $LocSinceTime 20s ];
local SiBStartDate [pick $SiBCrossMid 0 11];
local SiBStartTime [pick $SiBCrossMid 12 20];
/system scheduler add name=SiBexInternetWatchDog_v1 on-event={/interface pppoe-client disable pppoe-out1; /interface pppoe-client enable pppoe-out1;} start-date=$SiBStartDate start-time=$SiBStartTime;
log error "stop Netwatch DOWN-script, Future action are scheduled";
TM run's every seconds and it not check past results like NetWatch.I think the Traffic Monitor Tool can do it
[admin@MikroTik] > /export
# oct/11/2020 14:07:32 by RouterOS 6.45.9
# software id = RMT0-MA7S
#
# model = RBLHGR
# serial number = *************
/interface lte
set [ find ] mac-address=AC:50:43:1A:EE:FD name=lte1 network-mode=lte pin=1111
/interface ethernet
set [ find default-name=ether1 ] mac-address=48:8F:5A:34:AE:B0
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface lte apn
set [ find default=yes ] apn=everywhere name=EE
add apn=3internet default-route-distance=1 name=Three
add apn=payandgo.o2.co.uk default-route-distance=1 name=O2
add apn=wap.vodafone.co.uk authentication=pap default-route-distance=1 name=\
"Vodafone (Pay Monthly)" password=wap user=wap
add apn=pp.vodafone.co.uk authentication=pap default-route-distance=1 name=\
"Vodafone PAYG" password=wap user=wap
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
set [ find default=yes ] html-directory=flash/hotspot
/ip pool
add name=dhcp ranges=192.168.88.10-192.168.88.254
/ip dhcp-server
add address-pool=dhcp disabled=no interface=ether1 lease-time=23h name=defconf
/system logging action
set 1 disk-lines-per-file=2000
add email-to=***@*** name=email target=email
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add comment=defconf interface=ether1 list=LAN
add comment=defconf interface=lte1 list=WAN
add list=LAN
/ip address
add address=192.168.88.1/24 comment=defconf interface=ether1 network=\
192.168.88.0
/ip dhcp-server network
add address=192.168.88.0/24 comment=defconf gateway=192.168.88.1
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.88.1 comment=defconf name=router.lan
/ip firewall filter
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment=\
"defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related
add action=accept chain=forward comment=\
"defconf: accept established,related, untracked" connection-state=\
established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" connection-state=\
invalid
add action=drop chain=forward comment="defconf: drop all from WAN not DSTNATed" \
connection-nat-state=!dstnat connection-state=new in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" ipsec-policy=\
out,none out-interface-list=WAN
/system clock
set time-zone-name=Europe/London
/system logging
set 0 action=disk
add action=disk topics=lte
add action=disk topics=gsm
/system script
add dont-require-permissions=no name=UP-script owner=admin policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="/sy\
stem scheduler remove [find where name~\"SiBexInternetWatchDog_\"];\r\r\
\n/log warning \"RESET Netwatch scheduled DOWN-script... ISP WORKS\";\r"
add dont-require-permissions=no name=Down-script owner=admin policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="# F\
ix Crossing 24:00:00=00:00:00\r\r\
\n/local SiBFixDateTime do={\r\r\
\n/local SiBTimeToChange \"23:45:00\";\r\r\
\n/local SiBTimeToChange \$2;\r\r\
\n/local SiBTimeDiffToAdd \"60m2s\"; # diff time < 24h\r\r\
\n/local SiBTimeDiffToAdd \$3; # diff time < 24h\r\r\
\n#/local SiBDate \"dec/31/2020\"\r\r\
\n/local SiBDate \$1\r\r\
\n/local SiBDateCorrected;\r\r\r\
\n#log warning (\"Source: \".\$SiBDate.\" \".\$SiBTimeToChange.\" + \".\$SiB\
TimeDiffToAdd);\r\r\
\n#put (\"Source: \".\$SiBDate.\" \".\$SiBTimeToChange.\" + \".\$SiBTimeDiff\
ToAdd);\r\r\r\
\n# Add diff time <=24h\r\r\
\n/local SiBTimeAndDiffTime (\$SiBTimeToChange + \$SiBTimeDiffToAdd );\r\r\
\n/if ([/len \$SiBTimeAndDiffTime]=8) do={/set \$SiBDateCorrected (\$SiBDate\
.\" \".\$SiBTimeAndDiffTime); };\r\r\
\n/if ([/len \$SiBTimeAndDiffTime]>8) do={\r \r\
\n/set \$SiBTimeAndDiffTime (\$SiBTimeAndDiffTime-1d);\r\r \r\
\n## Add 24h to date, copy time if exist.\r \r\
\nset \$SiBDateCorrected (\$SiBDate.\" \".\$SiBTimeAndDiffTime);\r\r \r\
\n# Days: 01-27\r \r\
\nlocal SiBDayToChange [/pick \$SiBDateCorrected 4 6;];\r \r\
\nif (\$SiBDayToChange<=27) do={\r \r\
\nset \$SiBDayToChange (\$SiBDayToChange+1);\r \r\
\nif ([/len \$SiBDayToChange]=1) do={set \$SiBDayToChange (\"0\".\$SiBDayToC\
hange)}\r \r\
\nset \$SiBDateCorrected ( [/pick \$SiBDateCorrected 0 4].\$SiBDayToChange.[\
/pick \$SiBDateCorrected 6 20] );\r } else={\r \r\
\nif (\$SiBDayToChange!=31) do={\r\r \r\
\n# Days: 28..30; Main magic do internal scheduler.\r \r\
\n/system scheduler remove [find name=SiBTempScheduler2qw34er5v78bn90m];\r \
\_ \r\
\n/system scheduler add name=SiBTempScheduler2qw34er5v78bn90m on-event={noth\
ing } start-time=00:00:01 start-date=( [/pick \$SiBDateCorrected 0 4].(\$SiB\
DayToChange+1).[/pick \$SiBDateCorrected 6 11 ] );\r \r\
\nset \$SiBDateCorrected ([system scheduler get [find name=SiBTempScheduler2\
qw34er5v78bn90m] start-date].[/pick \$SiBDateCorrected 11 20 ]);\r \
\r\
\n/system scheduler remove [find name=SiBTempScheduler2qw34er5v78bn90m];\r \
\_ } else={\r\r \r\
\n# Day 31 for Jan..Nov\r \r\
\n/local SiBMonths (\"jan\",\"feb\",\"mar\",\"apr\",\"may\",\"jun\",\"jul\",\
\"aug\",\"sep\",\"oct\",\"nov\",\"dec\");\r \r\
\n/local SiBMounthToChange [/pick \$SiBDateCorrected 0 3];\r for x \
from=0 to=10 do={if ([/pick \$SiBMonths \$x]=\$SiBMounthToChange) do={ set \
\$SiBDateCorrected ([pick \$SiBMonths (\$x+1)].\"/01\".[/pick \$SiBDateCorre\
cted 6 20 ]) }}\r\r \r\
\n# Day 31 for Dec\r \r\
\nif (\$SiBMounthToChange=\"dec\") do={ set \$SiBDateCorrected (\"jan/01/\".\
([/pick \$SiBDateCorrected 7 11]+1).[/pick \$SiBDateCorrected 11 20] )}\r \
\_ };\r };\r};\r\r\r\
\n#log warning (\"New date time: \".\$SiBDateCorrected);\r\r\
\n#put (\"New date time: \".\$SiBDateCorrected);\r\r\
\n:return \$SiBDateCorrected\r\r\
\n};\r\r\
\n\r\
\n# Select a proper Netwatch who is ENABLE and have:\r\r\
\nlocal LocNetWatchHost 1.1.1.1;\r\r\
\nlocal LocNetWatchHostComment \"InternetWatchDog\";\r\r\r\
\n# Still is status down\?\r\r\
\nlocal LocStatus [/tool netwatch get [find host=\$LocNetWatchHost comment=\
\$LocNetWatchHostComment disabled=no] status];\rif (\$LocStatus != \"down\")\
\_do={/quit;}\r\r\r\
\n# Convert the Netwatch SINCE to separate date and time of current down-tim\
e.\r\r\
\nlocal LocSince [/tool netwatch get [find host=\$LocNetWatchHost \r\
\ncomment=\$LocNetWatchHostComment status=down disabled=no] since];\r\r\
\nlocal LocSinceDate ([/pick \$LocSince 0 11]);\r\r\
\nlocal LocSinceTime ([/pick \$LocSince 12 20]);\r\r\r\
\n# Add action to future via scheduler\r\r\
\n/system scheduler remove [find where name~\"SiBexInternetWatchDog_v\"];\r\
\r\r\
\n# Try MAIN ACTION 1 - LTE ReEnable after 20s\r\r\r\
\nlocal SiBCrossMid [\$SiBFixDateTime \$LocSinceDate \$LocSinceTime 20s ];\r\
\r\
\nlocal SiBStartDate [pick \$SiBCrossMid 0 11];\r\r\
\nlocal SiBStartTime [pick \$SiBCrossMid 12 20];\r\r\
\n/system scheduler add name=SiBexInternetWatchDog_v1 on-event={/interface l\
te disable lte1; /interface lte enable lte1;} start-date=\$SiBStartDate star\
t-time=\$SiBStartTime;\r\rlog error \"stop Netwatch DOWN-script, Future acti\
on are scheduled\";\r"
/tool e-mail
set address=smtp.gmail.com from=andydhanson@gmail.com password=aslvhsneuerswrwv \
port=587 start-tls=yes user=andydhanson@gmail.com
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
/tool netwatch
add comment=InternetWatchDog down-script="/system script run DOWN-script \r\
\nlog error \"start Netwatch DOWN-script...\";" host=1.1.1.1 interval=5s \
timeout=500ms up-script="/system script run UP-script "
/tool sms
set allowed-number=,,,,, port=lte1 receive-enabled=yes
[admin@MikroTik] >