Page 1 of 1

Disable Interface on Startup and enable 1 minute later

Posted: Wed Feb 18, 2015 9:04 am
by Zapnologica
Good day,


I have a weird case in my one clients mikrotik. This is more of a work around than a solution but it will be quicker for me to do this.

I am routing voip data out of a different gateway. However my VoIP only starts routhign through the other line after I disable my primary internet line.

So basically I want a script that on startup, disables interface x.

waits a certain period of time and then Enables the interface again.


Can I do this?

Re: Disable Interface on Startup and enable 1 minute later

Posted: Wed Feb 18, 2015 10:05 am
by sergejs
/system scheduler
provides you with such functions.

Run script on startup (there is such parameter), disable interface (be careful as small delay might be required for it), then add your proposed delay (:delay 60s) and command to enable interface.

Re: Disable Interface on Startup and enable 1 minute later

Posted: Wed Feb 18, 2015 11:02 am
by Zapnologica
Any Ideas on what that specific script might look like? I haven't got much experience with the scripting language.

Re: Disable Interface on Startup and enable 1 minute later

Posted: Wed Feb 18, 2015 11:15 am
by sergejs
/system scheduler
add name=schedule1 on-event=":delay 5s;\r\
\n/interface ethernet disable ether1;\r\
\n:delay 60s;\r\
\n/interface ethernet enable ether1" policy=\
reboot,read,write,policy,test,password,sniff,sensitive start-time=startup

Re: Disable Interface on Startup and enable 1 minute later

Posted: Wed Feb 18, 2015 11:41 am
by Zapnologica
This works in the terminal but not in a script?


am I doing something wrong? im running v6.26

/interface pppoe-clinet disable Test
if I put that in a script and click run, nothing happens, put it in the terminal and it disables the interface?

Re: Disable Interface on Startup and enable 1 minute later

Posted: Wed Feb 18, 2015 11:51 am
by sergejs
Use scheduler to run script, make sure Test is the name of your PPPoE interface.

Re: Disable Interface on Startup and enable 1 minute later

Posted: Wed Feb 18, 2015 1:46 pm
by KabTak47
At the moment RouterOS does not account milliseconds, and there are no too much setups where second is too big value for time.???

Re: Disable Interface on Startup and enable 1 minute later

Posted: Wed Feb 18, 2015 8:43 pm
by Zapnologica
Does script and scheduler not run the same scripting language?

Ok sweet, It is working now in scheduler.