]> git.proxmox.com Git - pve-container.git/commitdiff
setup: fix alpine ipv6-slaac configuration
authorStoiko Ivanov <s.ivanov@proxmox.com>
Tue, 19 Mar 2019 15:34:27 +0000 (16:34 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 20 Mar 2019 12:47:25 +0000 (13:47 +0100)
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 <s.ivanov@proxmox.com>
src/PVE/LXC/Setup/Alpine.pm

index e7b8e67c9b0ce8b6f40b44d64b96c762452efeb1..75d6ebe0bd9d4df7b956483768ca8afebfd12f61 100644 (file)
@@ -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);
        }