From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id F3EA31FF0B3 for ; Fri, 11 Sep 2026 11:56:34 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 24E9421579; Fri, 11 Sep 2026 11:56:33 +0200 (CEST) From: Gabriel Goller To: pve-devel@lists.proxmox.com Subject: [PATCH container] lxc: debian: avoid 'inet6 auto' with debian's ifupdown2 Date: Fri, 11 Sep 2026 11:56:21 +0200 Message-ID: <20260911095623.429947-1-g.goller@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1789120576926 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.305 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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: H6YNXBHXL465XE3QXXYH7DD3YEPNS4ZR X-Message-ID-Hash: H6YNXBHXL465XE3QXXYH7DD3YEPNS4ZR X-MailFrom: g.goller@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: Debian's ifupdown2 (3.0.0-1.3 in bookworm and trixie) does not support SLAAC and errors on the 'inet6 auto' stanza (Our ifupdown2 version has SLAAC support though). Fall back to 'manual' if the container has an ifupdown2 version without the 'auto' addon. SLAAC still works there, because the kernel manages everything on its own with the default accept_ra and autoconf sysctls. This is the same workaround we already use for Alpine, whose busybox ifupdown has no 'auto' method either. Reported-by: https://forum.proxmox.com/threads/debian-13-lxc-template-ipv4-dhcp-ipv6-slaac-launches-dhcpv6-and-breaks-backups.186269/ Signed-off-by: Gabriel Goller --- src/PVE/LXC/Setup/Debian.pm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/PVE/LXC/Setup/Debian.pm b/src/PVE/LXC/Setup/Debian.pm index 837397bb3ecd..eafca59cfefe 100644 --- a/src/PVE/LXC/Setup/Debian.pm +++ b/src/PVE/LXC/Setup/Debian.pm @@ -172,6 +172,21 @@ sub snakeoil_fixup { } } +=head3 ifupdown2_has_slaac($self) + +Checks if the ifupdown2 installation has SLAAC support. Debian's version of +ifupdown2 currently doesn't, our version does. + +=cut + +sub ifupdown2_has_slaac { + my ($self) = @_; + + my $addon_dir = '/usr/share/ifupdown2/addons'; + + return $self->ct_is_directory($addon_dir) && $self->ct_file_exists("$addon_dir/auto.py"); +} + sub remove_gateway_scripts { my ($attr) = @_; my $length = scalar(@$attr); @@ -300,6 +315,7 @@ sub setup_network { my $done_v6_hash = {}; my ($os, $version) = ($conf->{ostype}, $self->{version}); + my $slaac = ifupdown2_has_slaac($self); my $print_section = sub { return if !$section; @@ -348,7 +364,13 @@ sub setup_network { if (!defined($net->{address6})) { # no address => no iface line } elsif ($net->{address6} =~ /^(auto|dhcp|manual)$/) { - $interfaces .= "iface $ifname inet6 $1\n\n"; + my $method = $1; + # the kernel does SLAAC on its own with the default sysctls, so + # 'manual' is the closest we can get without a working 'auto' + if ($method eq 'auto' && !$slaac) { + $method = 'manual'; + } + $interfaces .= "iface $ifname inet6 $method\n\n"; } else { $interfaces .= "iface $ifname inet6 static\n"; if ( -- 2.47.3