router: allow assigning ips per duid
This commit is contained in:
parent
73b1b3b47d
commit
ce2d2e4a78
|
@ -282,6 +282,7 @@ in {
|
|||
];
|
||||
router-settings.dhcp6Reservations = [
|
||||
{ ipAddress = serverAddress6;
|
||||
duid = cfg.serverDuid;
|
||||
macAddress = cfg.serverMac; }
|
||||
{ ipAddress = vacuumAddress6;
|
||||
macAddress = cfg.vacuumMac; }
|
||||
|
@ -434,11 +435,11 @@ in {
|
|||
gateways = [ netAddresses.lan6 ];
|
||||
radvdSettings.AdvAutonomous = true;
|
||||
coreradSettings.autonomous = true;
|
||||
# don't autoallocate addresses, keep autonomous ones
|
||||
# don't allocate addresses for most devices
|
||||
keaSettings.pools = [ ];
|
||||
# just assign the reservations
|
||||
keaSettings.reservations = map (res: {
|
||||
hw-address = res.macAddress;
|
||||
keaSettings.reservations = map (res:
|
||||
(if res.duid != null then { duid = res.duid; } else { hw-address = res.macAddress; }) // {
|
||||
ip-addresses = [ res.ipAddress ];
|
||||
}) cfg.dhcp6Reservations;
|
||||
});
|
||||
|
|
|
@ -13,6 +13,11 @@
|
|||
description = "server's mac address";
|
||||
type = lib.types.str;
|
||||
};
|
||||
serverDuid = lib.mkOption {
|
||||
description = "server's duid";
|
||||
type = with lib.types; nullOr str;
|
||||
default = null;
|
||||
};
|
||||
serverInitrdMac = lib.mkOption {
|
||||
description = "server's mac address in initrd";
|
||||
type = lib.types.str;
|
||||
|
@ -92,9 +97,15 @@
|
|||
description = "device's ip address";
|
||||
};
|
||||
options.macAddress = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
type = with lib.types; nullOr str;
|
||||
default = null;
|
||||
description = "device's mac address";
|
||||
};
|
||||
options.duid = lib.mkOption {
|
||||
type = with lib.types; nullOr str;
|
||||
default = null;
|
||||
description = "device's duid";
|
||||
};
|
||||
});
|
||||
};
|
||||
dnatRules = lib.mkOption {
|
||||
|
|
Loading…
Reference in a new issue