Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: networkd: honour a new ID_NET_MANAGED_BY udev propery or so #29768

Closed
poettering opened this issue Oct 30, 2023 · 4 comments · Fixed by #29782
Closed

RFE: networkd: honour a new ID_NET_MANAGED_BY udev propery or so #29768

poettering opened this issue Oct 30, 2023 · 4 comments · Fixed by #29782
Labels
network RFE 🎁 Request for Enhancement, i.e. a feature request

Comments

@poettering
Copy link
Member

poettering commented Oct 30, 2023

Right now NetworkManager and networkd are happy to fight for ownership of network interfaces. That kinda sucks.

Here's an idea: let's make both unconditionally honour a NET_MANAGED_BY= udev property, and if set to any string that is different from some identifier for the respective project, the interfaces will be left unmanaged.

And example:

  1. systemd-networkd would leave all interfaces unmanaged where NET_MANAGED_BY= is set to a string other than io.systemd.networkd
  2. NetworkManager would leave all interfaces unmanaged where NET_MANAGED_BY= is set set to a string other than dev.networkmanager.nm

If the property is not set we'll live in the wild-west as before.

What's the usecase?

Allowing the admin to make an explicit choice which project shall manage which interfaces. (Could even be generated dynamically via rules files in /run/)

What's not the usecase?

This is not a locking concept: if both NM and networkd are told to configure a device then they will still fight for it.

@poettering poettering added the RFE 🎁 Request for Enhancement, i.e. a feature request label Oct 30, 2023
@poettering
Copy link
Member Author

Since this obviously means NetworkManager needs to be on board too with this, @thom311 would this make sense to you?

@poettering poettering changed the title networkd: honour a new NET_MANAGED_BY udev propery or so RFE: networkd: honour a new NET_MANAGED_BY udev propery or so Oct 30, 2023
@thom311
Copy link
Contributor

thom311 commented Oct 30, 2023

NetworkManager already honors NM_UNMANAGED=1 (it defaults to managing interfaces that it finds, under the assumption that you run NetworkManager to use it).

Supporting a NET_MANAGED_BY= (in addition) makes sense to me.

@yuwata
Copy link
Member

yuwata commented Oct 31, 2023

-> #29782.

yuwata added a commit to yuwata/systemd that referenced this issue Oct 31, 2023
If the property is set, networkd manages the interface only when its
value is "io.systemd.Network".

Closes systemd#29768.
@poettering
Copy link
Member Author

As discussed over at #29782 let's please clal the prop ID_NET_MANAGED_BY=, i.e. let's stick to the ID_ prefix, which we traditionally use for systemd/udev's properties, to ensure we don't collide with unprefixed names the kernel includes in its uevents.

@poettering poettering changed the title RFE: networkd: honour a new NET_MANAGED_BY udev propery or so RFE: networkd: honour a new ID_NET_MANAGED_BY udev propery or so Oct 31, 2023
yuwata added a commit to yuwata/systemd that referenced this issue Nov 1, 2023
If the property is set, networkd manages the interface only when its
value is "io.systemd.Network".

Closes systemd#29768.
poettering pushed a commit that referenced this issue Nov 1, 2023
If the property is set, networkd manages the interface only when its
value is "io.systemd.Network".

Closes #29768.
thom311 added a commit to NetworkManager/NetworkManager that referenced this issue Nov 2, 2023
…age device

If ID_NET_MANAGED_BY= attribute is set, we have an indication who is
responsible for the device. If this is set to anything but
"org.freedesktop.NetworkManager", then the device is unmanaged.

The effect is the same as setting NM_UNMANAGED= attribute. NM_UNMANAGED=
takes precedence over this setting.

See-also: systemd/systemd#29768
See-also: systemd/systemd#29782
ssahani pushed a commit to ssahani/systemd that referenced this issue Nov 23, 2023
If the property is set, networkd manages the interface only when its
value is "io.systemd.Network".

Closes systemd#29768.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
network RFE 🎁 Request for Enhancement, i.e. a feature request
Development

Successfully merging a pull request may close this issue.

3 participants