diff --git a/nix/nixos-module/container/upstream.nix b/nix/nixos-module/container/upstream.nix index 31c707d..941f73e 100644 --- a/nix/nixos-module/container/upstream.nix +++ b/nix/nixos-module/container/upstream.nix @@ -12,8 +12,25 @@ let else null; in { - systemd.network.networks = builtins.mapAttrs (_: { upstream, ... }: { + systemd.network.networks = { + core = { + # systemd-networkd only requests Prefix Delegation via DHCPv6 on + # the upstream interface if another interface is configured for it. + # without this, the static ipv6 subnet won't be routed to us. + extraConfig = '' + [Network] + IPv6PrefixDelegation=dhcpv6 + ''; + dhcpV6PrefixDelegationConfig = { + SubnetId = "81"; + # because we have static addresses, we don't actually use this + Assign = false; + }; + }; + } // builtins.mapAttrs (_: { upstream, ... }: { DHCP = "yes"; + networkConfig.IPv6AcceptRA = true; + dhcpV6Config.PrefixDelegationHint = "::/56"; extraConfig = '' [CAKE]