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 7D27B1FF0B3 for ; Fri, 11 Sep 2026 13:13:29 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 9F4192141F; Fri, 11 Sep 2026 13:13:28 +0200 (CEST) Message-ID: <2dc5df98-2f89-40bd-ab34-89e06c671ca2@proxmox.com> Date: Fri, 11 Sep 2026 13:13:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH container] lxc: debian: avoid 'inet6 auto' with debian's ifupdown2 To: Gabriel Goller , pve-devel@lists.proxmox.com References: <20260911095623.429947-1-g.goller@proxmox.com> From: Hannes Laimer Content-Language: en-US In-Reply-To: <20260911095623.429947-1-g.goller@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1789125192545 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.521 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: JVYAZPCTF2ZVVMSXDARN2RM226X4T5HM X-Message-ID-Hash: JVYAZPCTF2ZVVMSXDARN2RM226X4T5HM X-MailFrom: h.laimer@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: lgtm! Reviewed-by: Hannes Laimer On 2026-09-11 11:56, Gabriel Goller wrote: > 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 (