Merge pull request #195154 from veehaitch/networkd-ipv6-pd

nixos/networkd: add/adopt IPv6 options
This commit is contained in:
Florian Klink 2022-10-13 23:00:26 +02:00 committed by GitHub
commit d90ffb83c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 84 additions and 14 deletions

View File

@ -604,6 +604,47 @@
instead.
</para>
</listitem>
<listitem>
<para>
<literal>systemd-networkd</literal> v250 deprecated, renamed,
and moved some sections and settings which leads to the
following breaking module changes:
</para>
<itemizedlist spacing="compact">
<listitem>
<para>
<literal>systemd.network.networks.&lt;name&gt;.dhcpV6PrefixDelegationConfig</literal>
is renamed to
<literal>systemd.network.networks.&lt;name&gt;.dhcpPrefixDelegationConfig</literal>.
</para>
</listitem>
<listitem>
<para>
<literal>systemd.network.networks.&lt;name&gt;.dhcpV6Config</literal>
no longer accepts the
<literal>ForceDHCPv6PDOtherInformation=</literal> setting.
Please use the <literal>WithoutRA=</literal> and
<literal>UseDelegatedPrefix=</literal> settings in your
<literal>systemd.network.networks.&lt;name&gt;.dhcpV6Config</literal>
and the <literal>DHCPv6Client=</literal> setting in your
<literal>systemd.network.networks.&lt;name&gt;.ipv6AcceptRAConfig</literal>
to control when the DHCPv6 client is started and how the
delegated prefixes are handled by the DHCPv6 client.
</para>
</listitem>
<listitem>
<para>
<literal>systemd.network.networks.&lt;name&gt;.networkConfig</literal>
no longer accepts the <literal>IPv6Token=</literal>
setting. Use the <literal>Token=</literal> setting in your
<literal>systemd.network.networks.&lt;name&gt;.ipv6AcceptRAConfig</literal>
instead. The
<literal>systemd.network.networks.&lt;name&gt;.ipv6Prefixes.*.ipv6PrefixConfig</literal>
now also accepts the <literal>Token=</literal> setting.
</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>
The <literal>meta.mainProgram</literal> attribute of packages

View File

