Skip to content

Commit

Permalink
nixos/network-interfaces-systemd: fix IPv6 privacy extensions
Browse files Browse the repository at this point in the history
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 NixOS#106858.
Upstream Issue: systemd/systemd#18003
  • Loading branch information
flokli authored and FRidh committed Dec 17, 2020
1 parent 91b8237 commit d349582
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion nixos/modules/tasks/network-interfaces-systemd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d349582

Please sign in to comment.