If I run this:
:foreach ip in=[/ip firewall address-list find] do={
:put [/ppp active find address=[get $ip address]];
}It returns the error:
interrupted
invalid value for argument address
Whereas if I save the address as a variable first, then it works.
:foreach ip in=[/ip firewall address-list find] do={
:local add [get $ip address]
:put [/ppp active find address=$add];
}Dunno why…
The IP address as stored in the variable also includes the CIDR notation. Try using a small code section to snip it (and thank Boretto):
:local largo [:len $yourIPvariablenamehere];
:local largo [:put ($largo-3)];
:local nomask [:pick $yourIPvariablenamehere 0 $largo];
## replace "local" below with "global" if your IP variable is meant to be global
:local yourIPvariablenamehere $nomask;