* [PATCH container] lxc: debian: avoid 'inet6 auto' with debian's ifupdown2
@ 2026-09-11 9:56 Gabriel Goller
2026-09-11 11:13 ` Hannes Laimer
0 siblings, 1 reply; 2+ messages in thread
From: Gabriel Goller @ 2026-09-11 9:56 UTC (permalink / raw)
To: pve-devel
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 <g.goller@proxmox.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH container] lxc: debian: avoid 'inet6 auto' with debian's ifupdown2
2026-09-11 9:56 [PATCH container] lxc: debian: avoid 'inet6 auto' with debian's ifupdown2 Gabriel Goller
@ 2026-09-11 11:13 ` Hannes Laimer
0 siblings, 0 replies; 2+ messages in thread
From: Hannes Laimer @ 2026-09-11 11:13 UTC (permalink / raw)
To: Gabriel Goller, pve-devel
lgtm!
Reviewed-by: Hannes Laimer <h.laimer@proxmox.com>
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 <g.goller@proxmox.com>
> ---
> 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 (
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-11 11:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-11 9:56 [PATCH container] lxc: debian: avoid 'inet6 auto' with debian's ifupdown2 Gabriel Goller
2026-09-11 11:13 ` Hannes Laimer
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.