ScheduledWANDisconnect

From MikroTik Wiki
Jump to: navigation, search

"t-dsl" is the name of the WAN-interface, PPPoE in this case

/ system scheduler 
add name="sched_disconnect" on-event=pppoe_dis start-date=jan/01/2006 start-time=03:00:00 interval=1d \ 
comment="move daily T-DSL-disconnect to late night" disabled=yes

/system script
add name=pppoe_dis source={/interface pppoe-client disable [find name="t-dsl"]
:delay 10
/interface pppoe-client enable [find name="t-dsl"]
:log info "Script pppoe_dis - scheduled T-DSL-disconnect executed."
}


should be tested in your environment and use it by own risk!


....or simply name your pppoe interface "ADSL" and do it within scheduler without scripting ...

/system scheduler 
add  name="ADSL reconect" interval=1d on-event="interface pppoe-client disable ADSL ;\r\
\ninterface pppoe-client enable ADSL ;\r\
\n" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,a
start-date=sep/12/2012 start-time=06:00:00