Help with script - change dinamics firewall rule

Hi, I need some help.

I need to create a script to change a rule nat firewall dynamically created by the hotspot, but I can not do the search to change the rule.

command:
/ ip firewall nat SET [/ ip firewall nat print dynamic dst-port = 53] hotspot! auth

even the command:
/ ip firewall nat print dynamic dst-port = 53

not return any value, however there is 2 rules with dst-port = 53

att,
thiago :confused:

You won’t be able to change a dynamically created firewall rule. You will have to copy that rule and change the copied rules. What are you trying to accomplish overall?

What you try to do with DNS?

Explain, is better…

this syntax are WRONG: / ip firewall nat print dynamic dst-port = 53

the right syntax are:
/ip firewall nat print all where dynamic=yes dst-port=β€œ53”;

and this result are unusable for what you want to do.

The usable result (one array with 2 values identifyng the two firewall redirect nat rules for DNS on hotspot) are obtained from:

:local rulesIDs value=[/ip firewall nat find where dynamic=yes dst-port=β€œ53”];

thanks for the help .. my script looked like this:

:foreach rulesIDs in=[/ip firewall nat find where dynamic=yes dst-port=β€œ53”] do={ /ip firewall nat set $rulesIDs hotspot=!auth; };

Again:

What you try to do with DNS?

If you want help, explain what you want to do…