about summary refs log tree commit diff
path: root/nixos/doc
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-05-17 21:57:01 +0200
committerFlorian Klink <flokli@flokli.de>2020-05-22 10:58:00 +0200
commit822918df4cec0ee14a657efb86a08bf7f457e647 (patch)
tree602874062b890329264597090ef5bb358af35c99 /nixos/doc
parent68eb2c30856e23cf9349f2b093aa9f2d02ab4a9c (diff)
downloadnixlib-822918df4cec0ee14a657efb86a08bf7f457e647.tar
nixlib-822918df4cec0ee14a657efb86a08bf7f457e647.tar.gz
nixlib-822918df4cec0ee14a657efb86a08bf7f457e647.tar.bz2
nixlib-822918df4cec0ee14a657efb86a08bf7f457e647.tar.lz
nixlib-822918df4cec0ee14a657efb86a08bf7f457e647.tar.xz
nixlib-822918df4cec0ee14a657efb86a08bf7f457e647.tar.zst
nixlib-822918df4cec0ee14a657efb86a08bf7f457e647.zip
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
Diffstat (limited to 'nixos/doc')
-rw-r--r--nixos/doc/manual/release-notes/rl-2009.xml15
1 files changed, 15 insertions, 0 deletions
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 <literal>zstd</literal>.
    </para>
    </listitem>
+   <listitem>
+    <para>
+     The scripted networking system now uses <literal>.link</literal> files in
+     <literal>/etc/systemd/network</literal> to configure mac address and link MTU,
+     instead of the sometimes buggy <literal>network-link-*</literal> units, which
+     have been removed.
+     Bringing the interface up has been moved to the beginning of the
+     <literal>network-addresses-*</literal> unit.
+     Note this doesn't require <command>systemd-networkd</command> - it's udev that
+     parses <literal>.link</literal> files.
+     Extra care needs to be taken in the presence of <link xlink:href="https://wiki.debian.org/NetworkInterfaceNames#THE_.22PERSISTENT_NAMES.22_SCHEME">legacy udev rules</link>
+     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 <literal>10-*.link</literal> file through <xref linkend="opt-systemd.network.links"/> and set both name and MAC Address / MTU there.
+    </para>
+   </listitem>
   </itemizedlist>
  </section>
 </section>