Community discussions

MikroTik App
 
ejohnson
just joined
Topic Author
Posts: 4
Joined: Fri Nov 03, 2006 7:14 pm

Problem with /ip firewall filter find

Fri Nov 03, 2006 7:21 pm

Hello,

I am trying to use the find feature /ip firewall filter find and am having no luck. according to the documentation if I pass no parameters to find then it should return everything. I have added some test filters and they show up when I do a print but not when I do a find. See below for the example, does anyone have any idea about this..I am running Router version 2.9.34.


[admin@MikroTik] > /ip firewall filter print Flags: X - disabled, I - invalid, D - dynamic
0 chain=forward protocol=tcp dst-port=135 action=drop

1 chain=forward protocol=tcp dst-port=80 action=drop
[admin@MikroTik] > /ip firewall filter find
[admin@MikroTik] > /ip firewall filter find action=drop
[admin@MikroTik] >



Thanks
 
changeip
Forum Guru
Forum Guru
Posts: 3833
Joined: Fri May 28, 2004 5:22 pm

Fri Nov 03, 2006 8:15 pm

Using this command you will see the output to the console:

:put [ /ip firewall filter find action=drop ]

The :put means print to console. What the find is doing is SELECTing a list of indexes/internal numbers that you want to perform something on.

Another example:

:foreach rule in=[ /ip firewall filter find action=drop ] do={
:put [/ip firewall filter get $rule chain]
}

The above will loop thru each found and print out the chain its in.

Sam
 
ejohnson
just joined
Topic Author
Posts: 4
Joined: Fri Nov 03, 2006 7:14 pm

Fri Nov 03, 2006 8:26 pm

Thanks!!!
 
User avatar
ploquets
Member Candidate
Member Candidate
Posts: 162
Joined: Tue Nov 17, 2015 12:49 pm
Location: Uruguaiana, RS, Brazil
Contact:

Re: Problem with /ip firewall filter find

Sat Apr 23, 2016 6:24 pm

I'm sorry for rising this thread, but my problem is similar to this.

I'm build a script to change firewall script already installed and working on our customers CPEs.

What I want is to find and remove by script NAT rules that would match the action=masquerade
Would that be possible?

I've tried with:
/ip firewall nat
remove [find action=masquerade]
No luck

and
/ip firewall nat remove [/ip firewall nat find where action=masquerade]
I can see that
:put [/ip firewall nat find action=masquerade]
doesn't show anything, but, I don't know why.

Please, i need some help.
Thanks