mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-29 15:24:27 +02:00
ipv6-update: accept a single prefix only
This commit is contained in:
parent
769edbcf61
commit
a34d5d7141
1 changed files with 9 additions and 6 deletions
|
@ -51,7 +51,9 @@
|
|||
:local RecordVal [ /ip/dns/static/get $Record ];
|
||||
:local Comment [ $ParseKeyValueStore ($RecordVal->"comment") ];
|
||||
|
||||
:local Prefix [ /ipv6/address/get [ find where from-pool=$Pool interface=($Comment->"interface") global ] address ];
|
||||
: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 ];
|
||||
:set Prefix ([ :toip6 [ :pick $Prefix 0 [ :find $Prefix "/64" ] ] ] & ffff:ffff:ffff:ffff::);
|
||||
:local Address ($Prefix | ([ :toip6 ($RecordVal->"address") ] & ::ffff:ffff:ffff:ffff));
|
||||
|
||||
|
@ -59,4 +61,5 @@
|
|||
($RecordVal->"regexp") . " to " . $Address) false;
|
||||
/ip/dns/static/set address=$Address $Record;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue