Hi Friends…
I want a script that will enable firewall filter rule on selected dates (or) days and remaining dates (or) days it has to disable…
Is it possible???
Please do need full friends ![]()
Hi Friends…
I want a script that will enable firewall filter rule on selected dates (or) days and remaining dates (or) days it has to disable…
Is it possible???
Please do need full friends ![]()
/ip firewall filter add comment="drop http" disabled=yes chain=forward protocol=tcp dst-port=80 action=drop
/system scripts add name=drop_http source="/ip firewall filter enable [find comment=\"drop http\"]"
/system scripts add name=allow_http source="/ip firewall filter disable [find comment=\"drop http\"]"
/system scheduler add name="enable drop http" disabled=no start-time=08:00:00 interval=24h on-event=drop_http
/system scheduler add name="disable drop http" disabled=no start-time=17:00:00 interval=24h on-event=allow_http
This is just a quick sample on how to control HTTP access during business hours. Should give you the idea of how to adapt scheduling filter rules for your needs. There’s further information on the scheduler properties at http://wiki.mikrotik.com/wiki/Manual:System/Scheduler if you need to change to certain days, etc.
Thomas
Hey thanks for your fast response…
But i need some what brief scripting like in a week i need only 3days(i.e., Monday, Tuesday, Wednesday) remaining 4 days the queue must be in disable state and next Monday it has to enable.
Add a scheduler item for each day of the week that you want a change. Set the ‘start-date’ flag to the first date occurrence that matches when you want the change to occur. Set the interval to ‘7d’.
So for example the next coming Monday is September 3, 2012 and the next coming Thursday is September 6, 2012. Change the scheduler rules that I listed previously to:
/system scheduler add name="enable drop http" disabled=no start-time=08:00:00 start-date=sep/3/2012 interval=7d on-event=drop_http
/system scheduler add name="disable drop http" disabled=no start-time=08:00:00 start-date=sep/6/2012 interval=7d on-event=allow_http
That should get you started on a weekly schedule. You can add as many change enable/disable rules as you like to change whenever you like. Adapting to enabling and disabling a queue is pretty similar. You will just need to change the script a little to match what you have.
Let me know if you have any more questions.
Thomas
Hey Thomas,
I’m very thank full to you…Thanks for your valuable response. ![]()