#1065085 ifupdown: ifup fails when using dhcpcd on network with stateful DHCPv6

Package:
ifupdown
Source:
ifupdown
Description:
high level tools to configure network interfaces
Submitter:
ktetzlaff
Date:
2024-08-23 16:45:02 UTC
Severity:
normal
Tags:
#1065085#5
Date:
2024-02-29 15:22:45 UTC
From:
To:
Dear Maintainer,

I was trying to use dhcpcd(-base) as replacement for the deprecated ISC
dhclient DHCP client on interface eth0 in a network which uses DHCPv4
and stateful DHCPv6. The result was a failed interface configuration.

Interface eth0 is configured as follows (in /etc/network/interfaces):

auto eth0
iface eth0 inet dhcp
iface eth0 inet6 dhcp

* What exactly did you do (or not do) that was effective (or
  ineffective)?

Remove package isc-dhcp-client, install dhcpcd-base and reboot (or just
do a manual ifdown/ifup for eth0).

* What was the outcome of this action?

- eth0 reported as down
- 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

- no IPv4 address assigned to eth0
- IPv6 addresses assigned to eth0 (using autoconf and DHCPv6, already
  configured by dhcpcd when started in inet mode)
- dhcpcd DHCP client not running

* What outcome did you expect instead?

- interface status of eth0: up
- running dhcpcd DHCP client on eth0
- valid IPv4 address on eth0
- valid IPv6 address obtained via stateful DHCPv6 (that actually works,
  but the address does not get renewed)

* Full set of messages from ifup/dhcpcd in /var/log/syslog:

2024-02-29T13:39:36.367994+01:00 proxy ifup[147]: dhcpcd-10.0.6 starting
2024-02-29T13:39:36.368548+01:00 proxy ifup[147]: sandbox unavailable: seccomp
2024-02-29T13:39:36.368804+01:00 proxy dhcpcd[147]: dhcpcd-10.0.6 starting
2024-02-29T13:39:36.371607+01:00 proxy ifup[150]: DUID 00:01:00:01:2c:4f:27:17:42:9d:df:42:75:ca
2024-02-29T13:39:36.371853+01:00 proxy dhcpcd[150]: DUID 00:01:00:01:2c:4f:27:17:42:9d:df:42:75:ca
2024-02-29T13:39:36.372491+01:00 proxy ifup[150]: sandbox unavailable: seccomp
2024-02-29T13:39:36.372673+01:00 proxy dhcpcd[150]: sandbox unavailable: seccomp
2024-02-29T13:39:36.395973+01:00 proxy ifup[150]: eth0: IAID df:42:75:ca
2024-02-29T13:39:36.396292+01:00 proxy dhcpcd[150]: eth0: IAID df:42:75:ca
2024-02-29T13:39:36.448694+01:00 proxy ifup[150]: eth0: soliciting a DHCP lease
2024-02-29T13:39:36.448976+01:00 proxy dhcpcd[150]: eth0: soliciting a DHCP lease
2024-02-29T13:39:36.488032+01:00 proxy ifup[150]: eth0: offered 172.30.42.6 from 172.30.42.1
2024-02-29T13:39:36.488311+01:00 proxy dhcpcd[150]: eth0: offered 172.30.42.6 from 172.30.42.1
2024-02-29T13:39:36.492391+01:00 proxy ifup[150]: eth0: probing address 172.30.42.6/24
2024-02-29T13:39:36.492682+01:00 proxy dhcpcd[150]: eth0: probing address 172.30.42.6/24
2024-02-29T13:39:37.353015+01:00 proxy ifup[150]: eth0: soliciting an IPv6 router
2024-02-29T13:39:37.353319+01:00 proxy dhcpcd[150]: eth0: soliciting an IPv6 router
2024-02-29T13:39:37.356886+01:00 proxy ifup[150]: eth0: Router Advertisement from fe80::da58:d7ff:fe00:5b74
2024-02-29T13:39:37.357083+01:00 proxy dhcpcd[150]: eth0: Router Advertisement from fe80::da58:d7ff:fe00:5b74
2024-02-29T13:39:37.357545+01:00 proxy ifup[150]: eth0: adding address 2a02:810d:1680:1f42:ccf0:6a0:a412:49fd/64
2024-02-29T13:39:37.357675+01:00 proxy dhcpcd[150]: eth0: adding address 2a02:810d:1680:1f42:ccf0:6a0:a412:49fd/6
4
2024-02-29T13:39:37.358653+01:00 proxy ifup[150]: eth0: adding route to 2a02:810d:1680:1f42::/64
2024-02-29T13:39:37.358802+01:00 proxy dhcpcd[150]: eth0: adding route to 2a02:810d:1680:1f42::/64
2024-02-29T13:39:37.360136+01:00 proxy ifup[150]: eth0: adding default route via fe80::da58:d7ff:fe00:5b74
2024-02-29T13:39:37.360305+01:00 proxy dhcpcd[150]: eth0: adding default route via fe80::da58:d7ff:fe00:5b74
2024-02-29T13:39:37.362546+01:00 proxy ifup[150]: eth0: soliciting a DHCPv6 lease
2024-02-29T13:39:37.362795+01:00 proxy dhcpcd[150]: eth0: soliciting a DHCPv6 lease
2024-02-29T13:39:38.366362+01:00 proxy ifup[150]: eth0: REPLY6 received from fe80::da58:d7ff:fe00:5b74
2024-02-29T13:39:38.366656+01:00 proxy ifup[150]: eth0: adding address 2a02:810d:1680:1f42::6/128
2024-02-29T13:39:38.366808+01:00 proxy ifup[150]: eth0: renew in 16541, rebind in 26466, expire in 43200 seconds
2024-02-29T13:39:38.366969+01:00 proxy dhcpcd[150]: eth0: REPLY6 received from fe80::da58:d7ff:fe00:5b74
2024-02-29T13:39:38.367152+01:00 proxy dhcpcd[150]: eth0: adding address 2a02:810d:1680:1f42::6/128
2024-02-29T13:39:38.367296+01:00 proxy dhcpcd[150]: eth0: renew in 16541, rebind in 26466, expire in 43200 seconds
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

