Community discussions

MikroTik App
 
bogdan_mare
just joined
Topic Author
Posts: 22
Joined: Thu Jun 03, 2004 5:35 pm
Location: Baia Mare, Romania

firewall rule disable script

Wed Sep 21, 2005 6:09 pm

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?
 
User avatar
lastguru
Member
Member
Posts: 432
Joined: Fri May 28, 2004 9:04 pm
Location: Certified Trainer/Consultant in Riga, Latvia
Contact:

Wed Sep 21, 2005 8:25 pm

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.
 
bogdan_mare
just joined
Topic Author
Posts: 22
Joined: Thu Jun 03, 2004 5:35 pm
Location: Baia Mare, Romania

Wed Sep 21, 2005 8:50 pm

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).
 
miroxy
just joined
Posts: 22
Joined: Tue Mar 22, 2005 12:02 am
Location: Serbia
Contact:

Mon Jan 09, 2006 6:46 am

:foreach i in=[/ip firewall filter find action=drop ] do=[/ip firewall filter disable $i] 

Who is online

Users browsing this forum: No registered users and 13 guests