From c09b2996d7486bb3eebdfb55382db3f7207ebb9f Mon Sep 17 00:00:00 2001 From: Stoiko Ivanov Date: Tue, 19 Mar 2019 16:34:27 +0100 Subject: [PATCH] setup: fix alpine ipv6-slaac configuration busybox ifupdown implementation differs from debian's - configuration type auto is not supported. If SLAAC is selected for the ipv6 configuration of an interface, the complete networking is not started, because of that error. This workaround sets the interface type to 'manual' in case SLAAC is selected (as is already done for dhcpv6 (for different reasons)). That way all other configuration stanzas are setup correctly, and if a ipv4 configuration is present for the same interface the SLAAC-part usually works out of the box anyways (unless 'accept_ra' is set to 0 for the interface in the kernel). Signed-off-by: Stoiko Ivanov --- src/PVE/LXC/Setup/Alpine.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/PVE/LXC/Setup/Alpine.pm b/src/PVE/LXC/Setup/Alpine.pm index e7b8e67..75d6ebe 100644 --- a/src/PVE/LXC/Setup/Alpine.pm +++ b/src/PVE/LXC/Setup/Alpine.pm @@ -79,6 +79,13 @@ sub setup_network { # we can remove this bit. # # Filter out ipv6 dhcp and turn it into 'manual' so they see what's up. + # + # XXX: slaac works different from debian - busybox has no 'auto' + # configuration type - https://wiki.alpinelinux.org/wiki/Configure_Networking#IPv6_Stateless_Autoconfiguration + # the suggested configuration sadly does not take the interface up, but + # at least with the workaround the networking starts and if an ipv4 is + # configured slaac for ipv6 works (unless accept_ra = 0 in the node) + my $netconf = {}; my $networks = {}; foreach my $k (keys %$conf) { @@ -86,7 +93,7 @@ sub setup_network { my $netstring = $conf->{$k}; # check for dhcp6: my $d = PVE::LXC::Config->parse_lxc_network($netstring); - if (defined($d->{ip6}) && $d->{ip6} eq 'dhcp') { + if (defined($d->{ip6}) && ($d->{ip6} eq 'dhcp' || $d->{ip6} eq 'auto')) { $d->{ip6} = 'manual'; $netstring = PVE::LXC::Config->print_lxc_network($d); } -- 2.39.2