## IPv6 auto address lists ##
## Written by:BrasDeutscher,PA,Brazil ##
## Testet under RouterOS v6.37rc36 ##
{
## Set your list name here ##
:global list "dynIPv6"
## Set your list time-out here ##
:global tou "12h"
## !!-- DO NOT CHANGE ANY MORE BELOW --!! ##
:global ipv4
:global ipv6
:global mac
:global action
:foreach d in=[/ip dhcp-server lease find where dynamic ] do={
:set mac [/ip dhcp-server lease get $d mac-address ];
:set ipv4 [/ip dhcp-server lease get $d address ];
:if ([/ipv6 neighbor find where mac-address=$mac ] != "" ) do={
:set ipv6 [/ipv6 neighbor get [find where mac-address=$mac ] address ];
:if ([/ipv6 firewall address-list find where dynamic comment="$ipv4 -- $mac" ] = "" ) do={
:set action [/ipv6 firewall address-list add list="$list" address="$ipv6" \
timeout="$tou" comment="$ipv4 -- $mac" ];
:log warning ("IPv6 Fw new $list - Mac: $mac - Address: $ipv4 to $ipv6");
}}}}