]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - man/systemd.net-naming-scheme.xml
udev: introduce NAMING_STABLE_VIRTUAL_MACS (retroactively)
[thirdparty/systemd.git] / man / systemd.net-naming-scheme.xml
index f86ad8d63a9e327e0541a1b68da210ff9c6a0ed6..4caac1115629e6926ffb10a1295800a9dcccf194 100644 (file)
   <refsect1>
     <title>Description</title>
 
-    <para>Network interfaces may be renamed to give them predictable names when there's enough information to
-    generate appropriate names and the use of certain types of names is configured. This page describes the
-    first part, i.e. what possible names may be generated. Those names are generated by the
+    <para>Network interfaces names and MAC addresses may be generated based on certain stable interface
+    attributes. This is possible when there is enough information about the device to generate those
+    attributes and the use of this information is configured. This page describes interface naming, i.e. what
+    possible names may be generated. Those names are generated by the
     <citerefentry><refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
     builtin <command>net_id</command> and exported as udev properties
     (<varname>ID_NET_NAME_ONBOARD=</varname>, <varname>ID_NET_LABEL_ONBOARD=</varname>,
     <varname>ID_NET_NAME_PATH=</varname>, <varname>ID_NET_NAME_SLOT=</varname>).</para>
 
-    <para>Names are derived from various device metadata attributes. Newer versions of udev take more of
-    these attributes into account, improving (and thus possibly changing) the names used for the same
-    devices. Differents version of the naming rules are called "naming schemes". The default naming scheme is
-    chosen at compilation time. Usually this will be the latest implemented version, but it is also possible
-    to set one of the older versions to preserve compatibility. This may be useful for example for
-    distributions, which may introduce new versions of systemd in stable releases without changing the naming
-    scheme. The naming scheme may also be overriden using the <varname>net.naming-scheme=</varname> kernel
-    command line switch, see
+    <para>Names and MAC addresses are derived from various stable device metadata attributes. Newer versions
+    of udev take more of these attributes into account, improving (and thus possibly changing) the names and
+    addresses used for the same devices. Different versions of those generation rules are called "naming
+    schemes". The default naming scheme is chosen at compilation time. Usually this will be the latest
+    implemented version, but it is also possible to set one of the older versions to preserve
+    compatibility. This may be useful for example for distributions, which may introduce new versions of
+    systemd in stable releases without changing the naming scheme. The naming scheme may also be overriden
+    using the <varname>net.naming-scheme=</varname> kernel command line switch, see
     <citerefentry><refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
     Available naming schemes are described below.</para>
 
     <para>After the udev proprties have been generated, appropriate udev rules may be used to actually rename
-    devices based on those properties. See the description of <varname>NamePolicy=</varname> in
-    <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
-    </para>
+    devices based on those properties. See the description of <varname>NamePolicy=</varname> and
+    <varname>MACAddressPolicy=</varname> in
+    <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
   </refsect1>
 
   <refsect1>
         <varlistentry>
           <term><constant>v240</constant></term>
 
-          <para>The <literal>ib</literal> prefix and stable names for infiniband devices are
+          <listitem><para>The <literal>ib</literal> prefix and stable names for infiniband devices are
           introduced. Previously those devices were not renamed.</para>
 
           <para>The ACPI index field (used in <varname>ID_NET_NAME_ONBOARD=</varname>) is now also used when
           configuration, even if they have been renamed already, if <constant>keep</constant> is not
           specified as the naming policy in the <filename noindex='true'>.link</filename> file. See
           <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>
-          for a description of <varname>NamePolicy=</varname>.</para>
+          for a description of <varname>NamePolicy=</varname>.</para></listitem>
+        </varlistentry>
+
+        <varlistentry>
+          <term><constant>v241</constant></term>
+
+          <listitem><para><option>MACAddressPolicy=persistent</option> was extended to set MAC addresses
+          based on the device name. Previously addresses were only based on the
+          <varname noindex='true'>ID_NET_NAME_*</varname> attributes, which meant that interface names would
+          never be generated for virtual devices. Now a persistent address will be generated for most
+          devices, including in particular bridges.</para>
+
+          <para>Note: when userspace does not set a MAC address for a bridge device, the kernel will
+          initially assign a random address, and then change it when the first device is enslaved to the
+          bridge. With this naming policy change, bridges get a persistent MAC address based on the bridge
+          name instead of the first enslaved device.</para></listitem>
         </varlistentry>
 
         <varlistentry>
           <term><constant>v243</constant></term>
 
-          <para>Support for netdevsim (simulated networking devices) was added. Previously those devices were
-          not renamed.</para>
-        </varlistentry>
+          <listitem><para>Support for renaming netdevsim (simulated networking) devices was added. Previously
+          those devices were not renamed.</para>
 
-        <para>Note that <constant>latest</constant> may be used to denote the latest scheme known (to this
-        particular version of systemd.</para>
+          <para>Previously two-letter interface type prefix was prepended to
+          <varname>ID_NET_LABEL_ONBOARD=</varname>. This is not done anymore.</para></listitem>
+        </varlistentry>
     </variablelist>
+
+    <para>Note that <constant>latest</constant> may be used to denote the latest scheme known (to this
+    particular version of systemd.</para>
   </refsect1>
 
   <refsect1>
@@ -336,9 +355,8 @@ ID_NET_NAME_PATH=enp0s31f6
       <title>PCI Ethernet card with firmware index "1"</title>
 
       <programlisting>ID_NET_NAME_ONBOARD=eno1
-ID_NET_NAME_ONBOARD_LABEL=enEthernet Port 1
+ID_NET_NAME_ONBOARD_LABEL=Ethernet Port 1
       </programlisting>
-      <!-- FIXME: nuke the prefix! -->
     </example>
 
     <example>