nixos-module/container/upstream: disable dhcp6 just for flpk-gw

This commit is contained in:
Astro 2022-09-18 18:59:22 +02:00
parent 82594811d4
commit 2133522dc8
1 changed files with 23 additions and 21 deletions

View File

@ -31,27 +31,29 @@ in
Assign = false;
};
};
} // builtins.mapAttrs (_: { upstream, ... }: {
DHCP = "yes";
networkConfig.IPv6AcceptRA = true;
dhcpV6Config.PrefixDelegationHint = "::/56";
# Traffic Shaping
extraConfig = ''
[CAKE]
Parent = root
${lib.optionalString (upstream.provider == "vodafone") ''
# DOCSIS overhead
OverheadBytes = 18
''}
${lib.optionalString (upstream.provider == "dsi") ''
# PPPoE overhead
OverheadBytes = 18
''}
${lib.optionalString (upstream.upBandwidth != null) ''
Bandwidth = ${toString upstream.upBandwidth}K
''}
'';
} // builtins.mapAttrs (_: { upstream, ... }:
lib.optionalAttrs (hostName != "flpk-gw") {
DHCP = "yes";
networkConfig.IPv6AcceptRA = true;
dhcpV6Config.PrefixDelegationHint = "::/56";
} // {
# Traffic Shaping
extraConfig = ''
[CAKE]
Parent = root
${lib.optionalString (upstream.provider == "vodafone") ''
# DOCSIS overhead
OverheadBytes = 18
''}
${lib.optionalString (upstream.provider == "dsi") ''
# PPPoE overhead
OverheadBytes = 18
''}
${lib.optionalString (upstream.upBandwidth != null) ''
Bandwidth = ${toString upstream.upBandwidth}K
''}
'';
}
}) upstreamInterfaces;
networking.nat = lib.optionalAttrs enabled {