mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/networkd: add dhcpV6PrefixDelegationConfig option
networkd gained a new section [DHCPv6PrefixDelegation] which controls delegated prefixes assigned by DHCPv6 client. Added in systemd 246.
This commit is contained in:
parent
53033aaf5a
commit
38f19af769
1 changed files with 29 additions and 0 deletions
|
@ -437,6 +437,7 @@ let
|
||||||
"IPv6ProxyNDP"
|
"IPv6ProxyNDP"
|
||||||
"IPv6ProxyNDPAddress"
|
"IPv6ProxyNDPAddress"
|
||||||
"IPv6PrefixDelegation"
|
"IPv6PrefixDelegation"
|
||||||
|
"DHCPv6PrefixDelegation"
|
||||||
"IPv6MTUBytes"
|
"IPv6MTUBytes"
|
||||||
"Bridge"
|
"Bridge"
|
||||||
"Bond"
|
"Bond"
|
||||||
|
@ -478,6 +479,7 @@ let
|
||||||
(assertValueOneOf "IPv4ProxyARP" boolValues)
|
(assertValueOneOf "IPv4ProxyARP" boolValues)
|
||||||
(assertValueOneOf "IPv6ProxyNDP" boolValues)
|
(assertValueOneOf "IPv6ProxyNDP" boolValues)
|
||||||
(assertValueOneOf "IPv6PrefixDelegation" ["static" "dhcpv6" "yes" "false"])
|
(assertValueOneOf "IPv6PrefixDelegation" ["static" "dhcpv6" "yes" "false"])
|
||||||
|
(assertValueOneOf "DHCPv6PrefixDelegation" boolValues)
|
||||||
(assertByteFormat "IPv6MTUBytes")
|
(assertByteFormat "IPv6MTUBytes")
|
||||||
(assertValueOneOf "ActiveSlave" boolValues)
|
(assertValueOneOf "ActiveSlave" boolValues)
|
||||||
(assertValueOneOf "PrimarySlave" boolValues)
|
(assertValueOneOf "PrimarySlave" boolValues)
|
||||||
|
@ -668,6 +670,17 @@ let
|
||||||
(assertRange "SendOption" 1 65536)
|
(assertRange "SendOption" 1 65536)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
sectionDHCPv6PrefixDelegation = checkUnitConfig "DHCPv6PrefixDelegation" [
|
||||||
|
(assertOnlyFields [
|
||||||
|
"SubnetId"
|
||||||
|
"Announce"
|
||||||
|
"Assign"
|
||||||
|
"Token"
|
||||||
|
])
|
||||||
|
(assertValueOneOf "Announce" boolValues)
|
||||||
|
(assertValueOneOf "Assign" boolValues)
|
||||||
|
];
|
||||||
|
|
||||||
sectionDHCPServer = checkUnitConfig "DHCPServer" [
|
sectionDHCPServer = checkUnitConfig "DHCPServer" [
|
||||||
(assertOnlyFields [
|
(assertOnlyFields [
|
||||||
"PoolOffset"
|
"PoolOffset"
|
||||||
|
@ -1101,6 +1114,18 @@ let
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dhcpV6PrefixDelegationConfig = mkOption {
|
||||||
|
default = {};
|
||||||
|
example = { SubnetId = "auto"; Announce = true; };
|
||||||
|
type = types.addCheck (types.attrsOf unitOption) check.network.sectionDHCPv6PrefixDelegation;
|
||||||
|
description = ''
|
||||||
|
Each attribute in this set specifies an option in the
|
||||||
|
<literal>[DHCPv6PrefixDelegation]</literal> section of the unit. See
|
||||||
|
<citerefentry><refentrytitle>systemd.network</refentrytitle>
|
||||||
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
dhcpServerConfig = mkOption {
|
dhcpServerConfig = mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
example = { PoolOffset = 50; EmitDNS = false; };
|
example = { PoolOffset = 50; EmitDNS = false; };
|
||||||
|
@ -1468,6 +1493,10 @@ let
|
||||||
[DHCPv6]
|
[DHCPv6]
|
||||||
${attrsToSection def.dhcpV6Config}
|
${attrsToSection def.dhcpV6Config}
|
||||||
''
|
''
|
||||||
|
+ optionalString (def.dhcpV6PrefixDelegationConfig != { }) ''
|
||||||
|
[DHCPv6PrefixDelegation]
|
||||||
|
${attrsToSection def.dhcpV6PrefixDelegationConfig}
|
||||||
|
''
|
||||||
+ optionalString (def.dhcpServerConfig != { }) ''
|
+ optionalString (def.dhcpServerConfig != { }) ''
|
||||||
[DHCPServer]
|
[DHCPServer]
|
||||||
${attrsToSection def.dhcpServerConfig}
|
${attrsToSection def.dhcpServerConfig}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue