mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-08-05 02:34:45 +02:00
ipv6-update: support host addresses in address-list
This commit is contained in:
parent
a34d5d7141
commit
62707dc549
4 changed files with 22 additions and 5 deletions
17
ipv6-update
17
ipv6-update
|
@ -41,9 +41,20 @@
|
|||
:local Prefix [ /ipv6/address/find where from-pool=$Pool interface=($Comment->"interface") global ];
|
||||
:if ([ :len $Prefix ] = 1) do={
|
||||
:set Prefix [ /ipv6/address/get $Prefix address ];
|
||||
$LogPrintExit2 info $0 ("Updating IPv6 address list with new IPv6 prefix " . $Prefix . \
|
||||
" from interface " . ($Comment->"interface")) false;
|
||||
/ipv6/firewall/address-list/set address=$Prefix $ListEntry;
|
||||
|
||||
:if ([ :typeof [ :find ($ListEntryVal->"address") "/128" ] ] = "num" ) do={
|
||||
:set Prefix ([ :toip6 [ :pick $Prefix 0 [ :find $Prefix "/64" ] ] ] & ffff:ffff:ffff:ffff::);
|
||||
:local Address ($ListEntryVal->"address");
|
||||
:local Address ($Prefix | ([ :toip6 [ :pick $Address 0 [ :find $Address "/128" ] ] ] & ::ffff:ffff:ffff:ffff));
|
||||
|
||||
$LogPrintExit2 info $0 ("Updating IPv6 address list with new IPv6 host address " . $Address . \
|
||||
" from interface " . ($Comment->"interface")) false;
|
||||
/ipv6/firewall/address-list/set address=$Address $ListEntry;
|
||||
} else={
|
||||
$LogPrintExit2 info $0 ("Updating IPv6 address list with new IPv6 prefix " . $Prefix . \
|
||||
" from interface " . ($Comment->"interface")) false;
|
||||
/ipv6/firewall/address-list/set address=$Prefix $ListEntry;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue