From 822918df4cec0ee14a657efb86a08bf7f457e647 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 17 May 2020 21:57:01 +0200 Subject: nixos/scripted-networking: use udev to configure link MACAddress and MTUBytes The `network-link-${i.name}` units raced with other things trying to configure the interface, or ran before the interface was available. Instead of running our own set of shell scripts on boot, and hoping they're executed at the right time, we can make use of udev to configure the interface *while they appear*, by providing `.link` files in /etc/systemd/network/*.link to set MACAddress and MTUBytes. This doesn't require networkd to be enabled, and is populated properly on non-networkd systems since https://github.com/NixOS/nixpkgs/pull/82941. This continues clean-up work done in https://github.com/NixOS/nixpkgs/pull/85170 for the scripted networking stack. The only leftover part of the `network-link-${i.name}` unit (bringing the interface up) is moved to the beginning of the `network-addresses-${i.name}` unit. Fixes: https://github.com/NixOS/nixpkgs/issues/74471 Closes: https://github.com/NixOS/nixpkgs/pull/87116 --- nixos/doc/manual/release-notes/rl-2009.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'nixos/doc') diff --git a/nixos/doc/manual/release-notes/rl-2009.xml b/nixos/doc/manual/release-notes/rl-2009.xml index a4c2719d0445..5d2ffd262e04 100644 --- a/nixos/doc/manual/release-notes/rl-2009.xml +++ b/nixos/doc/manual/release-notes/rl-2009.xml @@ -437,6 +437,21 @@ systemd.services.nginx.serviceConfig.ReadWritePaths = [ "/var/www" ]; Default algorithm for ZRAM swap was changed to zstd. + + + The scripted networking system now uses .link files in + /etc/systemd/network to configure mac address and link MTU, + instead of the sometimes buggy network-link-* units, which + have been removed. + Bringing the interface up has been moved to the beginning of the + network-addresses-* unit. + Note this doesn't require systemd-networkd - it's udev that + parses .link files. + Extra care needs to be taken in the presence of legacy udev rules + to rename interfaces, as MAC Address and MTU defined in these options can only match on the original link name. + In such cases, you most likely want to create a 10-*.link file through and set both name and MAC Address / MTU there. + + -- cgit 1.4.1