Am Dienstag, dem 27.01.2026 um 13:09 +0300 schrieb Michael Tokarev: > Hi! > > I faced an interesting situation here with networkd, manually added IP > address, and momentary carrier loss on the interface. > > We had an ethernet interface with an IP address A, configured in > /etc/systemd/network/ as usual. > > For testing purposes, I've added another address, B, to the same interface, > using command `ip addr add B dev IFACE`. This address has become "secondary" > address on the interface: > > inet A scope global IFACE > valid_lft forever preferred_lft forever > inet B scope global secondary IFACE > > This temporary address, B, is not specified in networkd config, only > runtme-added. > > With this configuration, outgoing connections were using source address A, > expectedly, since this one is the primary address. > > Now, a momentary carrier loss occurred. During the loss, networkd removed IP > addresses it managed from the interface. So the only address remains is the > manually added B. > > Now, after carrier is back again, networkd added address A back. But now, it > has become *secondary* instead: > > inet B scope global IFACE > valid_lft forever preferred_lft forever > inet A scope global secondary IFACE > > (it is the same situation as before, but with A and B swapped). > > And now, nothing ever worked, since address B isn't supposed to be used as > source address, firewall rules prevented all outgoing connections. > > Yes I'm aware about IgnoreCarrierLoss and other related parameters. > > But I wonder if we can handle this situation better? > > Thanks, > > /mjt
Hi, don't configure interfaces outside of sd-networkd. If a network manager assumes complete control over an interface, it doesn't care about other settings. So in your case the appropriate solution would have been to 1. edit the configuration file in /etc/systemd/network/`, 2. `networkctl reload` to read the changed configuration file and 3. `networkctl reconfigure <interface>` to apply the changes. HTH. Silvio
