get src ip from destination in firewall

:local LocalSubnet [:pick [/ip firewall nat find where dst-add
ress=192.168.0.0/16] src-address]];

idea is to use local subnet for further scripting and i have one rule in nat and i want to exclude from that, so src subnets are different but that dst subnet are the same allways, so i want to get that ip into variable.

this vatiable catch nothing. Somewhere is mistake…
this is rule

add chain=srcnat dst-address=192.168.0.0/16 src-address=10.10.189.0/24

Do you get any output from running this form command prompt

:put [/ip firewall nat find where dst-address=192.168.0.0/16]

nope

You are missing quotes. Try

:put [/ip firewall nat find where dst-address="192.168.0.0/16"]

So this should give what you looking for:

:put [/ip firewall nat get [find where dst-address="192.168.0.0/16"] src-address]

thats it, thanks!

@

Why did you quote my message? No need to quote the post above you!!

There is a button below the post Post Reply to use when reply on the post.