nixos-module/container/upstream: enable dhcpv6 prefix delegation

This commit is contained in:
Astro 2021-04-08 01:43:02 +02:00
parent 0ea6f38867
commit 9615317bf6
1 changed files with 18 additions and 1 deletions

View File

@ -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]