all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Hannes Laimer <h.laimer@proxmox.com>
To: Gabriel Goller <g.goller@proxmox.com>, pve-devel@lists.proxmox.com
Subject: Re: [PATCH container] lxc: debian: avoid 'inet6 auto' with debian's ifupdown2
Date: Fri, 11 Sep 2026 13:13:22 +0200	[thread overview]
Message-ID: <2dc5df98-2f89-40bd-ab34-89e06c671ca2@proxmox.com> (raw)
In-Reply-To: <20260911095623.429947-1-g.goller@proxmox.com>

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 (





      reply	other threads:[~2026-09-11 11:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2dc5df98-2f89-40bd-ab34-89e06c671ca2@proxmox.com \
    --to=h.laimer@proxmox.com \
    --cc=g.goller@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal