]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - man/systemd.network.xml
network/dhcp: disable RapidCommit= by default when AllowList=/DenyList= is specified
[thirdparty/systemd.git] / man / systemd.network.xml
index 33c559cddb5223a073ab3ad6c03a9c735c421b90..63a3eef94286b445f14dd2309d8cb78295031673 100644 (file)
@@ -44,8 +44,8 @@
     <filename>/etc/systemd/network</filename>. All configuration files are collectively sorted and
     processed in alphanumeric order, regardless of the directories in which they live. However, files
     with identical filenames replace each other. It is recommended that each filename is prefixed with
-    a number (e.g. <filename>10-eth0.network</filename>). Otherwise, the default
-    <filename>.network</filename> files or those generated by
+    a number smaller than <literal>70</literal> (e.g. <filename>10-eth0.network</filename>). Otherwise, the
+    default <filename>.network</filename> files or those generated by
     <citerefentry><refentrytitle>systemd-network-generator.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
     may take precedence over user configured files. Files in <filename>/etc/</filename> have the highest
     priority, files in <filename>/run/</filename> take precedence over files with the same name under
     configured. The first (in alphanumeric order) of the network files that matches a given interface
     is applied, all later files are ignored, even if they match as well.</para>
 
+    <para>Note that any network interfaces that have the <varname>ID_NET_MANAGED_BY=</varname> udev property
+    set will never be matched by any .network files – unless the property's value is the string
+    <literal>io.systemd.Network</literal> – even if the [Match] section would otherwise match. This may be
+    used to exclude specific network interfaces from <command>systemd-networkd</command>'s management, while
+    keeping the [Match] section generic. The <varname>ID_NET_MANAGED_BY=</varname> property thus declares
+    intended <emphasis>ownership</emphasis> of the device, and permits ensuring that concurrent network
+    management implementations do not compete for management of specific devices.</para>
+
     <para>A network file is said to match a network interface if all matches specified by the [Match]
     section are satisfied. When a network file does not contain valid settings in [Match] section, then
     the file will match all interfaces and <command>systemd-networkd</command> warns about that. Hint:
@@ -856,9 +864,9 @@ Table=1234</programlisting></para>
       <varlistentry>
         <term><varname>IPv6HopLimit=</varname></term>
         <listitem>
-          <para>Configures IPv6 Hop Limit. For each router that forwards the packet, the hop limit is
-          decremented by 1. When the hop limit field reaches zero, the packet is discarded. When unset,
-          the kernel's default will be used.</para>
+          <para>Configures IPv6 Hop Limit. Takes an integer in the range 1…255. For each router that
+          forwards the packet, the hop limit is decremented by 1. When the hop limit field reaches zero, the
+          packet is discarded. When unset, the kernel's default will be used.</para>
 
           <xi:include href="version-info.xml" xpointer="v228"/>
         </listitem>
@@ -2219,6 +2227,22 @@ NFTSet=prefix:netdev:filter:eth_ipv4_prefix</programlisting>
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>RapidCommit=</varname></term>
+        <listitem>
+          <para>Takes a boolean. The DHCPv4 client can obtain configuration parameters from a DHCPv4 server
+          through a rapid two-message exchange (discover and ack). When the rapid commit option is set by
+          both the DHCPv4 client and the DHCPv4 server, the two-message exchange is used. Otherwise, the
+          four-message exchange (discover, offer, request, and ack) is used. The two-message exchange
+          provides faster client configuration. See
+          <ulink url="https://tools.ietf.org/html/rfc4039">RFC 4039</ulink> for details.
+          Defaults to true when <varname>Anonymize=no</varname> and neither <varname>AllowList=</varname>
+          nor <varname>DenyList=</varname> is specified, and false otherwise.</para>
+
+          <xi:include href="version-info.xml" xpointer="v255"/>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>Anonymize=</varname></term>
         <listitem>
@@ -2233,6 +2257,7 @@ NFTSet=prefix:netdev:filter:eth_ipv4_prefix</programlisting>
 
           <para>When true,
           <varname>ClientIdentifier=mac</varname>,
+          <varname>RapidCommit=no</varname>,
           <varname>SendHostname=no</varname>,
           <varname>Use6RD=no</varname>,
           <varname>UseCaptivePortal=no</varname>,
