電訊茶室's Archiver

gfx86674 發表於 2015-8-19 13:59

防止site-to-site連接失敗時,log被洗版

[i=s] 本帖最後由 gfx86674 於 2015-8-19 14:02 編輯 [/i]

先些個日子 朋友出國散心,把他家的所有電器都關閉了(含網路裝置).
但小弟與他的router有做pptp-site-to-site ,
因pptp-client連不到遠端,導致log被pptp-client洗版...重要的訊息都看不到了.

所以小弟事後編寫了pptp-client驗證,
當pptp-client嘗連接5秒仍無法連接就直接進行休眠,等過30分鐘再進行嘗試連接.

平常有使用site-to-site的用戶,有興趣的可以查看:[code]:local ghostplayer [/interface pptp-client find name=ghostplayer]

:if (![/interface pptp-client get $ghostplayer running]) \
    do={/system scheduler disable *2c

        :while (![/interface pptp-client get $ghostplayer running]) \
               do={
                   /interface pptp-client disable $ghostplayer ;:delay 29m55s
                   /interface pptp-client enable $ghostplayer ;:delay 5s
                  }
        /system scheduler enable *2c}[/code]

joyvx 發表於 2015-8-25 09:12

借用了一下,用不了不知道為什麼

gfx86674 發表於 2015-8-25 11:08

[i=s] 本帖最後由 gfx86674 於 2015-8-25 11:11 編輯 [/i]

[b]回復 [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=41758&ptid=6737]2#[/url] [i]joyvx[/i] [/b]
當然用不了啊,
原因1:[color=Blue]您的pptp名稱是ghostplayer嗎?[/color]
原因2:[color=Red]*2c是排程的array,也要修該成您的號碼才對.[/color]

譬如您的排程名稱是abc ,您要在命令視窗輸入:[code]put [/system scheduler find name="abc"][/code]顯示出array後,將號碼取代*2c

joyvx 發表於 2015-8-25 11:34

谢谢您,PPTP名稱有改過自己的,2C沒設置....

yiucsw 發表於 2018-9-4 16:03

防止site-to-site連接失敗時,log被洗版

最近要看Log了解為什麼連不上LTE. 但Log比SSTP connection error Overwrite...
我用了以下的方法來減少SSTP error...
1)power on 時:disable SSTP,
2) Netwatch connection, 在中國可以看看Taobao IP, 在香港可以看看8.8.8.8。
3) 如果有Network connection, 便enable SSTP, 沒有disable SSTP
4) Netwatch 不會重複enable sstp/disable SSTP. 是Netwatch status (狀態)變化才有動作。
Netwatch 的Script 有限制 only read, write, reboot, test

------ power on 時 Disable SSTP -- 其實有沒有差別不大。
/system scheduler
add name=pwrondisable on-event=wan-down policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-time=startup

------ netwatch 看看有沒有Connection... x.x.x.x 1.1.1.1 要可以。
/tool netwatch
add down-script=wan-down host=x.x.x.x up-script=wan-up

--- Script wan-down, 當Status 變到沒有Network connection 時,運行一次。
Script wan-down
{      
             :log warning "sstp-bcp NOT running"
             /interface sstp-client disable [find where name="sstp-bcp"]
}
--- Script wan-up, 當Status 變到有Network connection 時,運行一次。
{
:log info message="Link up, Check SSTP"
:if ([/interface sstp-client get sstp-bcp running]=true) do={
       :log info message="sstp running"
     }  else={
        :log warning "sstp-bcp NOT running"
        :delay delay-time=1;
         /interface sstp-client enable [find where name="sstp-bcp"]
      }
}

頁: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.