You can add it as dynamic, and the NAND/Flash is not used, the IP are not keeped on reboot, not backuppped or exported, and max timeout before the item is auto-deleted is 35 weeks.
For IPv4, on the example is excluded on purpose pppoe clients and ether3
/ip firewall address-list
set [find where list="interface_IPs"] comment="*** DELETE-ME ****"
:foreach item in=[/ip address find where (!(interface~"pppoe|ether3"))] do={
:local ifip [/ip address get $item address]
:set ifip [:pick $ifip 0 [:find $ifip "/" -1]]
:if ([:typeof [:toip $ifip]] = "ip") do={
:if ([:len [find where list="interface_IPs" and (($ifip in address) or (address=$ifip))]] = 0) do={
add list="interface_IPs" address=$ifip timeout=35w
} else={
set [find where list="interface_IPs" and (($ifip in address) or (address=$ifip))] comment=""
}
}
}
remove [find where list="interface_IPs" and comment="*** DELETE-ME ****"]
For IPv6, on the example is excluded on purpose pppoe clients and ether3
/ipv6 firewall address-list
set [find where list="interface_IPs"] comment="*** DELETE-ME ****"
:foreach item in=[/ipv6 address find where (!(interface~"pppoe|ether3"))] do={
:local ifip [/ipv6 address get $item address]
:set ifip [:pick $ifip 0 [:find $ifip "/" -1]]
:if ([:typeof [:toip6 $ifip]] = "ip6") do={
:if ([:len [find where list="interface_IPs" and (($ifip in address) or (address=$ifip))]] = 0) do={
add list="interface_IPs" address=$ifip timeout=35w
} else={
set [find where list="interface_IPs" and (($ifip in address) or (address=$ifip))] comment=""
}
}
}
remove [find where list="interface_IPs" and comment="*** DELETE-ME ****"]
For ppp clients is better to use address-list on ppp profile,
because the entry on specified address-list is added dynamically (= no NAND or Flash used and is never backupped or exported)
when the user log in and is remved automatically when user logoff or the router reboot.