@@ -2407,7 +2432,9 @@ NFTSet=prefix:netdev:filter:eth_ipv4_prefix</programlisting>
         <term><varname>UseCaptivePortal=</varname></term>
         <listitem>
           <para>When true (the default), the captive portal advertised by the DHCP server will be recorded
-          and made available to client programs and displayed in the networkctl status output per-link.</para>
+          and made available to client programs and displayed in the
+          <citerefentry><refentrytitle>networkctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+          status output per-link.</para>
 
           <xi:include href="version-info.xml" xpointer="v254"/>
         </listitem>
@@ -2544,9 +2571,13 @@ NFTSet=prefix:netdev:filter:eth_ipv4_prefix</programlisting>
       <varlistentry>
         <term><varname>UseGateway=</varname></term>
         <listitem>
-          <para>When true, the gateway will be requested from the DHCP server and added to the routing
-          table with a metric of 1024, and a scope of <option>link</option>. When unset, the value
-          specified with <varname>UseRoutes=</varname> is used.</para>
+          <para>When true, and the DHCP server provides a Router option, the default gateway based on the
+          router address will be configured. Defaults to unset, and the value specified with
+          <varname>UseRoutes=</varname> will be used.</para>
+
+          <para>Note, when the server provides both the Router and Classless Static Routes option, and
+          <varname>UseRoutes=</varname> is enabled, the Router option is always ignored regardless of this
+          setting. See <ulink url="https://datatracker.ietf.org/doc/html/rfc3442">RFC 3442</ulink>.</para>
 
           <xi:include href="version-info.xml" xpointer="v246"/>
         </listitem>
@@ -2573,6 +2604,19 @@ NFTSet=prefix:netdev:filter:eth_ipv4_prefix</programlisting>
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>IPv6OnlyMode=</varname></term>
+        <listitem>
+          <para>When true, the DHCPv4 configuration will be delayed by the timespan provided by the DHCP
+          server and skip to configure dynamic IPv4 network connectivity if IPv6 connectivity is provided
+          within the timespan. See <ulink url="https://tools.ietf.org/html/rfc8925">RFC 8925</ulink>.
+          Defaults to true when <varname>IPv6AcceptRA=</varname> is enabled or DHCPv6 client is enabled
+          (i.e., <varname>DHCP=yes</varname>), and false otherwise.</para>
+
+          <xi:include href="version-info.xml" xpointer="v255"/>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>FallbackLeaseLifetimeSec=</varname></term>
         <listitem>
@@ -2627,6 +2671,9 @@ NFTSet=prefix:netdev:filter:eth_ipv4_prefix</programlisting>
           prefix length after <literal>/</literal>. DHCP offers from servers in the list are rejected.
           Note that if <varname>AllowList=</varname> is configured then <varname>DenyList=</varname> is
           ignored.</para>
+          <para>Note that this filters only DHCP offers, so the filtering may not work when
+          <varname>RapidCommit=</varname> is enabled. See also <varname>RapidCommit=</varname> in the above.
+          </para>
 
           <xi:include href="version-info.xml" xpointer="v246"/>
         </listitem>
@@ -2638,6 +2685,9 @@ NFTSet=prefix:netdev:filter:eth_ipv4_prefix</programlisting>
           <para>A whitespace-separated list of IPv4 addresses. Each address can optionally take a
           prefix length after <literal>/</literal>. DHCP offers from servers in the list are accepted.
           </para>
+          <para>Note that this filters only DHCP offers, so the filtering may not work when
+          <varname>RapidCommit=</varname> is enabled. See also <varname>RapidCommit=</varname> in the above.
+          </para>
 
           <xi:include href="version-info.xml" xpointer="v246"/>
         </listitem>
