variable doubt

Hi
I have a script

:For a from 1 to 10 do={/ip firewall nat add chain=dstnat protocol=tcp dst-tcp=“6111 + $a” in-interface=WAN1…

“6111 + $a” usage is currect or not ?

I’m pretty sure the quotes turn it into a string. There IS variable interpolation in strings, but no arithmetic operations.

So if you’re trying to generate a number, you need to use brackets to mark an expression instead, i.e.

:for a from 1 to 10 do={/ip firewall nat add chain=dstnat protocol=tcp dst-tcp=(6111 + $a) in-interface=WAN1

Why don’t you just use a port range?

thanks

l will try