Page 1 of 1

firewall rule disable script

Posted: Wed Sep 21, 2005 6:09 pm
by bogdan_mare
Hello,

I have a problem implementing a script. I gave this command:

/add name=stop_dc source={/ip firewall rule forward disable 10}

and whenever I run the script I get the message System-Error: script error: no such chain.

If I type at console:

/ip firewal rule forward disable 10

then the desired rule is disabled. Where am I missing the plot?

Also, I am planning to upgrade from version 2.8.26 of RouterOS to 2.9.4. Should I expect any trouble with the upgrade or would it run smoothly?

Posted: Wed Sep 21, 2005 8:25 pm
by lastguru
it is written allover this place, and the manual... numbers may only be used after print command. in scripts please use find command to point on the particular rule.

Posted: Wed Sep 21, 2005 8:50 pm
by bogdan_mare
Thanks, after a bit of trial and error I came up with the working solution.

ip firewall rule forward disable [/ip firewall rule forward find action=drop]

The bit that had been escaping me was that in the brackets I should write the whole path again. (ie /ip firewall rule forward).

Posted: Mon Jan 09, 2006 6:46 am
by miroxy
:foreach i in=[/ip firewall filter find action=drop ] do=[/ip firewall filter disable $i]