DHCPv6 used without timeout when configuring SLAAC

BobV

New Member
Nov 4, 2024
2
0
1
So, yesterday I made an unexpected mistake by configuring SLAAC on my Proxmox instance, using the following configuration:

Code:
auto vmbr0
iface vmbr0 inet dhcp
        bridge-ports eno1
        bridge-stp off
        bridge-fd 0
iface vmbr0 inet6 auto

According to Debian this is the way of configuring SLAAC, if you want to use DHCPv6 you need to use `dhcp` instead of `auto`.

But, to my surprise, the machine never came back. V4 became pingable, but that was it. As this was a machine without graphical console and the serial console seemingly doing nothing, I needed to go to the DC to find out what was happening, to only be greeted by a "Loading initial ramdisk". Luckily recovery mode exists, and by commenting out the `inet6 auto` line the machine came back to life.

So, what happened? Instead of using SLAAC as configured, it started a dhclient instance for v6 that just continued without messages and without timeout (it did so for about 18 hours).

Code:
2024-11-03T20:18:18.245486+01:00 hyp16 info: executing /sbin/dhclient -6 -x -pf /run/dhclient6.vmbr0.pid -lf /var/lib/dhcp/dhclient6.vmbr0.leases vmbr0
2024-11-03T20:18:18.247527+01:00 hyp16 dhclient[759]: Can't bind to dhcp address: Cannot assign requested address
2024-11-03T20:18:18.247654+01:00 hyp16 dhclient[759]: Please make sure there is no other dhcp server
2024-11-03T20:18:18.247746+01:00 hyp16 dhclient[759]: running and that there's no entry for dhcp or
2024-11-03T20:18:18.247843+01:00 hyp16 dhclient[759]: bootp in /etc/inetd.conf.   Also make sure you
2024-11-03T20:18:18.247943+01:00 hyp16 dhclient[759]: are not running HP JetAdmin software, which
2024-11-03T20:18:18.247997+01:00 hyp16 dhclient[759]: includes a bootp server.
2024-11-03T20:18:18.248024+01:00 hyp16 dhclient[759]:
2024-11-03T20:18:18.248072+01:00 hyp16 dhclient[759]: If you think you have received this message due to a bug rather
2024-11-03T20:18:18.248116+01:00 hyp16 dhclient[759]: than a configuration issue please read the section on submitting
2024-11-03T20:18:18.248141+01:00 hyp16 dhclient[759]: bugs on either our web page at www.isc.org or in the README file
2024-11-03T20:18:18.248166+01:00 hyp16 dhclient[759]: before submitting a bug.  These pages explain the proper
2024-11-03T20:18:18.248194+01:00 hyp16 dhclient[759]: process and the information we find helpful for debugging.
2024-11-03T20:18:18.248222+01:00 hyp16 dhclient[759]:
2024-11-03T20:18:18.248245+01:00 hyp16 dhclient[759]: exiting.
2024-11-03T20:18:19.248120+01:00 hyp16 info: executing /bin/ip -6 addr show vmbr0
2024-11-03T20:18:19.249782+01:00 hyp16 info: executing /sbin/dhclient -6 -pf /run/dhclient6.vmbr0.pid -lf /var/lib/dhcp/dhclient6.vmbr0.leases vmbr0
2024-11-03T20:18:19.256766+01:00 hyp16 dhclient[764]: Created duid "\000\001\000\001.\272\210\373\020\2306\241cu".
2024-11-03T20:18:20.047477+01:00 hyp16 dhclient[764]: XMT: Solicit on vmbr0, interval 1080ms.
2024-11-03T20:18:21.128756+01:00 hyp16 dhclient[764]: XMT: Solicit on vmbr0, interval 2210ms.
2024-11-03T20:18:23.341040+01:00 hyp16 dhclient[764]: XMT: Solicit on vmbr0, interval 4240ms.
2024-11-03T20:18:27.585417+01:00 hyp16 dhclient[764]: XMT: Solicit on vmbr0, interval 8510ms.
2024-11-03T20:18:36.099548+01:00 hyp16 dhclient[764]: XMT: Solicit on vmbr0, interval 16300ms.
2024-11-03T20:18:52.415929+01:00 hyp16 dhclient[764]: XMT: Solicit on vmbr0, interval 31950ms.
2024-11-03T20:19:24.376265+01:00 hyp16 dhclient[764]: XMT: Solicit on vmbr0, interval 61670ms.
2024-11-03T20:20:26.108041+01:00 hyp16 dhclient[764]: XMT: Solicit on vmbr0, interval 112490ms.
2024-11-03T20:22:18.698150+01:00 hyp16 dhclient[764]: XMT: Solicit on vmbr0, interval 122470ms.
2024-11-03T20:24:21.268288+01:00 hyp16 dhclient[764]: XMT: Solicit on vmbr0, interval 118310ms.
etc. etc. etc.

So, from my point of view, the following would be good to have for Proxmox VE:
  1. Don't use DHCPv6 when not configured to do so.
  2. Use a timeout for DHCPv6. If no address is found within an acceptable timeframe, continue to the login so at least you can access your configuration without needing recovery mode. I believe a timeout is already used for DHCP for IPv4, falling back to a self-assigned IP-address.
 
Last edited:
I'm sure DHCPv6 works fine if the network has a DHCPv6 server, the issue is that DHCPv6 was used on a network while the interface has been configured to use SLAAC explicitly.
 
This is actually a real issue. Using iface eno1 inet6 auto should in theory use both SLAAC and DHCPv6. However, the problem is in the logic for the dhclient -6 setup in Proxmox, where it effectively waits for a lease "forever", causing the networking.service job to never finish during boot. By-default there is no timelimit for that job, so the whole boot is effectively stalled (and you have to use rescue mode to revert the changes, which would allow it to boot again).

Using auto does not require DHCPv6 to be present on the network, however, it would use SLAAC + DHCPv6 if both are present.

The more interesting variant is if you use the following:

Code:
iface eno1 inet6 static
    autoconf 1

This is ONLY supposed to do SLAAC (according to the ifupdown manual). No DHCPv6 at all. But Proxmox falls into the same pitfall/problem with this variant as well (and attempts to assign DHCPv6 lease via infinite dhclient -6 attempts).

You can mitigate the "boot never finishes" by doing the following;

Code:
systemctl edit networking.service

# add the following
[Service]
TimeoutStartSec=30sec

This, however, does not solve the problem by using auto or autoconf 1, as it will interrupt the rest of the networking.service startup (leaving interfaces potentially in limbo). If you only need one interface with SLAAC, you could potentially put this interface as the last in the /etc/network/interfaces file, so that when it fails, all of the other interfaces has already been set up.... but thats also a bit of a dirty "workaround".

edit: Seems like SLAAC is default on _all_ interfaces regardless of setup (except inet6 static). On the interface you want to do SLAAC IPv6 only, this worked for me:

Code:
auto eno1
iface eno1 inet dhcp

# no inet6 entry, but slaac is still applied/used on eno1
 
Last edited: