To fix it the pppoe must be reconnected.
Made a script for myself.
Maybe someone has the same problem.
script's steps:
1. Check pppoe-session status connected (if not connected - stop script)
2. Ping "8.8.8.8" five times (if ping is ok - stop script)
3. Ping "8.8.4.4" five times (if ping is ok - stop script)
4. Reconnect pppoe-session.
System-Scripts:
Name: check-inet
Policy: write,test,read
Source:
Code: Select all
# Don't forget, if you've multiple ISPs
# HostPingA and HostPingB
# must have the static routes.
# example:
# (if HostPingA=8.8.8.8; HostPingB=8.8.4.4;
# and GW of ISP1=172.16.18.1 )
#
# /ip route
# add dst-address=8.8.8.8 gateway=172.16.18.1 scope=10
# add dst-address=8.8.4.4 gateway=172.16.18.1 scope=10
##### Script Settings #####
:local WanName "pppoe-out1"
:local HostPingA "8.8.8.8"
:local HostPingB "8.8.4.4"
#####################
:local PingCount "5"
:local WanStat
/interface pppoe-client monitor $WanName once do={ :set WanStat $status}
:if ($WanStat = "connected") do={
:local pingresultA [/ping $HostPingA count=$PingCount];
:if ($pingresultA = 0) do={
:local pingresultB [/ping $HostPingB count=$PingCount];
:if ($pingresultB = 0) do={
:log error message="Script can not ping thru <$WanName>. Try to reconnect...";
:interface pppoe-client disable $WanName;
:delay 5;
:interface pppoe-client enable $WanName;
:log warning message="PPPoE has Reconnected by script";
}
}
}
System-Sheduler:
Name: check-inet
Start Date: Jan/01/1970
Start Time: 00:00:00
Interval: 00:03:00
On Event: /system script run check-inet
Policy: write,test,read