@@ -2801,6 +2851,30 @@ NFTSet=prefix:netdev:filter:eth_ipv4_prefix</programlisting>
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>SendHostname=</varname></term>
+        <listitem>
+          <para>When true (the default), the machine's hostname (or the value specified with
+          <varname>Hostname=</varname>, described below) will be sent to the DHCPv6 server. Note that the
+          hostname must consist only of 7-bit ASCII lower-case characters and no spaces or dots, and be
+          formatted as a valid DNS domain name. Otherwise, the hostname is not sent even if this option
+          is true.</para>
+
+          <xi:include href="version-info.xml" xpointer="v255"/>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><varname>Hostname=</varname></term>
+        <listitem>
+          <para>Use this value for the hostname which is sent to the DHCPv6 server, instead of machine's
+          hostname. Note that the specified hostname must consist only of 7-bit ASCII lower-case
+          characters and no spaces or dots, and be formatted as a valid DNS domain name.</para>
+
+          <xi:include href="version-info.xml" xpointer="v255"/>
+        </listitem>
+      </varlistentry>
+
       <!-- How to use the DHCP lease -->
 
       <varlistentry>
@@ -2817,7 +2891,9 @@ NFTSet=prefix:netdev:filter:eth_ipv4_prefix</programlisting>
         <term><varname>UseCaptivePortal=</varname></term>
         <listitem>
           <para>When true (the default), the captive portal advertised by the DHCPv6 server will be recorded
-          and made available to client programs and displayed in the networkctl status output per-link.</para>
+          and made available to client programs and displayed in the
+          <citerefentry><refentrytitle>networkctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+          status output per-link.</para>
 
           <xi:include href="version-info.xml" xpointer="v254"/>
         </listitem>
@@ -3233,7 +3309,9 @@ Token=prefixstable:2002:da8:1::</programlisting></para>
         <term><varname>UseCaptivePortal=</varname></term>
         <listitem>
           <para>When true (the default), the captive portal received in the Router Advertisement will be recorded
-          and made available to client programs and displayed in the networkctl status output per-link.</para>
+          and made available to client programs and displayed in the
+          <citerefentry><refentrytitle>networkctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+          status output per-link.</para>
 
           <xi:include href="version-info.xml" xpointer="v254"/>
         </listitem>
@@ -3242,9 +3320,11 @@ Token=prefixstable:2002:da8:1::</programlisting></para>
       <varlistentry>
         <term><varname>UsePREF64=</varname></term>
         <listitem>
-          <para>When true, the IPv6 PREF64 (or NAT64) prefixes received in the Router Advertisement will be recorded
-          and made available to client programs and displayed in the <command>networkctl</command> status output per-link.
-          See <ulink url="https://tools.ietf.org/html/rfc8781">RFC 8781</ulink>. Defaults to false.</para>
+          <para>When true, the IPv6 PREF64 (or NAT64) prefixes received in the Router Advertisement will be
+          recorded and made available to client programs and displayed in the
+          <citerefentry><refentrytitle>networkctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+          status output per-link. See <ulink url="https://tools.ietf.org/html/rfc8781">RFC 8781</ulink>.
+          Defaults to false.</para>
 
           <xi:include href="version-info.xml" xpointer="v255"/>
         </listitem>
@@ -3604,6 +3684,20 @@ ServerAddress=192.168.0.1/24</programlisting>
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>IPv6OnlyPreferredSec=</varname></term>
+
+        <listitem>
+          <para>Takes a timespan. Controls the
+          <ulink url="https://tools.ietf.org/html/rfc8925">RFC 8925</ulink> IPv6-Only Preferred option.
+          Specifies the DHCPv4 option to indicate that a host supports an IPv6-only mode and is willing to
+          forgo obtaining an IPv4 address if the network provides IPv6 connectivity. Defaults to unset, and
+          not send the option. The minimum allowed value is 300 seconds.</para>
+
+          <xi:include href="version-info.xml" xpointer="v255"/>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>SendOption=</varname></term>
         <listitem>
@@ -3682,6 +3776,18 @@ ServerAddress=192.168.0.1/24</programlisting>
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>RapidCommit=</varname></term>
+        <listitem>
+          <para>Takes a boolean. When true, the server supports
+          <ulink url="https://datatracker.ietf.org/doc/html/rfc4039">RFC 4039</ulink>. When a client sends
+          a DHCPDISCOVER message with the Rapid Commit option to the server, then the server will reply with
+          a DHCPACK message to the client, instead of DHCPOFFER. Defaults to true.</para>
+
+          <xi:include href="version-info.xml" xpointer="v255"/>
+        </listitem>
+      </varlistentry>
+
     </variablelist>
   </refsect1>