Le 01/11/2025 à 16:59, Daniel Gröber a écrit :
Hi Vincent,

On Thu, Oct 23, 2025 at 09:27:54PM +0200, Vincent Danjean wrote:
As I've a multi-ISP config, I want to share here a bit of my config,
as an example of unusual config.

For one of my ISP, I've the following config:
iface en-rezine inet6 auto
         dhcp 1
         accept_ra 0

dhcp is required as my ISP only gives me a local-link address
(via DHCP)

I think there are some misconceptions in your config or my understanding of
how the pieces fit together. Assuming you're currently using
isc-dhcp-client:

  - DHCP(v6) is not involved in link-local assignment the kernel does it.

Yes, and I'm pleased that the kernel does it on this interface

  - `dhcp 1` is stateless DHCP and will not assign an address on it's own.

I've lots of interfaces on this machine (vlan for internal networks,
vpn, interface to reach virtual machines, uplinks). This interface is
the only one having
  dhcp 1
And this is the only one interface that runs dhclient (IPv6):
3399342 ?        Ss     0:00 dhclient -6 -v -P -pf /run/dhclient6.en-rezine.pid 
-lf /var/lib/dhcp/dhclient6.en-rezine.leases -I -df 
/var/lib/dhcp/dhclient.en-rezine.leases en-rezine
I've two other dhclient but for IPv4 (on the same interface and on the other 
uplink)

I'm pretty sure that "dhcp 1" is the reason for "dhclient -6 ..." to be running.

And I just checked:
ifdown en-rezine
# I see both dhclient (IPv4 and Ipv6) being stopped
vi /etc/network/interface
# => comment out "dhcp 1"
ifup en-rezine
# only dhclient -4 runs

So "dhcp 1" starts "dhclient -6 ..." on this interface

  - `accept_ra 0` will prevent kernel SLAAC address and (default) route
    creation entirely, leaving no address configuration method enabled
    (other than link-local).  Further, no stateful DHCPv6 client will be
    enabled by RA flag M being advertised by the network since that's not
    supported by dhclient AFAIK.

I use this config indeed to prevent the default route to be set (here again
this is due to the multi ISP settings and specific routing policy), while
preserving kernel SLAAC address allocation and requesting prefix delegation
with dhcp (IPv6).

and also a /48 via prefix delegation (in DHCP),

  - `request_prefix` defaults to OFF in both method auto and dhcp.

When "dhcp 1" is there and "dhclient -6 ..." is run, I can see:
Internet Systems Consortium DHCP Client 4.4.3-P1
Copyright 2004-2022 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on Socket/en-rezine
Sending on   Socket/en-rezine
PRC: Confirming active lease (INIT-REBOOT).
XMT: Forming Rebind, 0 ms elapsed.
XMT:  X-- IA_PD 00:77:00:09
XMT:  | X-- Requested renew  +3600
XMT:  | X-- Requested rebind +5400
XMT:  | | X-- IAPREFIX 2001:XXXX:XXXX:XXXX::/56
XMT:  | | | X-- Preferred lifetime +7200
XMT:  | | | X-- Max lifetime +7500
XMT:  V IA_PD appended.
XMT: Rebind on en-rezine, interval 1060ms.
RCV: Reply message on en-rezine from fe80::XXXX:XXXX:XXXX:XXXX.
RCV:  X-- IA_PD XX:XX:XX:XX
RCV:  | X-- starts 1762016816
RCV:  | X-- t1 - renew  +1100
RCV:  | X-- t2 - rebind +1150
RCV:  | X-- [Options]
RCV:  | | X-- IAPREFIX 2001:XXXX:XXXX:XXXX::/56
RCV:  | | | X-- Preferred lifetime 1200.
RCV:  | | | X-- Max lifetime 1400.
RCV:  X-- Server ID: 00:01:XX:XX:...
PRC: Bound to lease 00:01:XX:XX:....

None of what you describe should be working.

;-) I would be pleased to do some experiments if you want to

Something other than ifupdown+dhclient must be making this work. Do you
have dhcpcd installed without knowing it? :-)

/usr/share/doc# ls -d *dhc*
isc-dhcp-client  isc-dhcp-common  isc-dhcp-server

isc-dhcp-server is used for my internal network interfaces, and only for IPv4.
For IPv6, I use radvd on my internal network interfaces.

Note that the routing for the delegated prefix is manually set (in shorewall).
But, if the dhclient does not request it, the ISP does not route it to my 
interface.

but do not get any specific IPv6 within the /48 directly
(via SLAAC nor via DHCP)
I ignore RA as I configure a local radvd daemon (I've a multi-ISP config)

I'm using isc-dhcp-client. I hope, but not test, that dhcpcd also
handle prefix delegation correctly.

Supporting `request_prefix` with dhcpcd is on my TODO list. You can easily
drop down to dhcpcd.conf even without support in ifupdown though.

"apt-cache policy dhcpcd*" shows me that no package whose name start by dhcpcd 
is installed.
In particular:
dhcpcd:
  Installé : (aucun)
  Candidat : 1:9.4.1-24~deb12u4
 Table de version :
     1:10.1.0-11~bpo12+1 550
        550 http://deb.debian.org/debian bookworm-backports/main amd64 Packages
     1:9.4.1-24~deb12u4 990
        990 http://deb.debian.org/debian bookworm/main amd64 Packages

Also note that I'm a user of the /etc/dhcp/dhclient-enter-hooks.d
interface. Due to the multi-ISP setup, I remove with a script
the default IPv4 route classically added by DHCP for my different ISP.
The routing is manually handled by shorewall config.

Makes sense. I'd be happy to support the old dhclient-*-hooks.d interface,
but we need to review all the existing scripts in Debian to make sure
nothing will break spectacularly.

Could you help review them for compatibility if I look at where the
incompatibilities with dhcpcd's hook environment might lie?

I can do some experiments. It is a VM. I can clone it to make tests and quickly 
go back to the previous state.

  Regards,
    Vincent


Thanks,
--Daniel

Reply via email to