nixos-module/container/upstream.nix: setup sched_cake
This commit is contained in:
parent
e9d4f1192f
commit
7615d4d8de
|
@ -12,8 +12,16 @@ let
|
||||||
else null;
|
else null;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
systemd.network.networks = builtins.mapAttrs (_: _: {
|
systemd.network.networks = builtins.mapAttrs (_: { upstream, ... }: {
|
||||||
DHCP = "yes";
|
DHCP = "yes";
|
||||||
|
|
||||||
|
extraConfig = ''
|
||||||
|
[CAKE]
|
||||||
|
Parent = root
|
||||||
|
# DOCSIS overhead
|
||||||
|
OverheadBytes = 18
|
||||||
|
Bandwidth = ${toString upstream.upBandwidth}K
|
||||||
|
'';
|
||||||
}) upstreamInterfaces;
|
}) upstreamInterfaces;
|
||||||
|
|
||||||
networking.nat = lib.optionalAttrs (firstUpstreamInterface != null) {
|
networking.nat = lib.optionalAttrs (firstUpstreamInterface != null) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user