Handling of renamed interfaces

Beniamino Galvani bgalvani at redhat.com
Wed Jan 3 20:26:16 UTC 2024


On Wed, Jan 03, 2024 at 08:23:58PM +0300, Andrei Borzenkov wrote:
> I was looking at forum post where user had to restart NetworkManager after
> boot to get working network. It seems that the system is too fast and
> interfaces get renamed by udev after NetworkManager has been started and saw
> the interfaces under the original name. Like
> 
> ...
> Jan 03 17:51:39 XPS-Station NetworkManager[1088]: <info> [1704297099.0481]
> device (wlan0): interface index 2 renamed iface from 'wlan0' to 'wlp58s0'
> ...
> Jan 03 17:51:39 XPS-Station NetworkManager[1088]: <info> [1704297099.0850]
> device (wlp58s0): state change: unmanaged -> unavailable (reason 'managed',
> sys-iface-state: 'external')
> 
> So NM treats them as external and ignores. After restart NM starts with new
> interface names and continues.
> 
> Is it expected behavior? I do not see any practical way to synchronize
> interface renaming with starting of NM. Is it possible to tell NM to
> continue handling interfaces under the new name?

> The full log after boot is available as:


Hi,

NM waits that udev has renamed the interface before starting to
manage it. It does so by using libudev which monitors the netlink
events generated by udev.

You can see that in the log above, where the interface moves from
"unmanaged" to "unavailable" just after the rename. In "unavailable",
the WiFi device is waiting for wpa_supplicant to initialize the
interface, and you should see that it moves to "disconnected" some
time later.

For an overview of device states see:

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/1.45.9-dev/docs/internal/device.md#device-states

If the device stays in "unavailable", please enable trace logging in
NM to debug why (set level=trace in the [logging] section of
/etc/NetworkManager/NetworkManager.conf and restart the service).

Beniamino
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/networkmanager/attachments/20240103/e4415883/attachment.sig>


More information about the Networkmanager mailing list