Community discussions

MikroTik App
bogdan_mare
刚刚加入了
Topic Author
Posts: 22
加入: 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?
Top
用户头像
lastguru
教练
教练
Posts: 432
加入: 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.
Top
bogdan_mare
刚刚加入了
Topic Author
Posts: 22
加入: 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).
Top
miroxy
刚刚加入了
Posts: 22
加入: Tue Mar 22, 2005 12:02 am
Location:Serbia
Contact:

Mon Jan 09, 2006 6:46 am

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

Who is online

Users browsing this forum: No registered users and 10 guests