Community discussions

MikroTik App
 
B20016
just joined
Topic Author
Posts: 11
Joined: Sat Nov 20, 2021 8:32 am
Location: Kenya

Auto enable firewall rule using scheduler after x no of days

Sun Nov 21, 2021 4:54 pm

Hi, Is there a way or a script i can use to get scheduler to auto enable a drop connection firewall rule after lets say after 10 days?
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3297
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Auto enable firewall rule using scheduler after x no of days

Mon Nov 22, 2021 10:31 am

Yes you can do it many ways.

Example. Create a filter rule that drops the connection, set it to disabled and add a comment (importante) to something. Here I do use "Test"

Then make a script that will enable this rule.
{
/ip firewall filter
set disabled=no [find where comment="Test"]
}
All in one line
/ip firewall filter set disabled=no [/ip firewall filter find where comment="Test"]
Then make a schedule to run in 10 days from now and add 0 sec for interval to run it only once.
 
B20016
just joined
Topic Author
Posts: 11
Joined: Sat Nov 20, 2021 8:32 am
Location: Kenya

Re: Auto enable firewall rule using scheduler after x no of days

Mon Nov 22, 2021 11:03 am

Thanks it worked.

Who is online

Users browsing this forum: No registered users and 23 guests