forked from zentralwerk/network
nixos-module/container/upstream: fix DHCP for upstream3, upstream4
This commit is contained in:
parent
68afa61ca1
commit
cfb062063a
|
@ -98,6 +98,8 @@ in
|
||||||
upstream2.interfaces.up2.upstream.noNat.subnets6 = [
|
upstream2.interfaces.up2.upstream.noNat.subnets6 = [
|
||||||
"2a02:8106:208:e900::/56"
|
"2a02:8106:208:e900::/56"
|
||||||
];
|
];
|
||||||
|
upstream3.interfaces.up3.upstream = {};
|
||||||
|
upstream4.interfaces.up4.upstream = {};
|
||||||
upstream1.ospf.upstreamInstance = 3;
|
upstream1.ospf.upstreamInstance = 3;
|
||||||
upstream2.ospf.upstreamInstance = 4;
|
upstream2.ospf.upstreamInstance = 4;
|
||||||
anon1.ospf.upstreamInstance = 5;
|
anon1.ospf.upstreamInstance = 5;
|
||||||
|
@ -164,15 +166,14 @@ in
|
||||||
interfaces =
|
interfaces =
|
||||||
builtins.mapAttrs (net: interface:
|
builtins.mapAttrs (net: interface:
|
||||||
renameAttr "gw" "gw4"
|
renameAttr "gw" "gw4"
|
||||||
(forceVeth interface) // {
|
(forceVeth interface) // (
|
||||||
upstream =
|
|
||||||
if ctPillar ? upstream &&
|
if ctPillar ? upstream &&
|
||||||
ctPillar.upstream.interface == net
|
ctPillar.upstream.interface == net
|
||||||
then {
|
then {
|
||||||
upBandwidth = ctPillar.upstream.up-bandwidth;
|
upstream.upBandwidth = ctPillar.upstream.up-bandwidth;
|
||||||
}
|
|
||||||
else null;
|
|
||||||
}
|
}
|
||||||
|
else {}
|
||||||
|
)
|
||||||
) container.interfaces;
|
) container.interfaces;
|
||||||
|
|
||||||
wireguard =
|
wireguard =
|
||||||
|
|
|
@ -105,6 +105,7 @@ let
|
||||||
upstreamOpts = {
|
upstreamOpts = {
|
||||||
upBandwidth = mkOption {
|
upBandwidth = mkOption {
|
||||||
type = with types; nullOr int;
|
type = with types; nullOr int;
|
||||||
|
default = null;
|
||||||
};
|
};
|
||||||
noNat.subnets6 = mkOption {
|
noNat.subnets6 = mkOption {
|
||||||
type = with types; listOf str;
|
type = with types; listOf str;
|
||||||
|
|
|
@ -40,7 +40,9 @@ in
|
||||||
Parent = root
|
Parent = root
|
||||||
# DOCSIS overhead
|
# DOCSIS overhead
|
||||||
OverheadBytes = 18
|
OverheadBytes = 18
|
||||||
|
${lib.optionalString (upstream.upBandwidth != null) ''
|
||||||
Bandwidth = ${toString upstream.upBandwidth}K
|
Bandwidth = ${toString upstream.upBandwidth}K
|
||||||
|
''}
|
||||||
'';
|
'';
|
||||||
}) upstreamInterfaces;
|
}) upstreamInterfaces;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user