diff options
author | Florian Klink <flokli@flokli.de> | 2020-12-16 21:35:12 +0100 |
---|---|---|
committer | Frederik Rietdijk <freddyrietdijk@fridh.nl> | 2020-12-17 07:29:25 +0100 |
commit | d349582c0769aa4b9c48e7921e5510072dd37c74 (patch) | |
tree | ebb2553ff15e5d45b012c6614d7d188a03cd2f4f /nixos/modules/tasks/network-interfaces-systemd.nix | |
parent | 91b8237b4839ca2e43c11ff3cc28606692748fff (diff) | |
download | nixpkgs-d349582c0769aa4b9c48e7921e5510072dd37c74.tar nixpkgs-d349582c0769aa4b9c48e7921e5510072dd37c74.tar.gz nixpkgs-d349582c0769aa4b9c48e7921e5510072dd37c74.tar.bz2 nixpkgs-d349582c0769aa4b9c48e7921e5510072dd37c74.tar.lz nixpkgs-d349582c0769aa4b9c48e7921e5510072dd37c74.tar.xz nixpkgs-d349582c0769aa4b9c48e7921e5510072dd37c74.tar.zst nixpkgs-d349582c0769aa4b9c48e7921e5510072dd37c74.zip |
nixos/network-interfaces-systemd: fix IPv6 privacy extensions
networkd seems to be buggy with IPv6PrivacyExtensions=kernel being set, and the addresses don't appear anymore. In fact, the corresponding sysctl seems to be set to -1 again. Fixes https://github.com/NixOS/nixpkgs/issues/106858. Upstream Issue: https://github.com/systemd/systemd/issues/18003
Diffstat (limited to 'nixos/modules/tasks/network-interfaces-systemd.nix')
-rw-r--r-- | nixos/modules/tasks/network-interfaces-systemd.nix | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/nixos/modules/tasks/network-interfaces-systemd.nix b/nixos/modules/tasks/network-interfaces-systemd.nix index 23e1e611a71..088bffd7c50 100644 --- a/nixos/modules/tasks/network-interfaces-systemd.nix +++ b/nixos/modules/tasks/network-interfaces-systemd.nix @@ -93,7 +93,17 @@ in (if i.useDHCP != null then i.useDHCP else false)); address = forEach (interfaceIps i) (ip: "${ip.address}/${toString ip.prefixLength}"); - networkConfig.IPv6PrivacyExtensions = "kernel"; + # IPv6PrivacyExtensions=kernel seems to be broken with networkd. + # Instead of using IPv6PrivacyExtensions=kernel, configure it according to the value of + # `tempAddress`: + networkConfig.IPv6PrivacyExtensions = { + # generate temporary addresses and use them by default + "default" = true; + # generate temporary addresses but keep using the standard EUI-64 ones by default + "enabled" = "prefer-public"; + # completely disable temporary addresses + "disabled" = false; + }.${i.tempAddress}; linkConfig = optionalAttrs (i.macAddress != null) { MACAddress = i.macAddress; } // optionalAttrs (i.mtu != null) { |