From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id BA5F71FF14F for ; Fri, 08 May 2026 20:47:20 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 93B8B21B30; Fri, 8 May 2026 20:47:20 +0200 (CEST) From: Christoph Heiss To: pve-devel@lists.proxmox.com Subject: [PATCH installer 8/8] unconfigured: try to retrieve IPv6 SLAAC addresses on startup Date: Fri, 8 May 2026 20:44:11 +0200 Message-ID: <20260508184546.113293-9-c.heiss@proxmox.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260508184546.113293-1-c.heiss@proxmox.com> References: <20260508184546.113293-1-c.heiss@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1778265885011 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.076 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: VXIHQPC33OENRW6EFXDDJXYKQ2MROSKQ X-Message-ID-Hash: VXIHQPC33OENRW6EFXDDJXYKQ2MROSKQ X-MailFrom: c.heiss@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Uses `rdisc6` to send IPv6 router solicitations, in order to get potential router advertisements. The kernel then auto-configures any retrieved IPv6 address on the corresponding interface. `rdnssd` is used to to retrieve IPv6 (recursive) DNS servers from these router advertisements. Signed-off-by: Christoph Heiss --- debian/control | 2 ++ unconfigured.sh | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/debian/control b/debian/control index 8049dd6..3c9de71 100644 --- a/debian/control +++ b/debian/control @@ -50,7 +50,9 @@ Depends: chrony, libgtk3-perl, libgtk3-webkit2-perl, libjson-perl, + ndisc6, proxmox-kernel-helper, + rdnssd, squashfs-tools, util-linux-extra, ${misc:Depends}, diff --git a/unconfigured.sh b/unconfigured.sh index 7445ac4..02ace77 100755 --- a/unconfigured.sh +++ b/unconfigured.sh @@ -218,6 +218,16 @@ handle_wireless() { fi } +# Iterates over all UP interfaces and sends a router solicitation on each. +ipv6_send_router_solicitation() { + local devs + devs="$(ip -6 addr show scope link up | grep -oP '^\d+: \K\S+(?=:)')" + + for dev in $devs; do + rdisc6 -1 --retry 1 "$dev" || true + done +} + PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin echo "Starting Proxmox installation" @@ -311,6 +321,20 @@ echo -n "Attempting to get DHCP leases... " dhclient -v echo "done" +# start rdnssd in the background first +# the default merge hook just appends it to /etc/resolv.conf, which is what we want +# also need to create the run-directory for rdnssd, otherwise it will silently +# fail to write out new entries +echo "Starting rdnssd for retrieving IPv6 nameservers..." +mkdir -p /run/rdnssd +rdnssd --merge-hook /etc/rdnssd/merge-hook --user root || echo "starting rdnssd failed ($?)" + +# check for IPv6 SLAAC by sending a router solicitation +# rdnssd will pick up any nameservers, and the kernel interface addresses +echo "Sending IPv6 router solicitations..." +ipv6_send_router_solicitation +echo "Done sending IPv6 router solicitations." + echo "Starting chrony for opportunistic time-sync... " chronyd || echo "starting chrony failed ($?)" -- 2.53.0