How to remove or disable firewall rule with sheduler?

I have script for firewall rule like this:
/ ip firewall filter
add chain=forward protocol=tcp dst-port=135-139 action=drop comment=“Drop Blaster Worm” disabled=no

it’s working ok

Now I want to disable it at certain time with sheduler command like this:


\nset 0 action=pass" start-date=jan/01/1970 start-time=10:00:00 interval=1d comment=“” disabled=no


and now I want to enable the rule again with scheduler command:

\nset 0 action=drop" start-date=jan/01/1970 start-time=22:00:00 interval=1d comment=“” disabled=no



Why scheduler doesn’t turn the rule on and off?

The scheduler is running a script, and there you cannot (!) use “0” to describe the first item in (for example) a firewall chain. This works only on the console (after a “print” command).

In scripts you have to use the “find” command to describe the entry/entries you want to affect with a command (see the scripting manual and search this forum for examples and background information).

Best regards,
Christian Meis