Rexxer

Some tips for me and other

Mikrotik + script for a channel failing detecting

I have got a router Mikrotik 750.

Periodically I have issues when the internet channel failed.

But it start work when I changed port speed to 10Mbps and later turned it back to 100Mbps. (problem with cable 🙂 )

So, I wrote script for switching the port speed automatically:

:global u
:local PingCount 3;
:local CheckIp1 1.1.1.1;
:local isp1 [/ping $CheckIp1 count=$PingCount];
:if ($isp1=$PingCount) do={
/interface ethernet monitor ether1-gateway once do={
:set u $rate
}
:if ($u = “10Mbps”) do={
:log info “$u setup it to 100Mbps”
interface ethernet set ether1-gateway speed=100Mbps
}
#:log info $isp1;
}

:if ($isp1!=$PingCount) do={
/interface ethernet monitor ether1-gateway once do={
:set u $rate
}
:if ($u = “100Mbps”) do={
:log info “$u setup it to 10Mbps”
interface ethernet set ether1-gateway speed=10Mbps
}
#:log info $isp1;
}
#:log info $u

Leave a Reply