> -----Original Message----- > From: Andrei Borzenkov <arvidjaar@xxxxxxxxx> > Sent: Tuesday, 7 January 2025 4:53 PM > To: Muggeridge, Matt <matt.muggeridge2@xxxxxxx>; systemd- > devel@xxxxxxxxxxxxxxxxxxxxx > Subject: Re: Dynamic link-local address not assigned after > collision > > 07.01.2025 06:01, Muggeridge, Matt wrote: > > I have two systems where I need them to assign link-local addresses in a > 169.254.4/24 subnet, regardless of any other addresses configured. I'm using a > /24 subnet because I have multiple interfaces on the system that require link- > local addresses; I was placing them in their own subnets. > > > > From this > comment<https://urldefense.com/v3/__https://www.freedesktop.org/software > /systemd/man/latest/systemd.network.html*:*:text=If*20an*20IPv4*20link*2D > local*20address*20(169.254.0.0/16)*20is*20specified*2C*20IPv4*20Address* > 20Conflict*20Detection*20(RFC*205227)*20is*20enabled*20for*20the*20ad > dress__;I34lJSUlJSUlJSUlJSUlJSUlJSUlJQ!!NpxR!mUKARk40sTkVB6_bBo- > PwV_8cNH1BnXhG-Rw5RKPlgiLC-wcytrCwj-s_ecVsyLGqy2aUGKa1TplpOp- > JEL3dA$ .> in the man page, I was expecting I could configure the interface > address identically on both systems and leave it to collision detection to pick an > appropriate available address. > > > > The 1st interface assigns its link-local address (169.254.4.2/24). Unfortunately, > the next interface to start doesn't assign any link-local address. I've tried to get > more debug information by increasing log-level to debug, but I get no indications > around the address assignments. > > > > As an experiment, I change the 2nd system to use a different host address in > the same subnet, and it gets assigned correctly. I guess that collision detection is > preventing the address assignment. > > > > How do I achieve this or how can I get more debug information? > > > > The relevant snippet from the network config file is: > > > > [Network] > > Address=169.254.4.2/24 > > > > This is not "dynamic link-local address". It is the fixed address you assigned. If > this address is not available, why do you expect systemd-networkd to silently > substitute it with another one? It behaves this way when using IPv4LLStartAddress. If the address is in use, it chooses another from the 169.254/16 range. The man page for "[Network]" section "Address=" property also states that if it's assigning an IPv4LL address, then it uses IPv4 Address Conflict Detection (RFC5227). That RFC talks about trying a new address. Here's an extract: The configuring software may choose to cease network operation, or it may automatically select a new address so that the host may re-establish IP connectivity as soon as possible. So networkd could choose to select a new address. Currently, it chooses not to try a new address, leaving the interface unusable. > > Link local addressing is more than just the specific prefix. It is a separate > procedure to configure interface that follows well defined rules for selecting > addresses to use. You cannot really mix it with fixed address assignment. > > What could be done is supporting something like > > Address=169.254.4.0/24 > > with the semantic "pick any unused address in this range". > Yes, that's exactly what I'm after. I've been modifying ipv4ll_pick_address() in src/libsystemd-network/sd-ipv4ll.c to achieve this. Hopefully, I'll have some results today. > > > > Full contents of the network configuration follows: > > > > $ networkctl cat 10-eno0.network > > # /etc/systemd/network/10-eno0.network > > [Match] > > KernelCommandLine=!nfsroot > > Name=eno0 > > > > [DHCP] > > ClientIdentifier=mac > > RouteMetric=10 > > UseDomains=yes > > UseHostname=yes > > UseMTU=yes > > > > [IPv6AcceptRA] > > UseRedirect=no > > > > [Link] > > RequiredForOnline=no > > > > [Network] > > DHCP=yes > > Domains=labs.company.net > > NTP=10.10.135.123 > > # LinkLocalAddressing=yes > > # IPv4LLStartAddress=169.254.1.1 > > Address=169.254.4.2/24 > > > > # /usr/lib/systemd/network/10-eno0.network.d/10-network.conf > > [Network] > > MulticastDNS=yes > > > > Regards, > > Matt. > > > >