nixos-module/container/dhcp-server: fix reservations by moving them from global dhcp4 config to subnet4
This commit is contained in:
parent
0e2c4c7afd
commit
b78f9c9305
|
@ -30,7 +30,7 @@ in
|
||||||
# ddns-conflict-resolution-mode = "check-exists-with-dhcid";
|
# ddns-conflict-resolution-mode = "check-exists-with-dhcid";
|
||||||
ddns-use-conflict-resolution = false;
|
ddns-use-conflict-resolution = false;
|
||||||
|
|
||||||
subnet4 = concatMapDhcpNets (net: { vlan, subnet4, dhcp, domainName, ... }: {
|
subnet4 = concatMapDhcpNets (net: { vlan, subnet4, hosts4, dhcp, domainName, ... }: {
|
||||||
id = vlan;
|
id = vlan;
|
||||||
subnet = subnet4;
|
subnet = subnet4;
|
||||||
pools = [ {
|
pools = [ {
|
||||||
|
@ -56,12 +56,7 @@ in
|
||||||
data = "172.20.73.8, 9.9.9.9";
|
data = "172.20.73.8, 9.9.9.9";
|
||||||
} ];
|
} ];
|
||||||
ddns-qualifying-suffix = domainName;
|
ddns-qualifying-suffix = domainName;
|
||||||
});
|
reservations = lib.pipe dhcp.fixed-hosts [
|
||||||
|
|
||||||
match-client-id = false;
|
|
||||||
host-reservation-identifiers = [ "hw-address" ];
|
|
||||||
reservations = concatMapDhcpNets (net: { hosts4, dhcp, ... }:
|
|
||||||
lib.pipe dhcp.fixed-hosts [
|
|
||||||
(builtins.mapAttrs (fixedAddr: hwaddr:
|
(builtins.mapAttrs (fixedAddr: hwaddr:
|
||||||
if hosts4 ? ${fixedAddr}
|
if hosts4 ? ${fixedAddr}
|
||||||
then # fixedAddr is a known hostname
|
then # fixedAddr is a known hostname
|
||||||
|
@ -94,8 +89,11 @@ in
|
||||||
))
|
))
|
||||||
builtins.attrValues
|
builtins.attrValues
|
||||||
(builtins.filter (r: r != null))
|
(builtins.filter (r: r != null))
|
||||||
]
|
];
|
||||||
);
|
});
|
||||||
|
|
||||||
|
match-client-id = false;
|
||||||
|
host-reservation-identifiers = [ "hw-address" ];
|
||||||
|
|
||||||
# Netbooting
|
# Netbooting
|
||||||
option-def = [ {
|
option-def = [ {
|
||||||
|
|
Loading…
Reference in New Issue