

想設定pppoe偵測連線不存在時,自動重新撥接
www.google.com的IP為:172.217.160.67
使用netwatch,並在DOWN打上
/interface pppoe-client disable pppoe-out1
:delay 5000ms;
/interface pppoe-client enable pppoe-out1
現在產生個問題
172.217.160.67一直處於down的狀態?
請問要如何解決?
~~~~~~~~~~~在此感謝gfx的回復 :~~~~~~~~~~~~~~
netwatch有他的侷限,就如同當狀態是一直up,或一直down時。
他並不會反覆運行script欄的腳本...
所以不要用netwatch,用排程直接操作就不會有問題了。
:if ([:ping www.google.com interface=pppoe-out1 count=3]=0) do={/interface enable pppoe-out1}
解釋count=3即ping www.google.com 三下,若ping三下反應都沒有,結果等於0...
就觸發動作啟用pppoe-out1
您可能不清楚重撥pppoe-out1時,並不需先disable,然後再enable。
而是即使pppoe-out1目前已enable中,
操作winbox時對pppoe-out1再按enable(打勾)圖示也是會觸發重撥的。
另外腳本:delay這個參數有幾種表示法:
如:
:delay 5000ms
或
:delay 5s
或
:delay 00:00:05
或
:delay 0:0:5
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
這篇的教學
https://forum.mikrotik.com/viewtopic.php?t=84004
:if ([/ping 110.164.252.223 interface=pppoe-out2 count=3] =0) do={
:log error "pppoe-out2 linkdown!"
:delay 5
/interface pppoe-client enable pppoe-out2
}
~~~~~~~~ 感謝小笨賢提供的教學~~~~~~~~
連結:
https://help.gowifi.co.nz/support/solutions/articles/48000976635-reboot-poe-port-on-mikrotik-if-the-device-doesn-t-respond-to-ping
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~