configured. The first (in alphanumeric order) of the network files that matches a given interface
is applied, all later files are ignored, even if they match as well.</para>
+ <para>Note that any network interfaces that have the <varname>ID_NET_MANAGED_BY=</varname> udev property
+ set will never be matched by any .network files – unless the property's value is the string
+ <literal>io.systemd.Network</literal> – even if the [Match] section would otherwise match. This may be
+ used to exclude specific network interfaces from <command>systemd-networkd</command>'s management, while
+ keeping the [Match] section generic. The <varname>ID_NET_MANAGED_BY=</varname> poperty thus declares
+ intended <emphasis>ownership</emphasis> of the device, and permits ensuring that concurrent network
+ management implementations do not compete for management of specific devices.</para>
+
<para>A network file is said to match a network interface if all matches specified by the [Match]
section are satisfied. When a network file does not contain valid settings in [Match] section, then
the file will match all interfaces and <command>systemd-networkd</command> warns about that. Hint:
int manager_udev_process_link(Manager *m, sd_device *device, sd_device_action_t action) {
int r, ifindex;
+ const char *s;
Link *link;
assert(m);
return 0;
}
+ r = sd_device_get_property_value(device, "ID_NET_MANAGED_BY", &s);
+ if (r < 0 && r != -ENOENT)
+ log_device_debug_errno(device, r, "Failed to get ID_NET_MANAGED_BY udev property, ignoring: %m");
+ if (r >= 0 && !streq(s, "io.systemd.Network")) {
+ log_device_debug(device, "Interface is requested to be managed by '%s', not managing the interface.", s);
+ link_set_state(link, LINK_STATE_UNMANAGED);
+ return 0;
+ }
+
r = link_initialized(link, device);
if (r < 0)
link_enter_failed(link);