@ -201,6 +201,12 @@ Available as [services.patroni](options.html#opt-services.patroni.enable).
- The `aws` package has been removed due to being abandoned by the upstream. It is recommended to use `awscli` or `awscli2` instead.
- `systemd-networkd` v250 deprecated, renamed, and moved some sections and settings which leads to the following breaking module changes:
* `systemd.network.networks.<name>.dhcpV6PrefixDelegationConfig` is renamed to `systemd.network.networks.<name>.dhcpPrefixDelegationConfig`.
* `systemd.network.networks.<name>.dhcpV6Config` no longer accepts the `ForceDHCPv6PDOtherInformation=` setting. Please use the `WithoutRA=` and `UseDelegatedPrefix=` settings in your `systemd.network.networks.<name>.dhcpV6Config` and the `DHCPv6Client=` setting in your `systemd.network.networks.<name>.ipv6AcceptRAConfig` to control when the DHCPv6 client is started and how the delegated prefixes are handled by the DHCPv6 client.
* `systemd.network.networks.<name>.networkConfig` no longer accepts the `IPv6Token=` setting. Use the `Token=` setting in your `systemd.network.networks.<name>.ipv6AcceptRAConfig` instead. The `systemd.network.networks.<name>.ipv6Prefixes.*.ipv6PrefixConfig` now also accepts the `Token=` setting.
- The `meta.mainProgram` attribute of packages in `wineWowPackages` now defaults to `"wine64"`.
- The `paperless` module now defaults `PAPERLESS_TIME_ZONE` to your configured system timezone.

View File

@ -501,7 +501,6 @@ let
"LinkLocalAddressing"
"IPv4LLRoute"
"DefaultRouteOnDevice"
"IPv6Token"
"LLMNR"
"MulticastDNS"
"DNSOverTLS"
@ -526,7 +525,7 @@ let
"IPv6ProxyNDP"
"IPv6ProxyNDPAddress"
"IPv6SendRA"
"DHCPv6PrefixDelegation"
"DHCPPrefixDelegation"
"IPv6MTUBytes"
"Bridge"
"Bond"
@ -569,12 +568,11 @@ let
(assertValueOneOf "IPv4ProxyARP" boolValues)
(assertValueOneOf "IPv6ProxyNDP" boolValues)
(assertValueOneOf "IPv6SendRA" boolValues)
(assertValueOneOf "DHCPv6PrefixDelegation" boolValues)
(assertValueOneOf "DHCPPrefixDelegation" boolValues)
(assertByteFormat "IPv6MTUBytes")
(assertValueOneOf "ActiveSlave" boolValues)
(assertValueOneOf "PrimarySlave" boolValues)
(assertValueOneOf "ConfigureWithoutCarrier" boolValues)
(assertValueOneOf "IgnoreCarrierLoss" boolValues)
(assertValueOneOf "KeepConfiguration" (boolValues ++ ["static" "dhcp-on-stop" "dhcp"]))
];
@ -619,6 +617,7 @@ let
"User"
"SuppressPrefixLength"
"Type"
"SuppressInterfaceGroup"
])
(assertInt "TypeOfService")
(assertRange "TypeOfService" 0 255)
@ -632,6 +631,7 @@ let
(assertInt "SuppressPrefixLength")
(assertRange "SuppressPrefixLength" 0 128)
(assertValueOneOf "Type" ["blackhole" "unreachable" "prohibit"])
(assertRange "SuppressInterfaceGroup" 0 2147483647)
];
sectionRoute = checkUnitConfig "Route" [
@ -711,6 +711,9 @@ let
"BlackList"
"RequestOptions"
"SendOption"
"FallbackLeaseLifetimeSec"
"Label"
"Use6RD"
])
(assertValueOneOf "UseDNS" boolValues)
(assertValueOneOf "RoutesToDNS" boolValues)
@ -733,6 +736,8 @@ let
(assertPort "ListenPort")
(assertValueOneOf "SendRelease" boolValues)
(assertValueOneOf "SendDecline" boolValues)
(assertValueOneOf "FallbackLeaseLifetimeSec" ["forever" "infinity"])
(assertValueOneOf "Use6RD" boolValues)
];
sectionDHCPv6 = checkUnitConfig "DHCPv6" [
@ -745,7 +750,6 @@ let
"MUDURL"
"RequestOptions"
"SendVendorOption"
"ForceDHCPv6PDOtherInformation"
"PrefixDelegationHint"
"WithoutRA"
"SendOption"
@ -754,27 +758,33 @@ let
"DUIDType"
"DUIDRawData"
"IAID"
"UseDelegatedPrefix"
])
(assertValueOneOf "UseAddress" boolValues)
(assertValueOneOf "UseDNS" boolValues)
(assertValueOneOf "UseNTP" boolValues)
(assertInt "RouteMetric")
(assertValueOneOf "RapidCommit" boolValues)
(assertValueOneOf "ForceDHCPv6PDOtherInformation" boolValues)
(assertValueOneOf "WithoutRA" ["solicit" "information-request"])
(assertValueOneOf "WithoutRA" ["no" "solicit" "information-request"])
(assertRange "SendOption" 1 65536)
(assertInt "IAID")
(assertValueOneOf "UseDelegatedPrefix" boolValues)
];
sectionDHCPv6PrefixDelegation = checkUnitConfig "DHCPv6PrefixDelegation" [
sectionDHCPPrefixDelegation = checkUnitConfig "DHCPPrefixDelegation" [
(assertOnlyFields [
"UplinkInterface"
"SubnetId"
"Announce"
"Assign"
"Token"
"ManageTemporaryAddress"
"RouteMetric"
])
(assertValueOneOf "Announce" boolValues)
(assertValueOneOf "Assign" boolValues)
(assertValueOneOf "ManageTemporaryAddress" boolValues)
(assertRange "RouteMetric" 0 4294967295)
];
sectionIPv6AcceptRA = checkUnitConfig "IPv6AcceptRA" [
@ -792,6 +802,10 @@ let
"RouteAllowList"
"DHCPv6Client"
"RouteMetric"
"UseMTU"
"UseGateway"
"UseRoutePrefix"
"Token"
])
(assertValueOneOf "UseDNS" boolValues)
(assertValueOneOf "UseDomains" (boolValues ++ ["route"]))
@ -799,6 +813,9 @@ let
(assertValueOneOf "UseAutonomousPrefix" boolValues)
(assertValueOneOf "UseOnLinkPrefix" boolValues)
(assertValueOneOf "DHCPv6Client" (boolValues ++ ["always"]))
(assertValueOneOf "UseMTU" boolValues)
(assertValueOneOf "UseGateway" boolValues)
(assertValueOneOf "UseRoutePrefix" boolValues)
];
sectionDHCPServer = checkUnitConfig "DHCPServer" [
@ -874,6 +891,7 @@ let
"Prefix"
"PreferredLifetimeSec"
"ValidLifetimeSec"
"Token"
])
(assertValueOneOf "AddressAutoconfiguration" boolValues)
(assertValueOneOf "OnLink" boolValues)
@ -1338,12 +1356,17 @@ let
};
dhcpV6PrefixDelegationConfig = mkOption {
visible = false;
apply = _: throw "The option `systemd.network.networks.<name>.dhcpV6PrefixDelegationConfig` has been renamed to `systemd.network.networks.<name>.dhcpPrefixDelegationConfig`.";
};
dhcpPrefixDelegationConfig = mkOption {
default = {};
example = { SubnetId = "auto"; Announce = true; };
type = types.addCheck (types.attrsOf unitOption) check.network.sectionDHCPv6PrefixDelegation;
type = types.addCheck (types.attrsOf unitOption) check.network.sectionDHCPPrefixDelegation;
description = lib.mdDoc ''
Each attribute in this set specifies an option in the
`[DHCPv6PrefixDelegation]` section of the unit. See
`[DHCPPrefixDelegation]` section of the unit. See
{manpage}`systemd.network(5)` for details.
'';
};
@ -1789,9 +1812,9 @@ let
[DHCPv6]
${attrsToSection def.dhcpV6Config}
''
+ optionalString (def.dhcpV6PrefixDelegationConfig != { }) ''
[DHCPv6PrefixDelegation]
${attrsToSection def.dhcpV6PrefixDelegationConfig}
+ optionalString (def.dhcpPrefixDelegationConfig != { }) ''
[DHCPPrefixDelegation]
${attrsToSection def.dhcpPrefixDelegationConfig}
''
+ optionalString (def.ipv6AcceptRAConfig != { }) ''
[IPv6AcceptRA]

View File

@ -227,7 +227,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
IPv6AcceptRA = false;
# Delegate prefixes from the DHCPv6 PD pool.
DHCPv6PrefixDelegation = true;
DHCPPrefixDelegation = true;
IPv6SendRA = true;
};