Skip to content

Fix inet6 auto/dhcp methods with dhcpcd (DHCP client daemon)

When trying to replace the EOLed ISC DHCP client (dhclient) with dhcpcd (debian package dhcpcd-base, https://github.com/NetworkConfiguration/dhcpcd) on a Debian linux machine with interfaces configured for inet6 dhcp (or auto), I observed ifup/ifdown failures that lead to partially (or un-) configured interfaces. Also, even without any inet6 configuration, dhcpcd will (try to) configure IPv6 addresses on inet dhcp interfaces.

To fix this, the following modifications are made:

  • inet.defn: add -4/--ipv4only option to existing dhcpcd up/down commands
  • inet6.defn: add dhcpcd up/down commands with -6/--ipv6only option (including optional metric option for linux) for methods: auto, dhcp
  • inet6.defn: limit execution of wait-for-ll6.sh script to dhclient (wait-for-ll6.sh seems to have been added as a workaround for a dhclient issue and the script works fine during boot but for some reason fails during ifup after a previous explicit ifdown when using dhcpcd)
  • inet6.defn: update documentation
  • debian/changelog: document changes

The commit also contains an additional, unrelated documentation change:

  • inet.defn: document use of dhcpcd metric option for linux dhcp method

Closes: #1065085

Bug-Debian: https://bugs.debian.org/1065085

[1] The following problems exist for interfaces configured as inet6 auto/dhcp when using dhcpcd as DHCP(v6) client:

  • no IPv4 address(es) assigned to interface
  • IPv6 addresses assigned to interface (using SLAAC and/or DHCPv6, already configured by dhcpcd when started in inet mode)
  • dhcpcd not running (process(es) get terminated)
  • interface remains in down state
  • ifup/dhcpcd errors in /var/log/syslog:
    2024-02-29T13:39:41.353735+01:00 proxy ifup[248]: No DHCPv6 client software found!
    2024-02-29T13:39:41.354868+01:00 proxy ifup[71]: ifup: failed to bring up eth0
    2024-02-29T13:39:41.371856+01:00 proxy dhcpcd[150]: received SIGTERM, stopping
    2024-02-29T13:39:41.372135+01:00 proxy dhcpcd[150]: eth0: removing interface
Edited by Kai Tetzlaff

Merge request reports

Loading