Community discussions

MikroTik App
 
zivtal
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 57
Joined: Sun Feb 05, 2017 6:22 pm

Find specific firewall nat

Sat Feb 10, 2018 6:33 pm

I would like to check if firewall nat is exists, I would like to find it by 3 parameters "chain,action,out-interface" and get return only if there is no other parameters except the 3 parameters that I wrote...

/ip firewall nat find where chain=srcnat and action=masquerade and out-interface="bridge-local"

there is a way to do that?
 
User avatar
jprietove
Trainer
Trainer
Posts: 221
Joined: Fri Jun 03, 2016 3:00 pm
Location: Cádiz, Spain
Contact:

Re: Find specific firewall nat

Mon Feb 12, 2018 8:35 pm

Similar as you write:
/ip firewall nat print where chain=srcnat && action=masquerade && out-interface="bridge-local"
If you need it on a script, syntax changes but essentially it is the same:

:if ([:len [/ip firewall nat find chain=srcnat && action=masquerade && out-interface="bridge-local"] ] > 0) do={  
	:delay 5s;
}

Who is online

Users browsing this forum: No registered users and 9 guests