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
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
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