* Workaround

The attached patch (for current
https://salsa.debian.org/debian/ifupdown.git) avoids the issue and
results in a properly configured eth0 interface. The patch just avoids
the DHCPv6 related error(s) with installed dhcpcd (from the dhcpcd-base
package). This works because with dhcpcd as configured by ifupdown in
inet/IPv4 mode already configures both inet/IPv4 and inet6/IPv6 domains
(which might be another bug).
--- /etc/network/interfaces.d/*:
cat: '/etc/network/interfaces.d/*': No such file or directory
--- up and down scripts installed: /etc/network/if-down.d: total 12 -rwxr-xr-x 1 root root 802 Jan 24 2023 postfix -rwxr-xr-x 1 root root 323 Jan 5 2022 resolvconf -rwxr-xr-x 1 root root 759 Sep 27 2022 resolved /etc/network/if-post-down.d: total 0 /etc/network/if-pre-up.d: total 0 /etc/network/if-up.d: total 16 -rwxr-xr-x 1 root root 965 Jan 5 2022 000resolvconf -rwxr-xr-x 1 root root 1185 Jan 24 2023 postfix -rwxr-xr-x 1 root root 4663 Sep 27 2022 resolved
#1065085#10
Date:
2024-03-01 12:37:34 UTC
From:
To:
Hi,

after running some more tests I'm attaching a patch which might be a
proper fix for the issue. It comprises the following changes (in
inet.defn, inet6.defn):

- 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 but for some reason the script works fine during boot but
  fails during ifup after a previous explicit ifdown when using dhcpcd)
- inet6.defn: update documentation

The patch also contains an additional, unrelated documentation change:
- inet.defn: document use of dhcpcd metric option for linux dhcp method

#1065085#23
Date:
2024-03-01 16:38:41 UTC
From:
To:
I've now created a merge request
(https://salsa.debian.org/debian/ifupdown/-/merge_requests/21) with a
slightly updated version of the patch (including a changelog entry).

#1065085#28
Date:
2024-08-23 16:42:27 UTC
From:
To:
You don't need a separate inet6 line with dhcpcd. This will configure
both IPv6 and IPv4:

allow-hotplug eth0
iface eth0 inet dhcp

Martin-Éric