Hello everyone!
I have a such questions: i have 2 different channels: 1 for world and 1 ukrainian traffic(ua-ix). And i have a list of ua-ix networks (more than 3500 prefixes). How can i make a script, which will automatically create address-list with that prefixes.
I tried to use this script:
Generic IP address list input
Based on a script written by Sam Norris, ChangeIP.com 2008
Edited by Andrew Cox, AccessPlus.com.au 2008
:if ( [/file get [/file find name=ipaddress.txt] size] > 0 ) do={
Remove exisiting addresses from the current Address list
/ip firewall address-list remove [/ip firewall address-list find list=MY-IP-LIST]
:global content [/file get [/file find name=ipaddress.txt] contents] ;
:global contentLen [ :len $content ] ;
:global lineEnd 0;
:global line "";
:global lastEnd 0;
:do {
:set lineEnd [:find $content "\n" $lastEnd ] ;
:set line [:pick $content $lastEnd $lineEnd] ;
:set lastEnd ( $lineEnd + 1 ) ;
#If the line doesn't start with a hash then process and add to the list
:if ( [:pick $line 0 1] != "#" ) do={
:local entry [:pick $line 0 ($lineEnd -1) ]
:if ( [:len $entry ] > 0 ) do={
/ip firewall address-list add list=MY-IP-LIST address=$entry
}
}
} while ($lineEnd < $contentLen)
}
But it only create in "Files" ipaddress.txt file (120 KB) and do nothing more.
Is it something wrong with script or what?MT v3.28