Getting address from the connection table

I want do add an address to an address-list and I have some trouble getting the address.

Because the normal way does not want to return the address and it seems to need the .id

:put [find protocol=ipsec-esp];
*2306;*230d;*230e;*23b2

This is my try:

:local ip [get [find where protocol=ipsec-esp] value-name=dst-address  ]; :put $ip;

As the first one yields a list of references, you have to use foreach:


foreach x in=[/ip firewall connection find protocol=ipsec-esp] do={put [/ip firewall connection get $x src-address] }

Thanks Sindy it works great.