{"id":272,"date":"2012-02-20T18:13:36","date_gmt":"2012-02-20T16:13:36","guid":{"rendered":"http:\/\/rexxer.kharkov.ru\/?p=272"},"modified":"2012-02-20T18:13:36","modified_gmt":"2012-02-20T16:13:36","slug":"mikrotik-script-for-a-channel-failing-detecting","status":"publish","type":"post","link":"https:\/\/dety.net.ua\/?p=272","title":{"rendered":"Mikrotik + script for a channel failing detecting"},"content":{"rendered":"<p>I have got a router Mikrotik 750.<\/p>\n<p>Periodically I have issues when the internet channel failed.<\/p>\n<p>But it start work when I changed port speed to 10Mbps and later turned it back to 100Mbps. (problem with cable \ud83d\ude42 )<\/p>\n<p>So, I wrote script for switching the port speed automatically:<\/p>\n<blockquote><p>:global u<br \/>\n:local PingCount 3;<br \/>\n:local CheckIp1 1.1.1.1;<br \/>\n:local isp1 [\/ping $CheckIp1 count=$PingCount];<br \/>\n:if ($isp1=$PingCount) do={<br \/>\n\/interface ethernet monitor ether1-gateway once do={<br \/>\n:set u $rate<br \/>\n}<br \/>\n:if ($u = &#8220;10Mbps&#8221;) do={<br \/>\n:log info &#8220;$u setup it to 100Mbps&#8221;<br \/>\ninterface ethernet set ether1-gateway speed=100Mbps<br \/>\n}<br \/>\n#:log info $isp1;<br \/>\n}<\/p>\n<p>:if ($isp1!=$PingCount) do={<br \/>\n\/interface ethernet monitor ether1-gateway once do={<br \/>\n:set u $rate<br \/>\n}<br \/>\n:if ($u = &#8220;100Mbps&#8221;) do={<br \/>\n:log info &#8220;$u setup it to 10Mbps&#8221;<br \/>\ninterface ethernet set ether1-gateway speed=10Mbps<br \/>\n}<br \/>\n#:log info $isp1;<br \/>\n}<br \/>\n#:log info $u<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>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 \ud83d\ude42 ) So, I wrote script for switching the port speed automatically: :global u :local PingCount 3; :local [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,13],"tags":[],"class_list":["post-272","post","type-post","status-publish","format-standard","hentry","category-mikrotik","category-novosti"],"_links":{"self":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/272","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=272"}],"version-history":[{"count":0,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/272\/revisions"}],"wp:attachment":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=272"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=272"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}