From cb72eccc6cf66cab0412f7bd696aa079fffc5180 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 18 Dec 2020 10:11:18 +0100 Subject: ipv6-update: update interface specific address list entries --- ipv6-update | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ipv6-update') diff --git a/ipv6-update b/ipv6-update index 1baa0a4..2224a11 100644 --- a/ipv6-update +++ b/ipv6-update @@ -31,6 +31,18 @@ # give the interfaces a moment to receive their addresses :delay 2s; + :foreach ListEntry in=[ / ipv6 firewall address-list find where comment~("^ipv6-pool-" . $Pool . ",") ] do={ + :local ListEntryVal [ / ipv6 firewall address-list get $ListEntry ]; + :local Comment [ $ParseKeyValueStore ($ListEntryVal->"comment") ]; + + :local Address [ / ipv6 address find where from-pool=$Pool interface=($Comment->"interface") ]; + :if ([ :len $Address ] = 1) do={ + :set Address [ / ipv6 address get $Address address ]; + :log info ("Updating IPv6 address list with new IPv6 prefix " . $Address . " from interface " . ($Comment->"interface")); + / ipv6 firewall address-list set address=$Address $ListEntry; + } + } + :foreach Record in=[ / ip dns static find where comment~("^ipv6-pool-" . $Pool . ",") ] do={ :local RecordVal [ / ip dns static get $Record ]; :local Comment [ $ParseKeyValueStore ($RecordVal->"comment") ]; -- cgit v1.2.3-70-g09d2