hi
This is script for make address list from any route table. Version of RouterOS 7.15.3
:local size 0;
:local checkIP 0;
:local ipAddress ;
#Name of source table for import prefix's
:local BGPIN 6G;
#Name of new Address List
:local ADList BGP_YOUTUBE;
#route ip address
/ip route
:foreach size in=[find where routing-table=$BGPIN] do={
:local ipAddress [get $size dst-address]
#:local checkIP [/ip firewall address-list print count-only where list=$ADList address=$ipAddress];
#if it is the default gateway don't add it
:if ($ipAddress=0.0.0.0/0) do={:set checkIP 2}
#If the IP is not in the list add it
:if ($checkIP = 0) do={
/ip firewall address-list add list=$ADList address=$ipAddress;}
}