]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - man/systemd.net-naming-scheme.xml
man: fix link markup
[thirdparty/systemd.git] / man / systemd.net-naming-scheme.xml
index eb8faad254eb99d903264de2e8823aad3cbdac00..324c94dbd9fe3a95380916f4bdbc2d72dfb6694c 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 overridden
+    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>
+    <para>After the udev properties have been generated, appropriate udev rules may be used to actually rename
+    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>
+
+    <para>Note that while the concept of network interface naming schemes is primarily relevant in the
+    context of <filename>systemd-udevd.service</filename>, the
+    <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+    container manager also takes it into account when naming network interfaces, see below.</para>
   </refsect1>
 
   <refsect1>
@@ -73,7 +79,7 @@
           </row>
           <row>
             <entry><constant>sl</constant></entry>
-            <entry>serial line IP (slip)</entry>
+            <entry>Serial line IP (slip)</entry>
           </row>
           <row>
             <entry><constant>wl</constant></entry>
@@ -93,8 +99,8 @@
         <varlistentry>
           <term><varname>ID_NET_NAME_ONBOARD=<replaceable>prefix</replaceable><constant>o</constant><replaceable>number</replaceable></varname></term>
 
-          <listitem><para>This name is set based on the ordering information given by the firmware for
-          on-board devices. The name consists of the prefix, letter <constant>o</constant>, and a number
+          <listitem><para>This name is set based on the numeric ordering information given by the firmware
+          for on-board devices. The name consists of the prefix, letter <constant>o</constant>, and a number
           specified by the firmware. This is only available for PCI devices.</para>
           </listitem>
         </varlistentry>
         <varlistentry>
           <term><varname>ID_NET_LABEL_ONBOARD=<replaceable>prefix</replaceable> <replaceable>label</replaceable></varname></term>
 
-          <listitem><para>This property is set based on label given by the firmware for on-board devices. The
-          name consists of the prefix concatenated with the label. This is only available for PCI devices.
+          <listitem><para>This property is set based on textual label given by the firmware for on-board
+          devices. The name consists of the prefix concatenated with the label. This is only available for
+          PCI devices.
           </para>
           </listitem>
         </varlistentry>
 
         <varlistentry>
           <term><varname>ID_NET_NAME_SLOT=<replaceable>prefix</replaceable>[<constant>P</constant><replaceable>domain</replaceable>]<constant>s</constant><replaceable>slot</replaceable>[<constant>f</constant><replaceable>function</replaceable>][<constant>n</constant><replaceable>port_name</replaceable>|<constant>d</constant><replaceable>dev_port</replaceable>]</varname></term>
+          <term><varname>ID_NET_NAME_SLOT=<replaceable>prefix</replaceable><constant>v</constant><replaceable>slot</replaceable></varname></term>
           <term><varname>ID_NET_NAME_SLOT=<replaceable>prefix</replaceable>[<constant>P</constant><replaceable>domain</replaceable>]<constant>s</constant><replaceable>slot</replaceable>[<constant>f</constant><replaceable>function</replaceable>][<constant>n</constant><replaceable>port_name</replaceable>|<constant>d</constant><replaceable>dev_port</replaceable>]<constant>b</constant><replaceable>number</replaceable></varname></term>
           <term><varname>ID_NET_NAME_SLOT=<replaceable>prefix</replaceable>[<constant>P</constant><replaceable>domain</replaceable>]<constant>s</constant><replaceable>slot</replaceable>[<constant>f</constant><replaceable>function</replaceable>][<constant>n</constant><replaceable>port_name</replaceable>|<constant>d</constant><replaceable>dev_port</replaceable>]<constant>u</constant><replaceable>port</replaceable>…[<constant>c</constant><replaceable>config</replaceable>][<constant>i</constant><replaceable>interface</replaceable>]</varname></term>
           <term><varname>ID_NET_NAME_SLOT=<replaceable>prefix</replaceable>[<constant>P</constant><replaceable>domain</replaceable>]<constant>s</constant><replaceable>slot</replaceable>[<constant>f</constant><replaceable>function</replaceable>][<constant>n</constant><replaceable>port_name</replaceable>|<constant>d</constant><replaceable>dev_port</replaceable>]<constant>v</constant><replaceable>slot</replaceable></varname></term>
 
           <listitem><para>This property describes the slot position. Different schemes are used depending on
-          the bus type, as described in the table below. In all cases, PCI slot information must be known. In
-          case of USB, BCMA, and SR-VIO devices, the full name consists of the prefix, PCI slot identifier,
-          and USB or BCMA or SR-VIO slot identifier. The first two parts are denoted as "…" in the table
-          below.</para>
+          the bus type, as described in the table below. In case of USB, BCMA, and SR-VIO devices, the full
+          name consists of the prefix, PCI slot identifier, and USB or BCMA or SR-VIO slot identifier. The
+          first two parts are denoted as "…" in the table below.</para>
 
           <table>
             <title>Slot naming schemes</title>
                   <entry>PCI slot number</entry>
                 </row>
 
+                <row>
+                  <entry><replaceable>prefix</replaceable> <constant>v</constant><replaceable>slot</replaceable></entry>
+                  <entry>VIO slot number (IBM PowerVM)</entry>
+                </row>
+
                 <row>
                   <entry>… <constant>b</constant><replaceable>number</replaceable></entry>
                   <entry>Broadcom bus (BCMA) core number</entry>
           <para>For USB devices the full chain of port numbers of hubs is composed. If the name gets longer
           than the maximum number of 15 characters, the name is not exported. The usual USB configuration
           number 1 and interface number 0 values are suppressed.</para>
-          </listitem>
 
           <para>SR-IOV virtual devices are named based on the name of the parent interface, with a suffix of
           <constant>v</constant> and the virtual device number, with any leading zeros removed. The bus
-          number is ignored. This device type is found in IBM PowerVMs.</para>
+          number is ignored.</para>
+          </listitem>
         </varlistentry>
 
         <varlistentry>
         <varlistentry>
           <term><constant>v238</constant></term>
 
-          <listitem><para>This is the naming naming that was implemented in systemd 238.</para></listitem>
+          <listitem><para>This is the naming scheme that was implemented in systemd 238.</para></listitem>
         </varlistentry>
 
         <varlistentry>
         <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
           again. Previously, this naming policy applied implicitly, and now it must be explicitly
           requested. Effectively, this means that network devices will be renamed according to the
           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
+          specified as the naming policy in the <filename index="false">.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 index="false">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>
+          <listitem><para>Support for renaming netdevsim (simulated networking) devices was added. Previously
+          those devices were not renamed.</para>
 
           <para>Previously two-letter interface type prefix was prepended to
-          <varname>ID_NET_LABEL_ONBOARD=</varname>. This is not done anymore.</para>
+          <varname>ID_NET_LABEL_ONBOARD=</varname>. This is not done anymore.</para></listitem>
         </varlistentry>
 
-        <para>Note that <constant>latest</constant> may be used to denote the latest scheme known (to this
-        particular version of systemd.</para>
-    </variablelist>
+        <varlistentry>
+          <term><constant>v245</constant></term>
+
+          <listitem><para>When
+          <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+          derives the name for the host side of the network interface created with
+          <option>--network-veth</option> from the container name it previously simply truncated the result
+          at 15 characters if longer (since that's the maximum length for network interface names). From now
+          on, for any interface name that would be longer than 15 characters the last 4 characters are set to
+          a 24bit hash value of the full interface name. This way network interface name collisions between
+          multiple similarly named containers (who only differ in container name suffix) should be less
+          likely (but still possible, since the 24bit hash value is very small).</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>
@@ -412,8 +453,8 @@ ID_NET_NAME_PATH=encf5f0</programlisting>
     <para>
       <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
       <citerefentry><refentrytitle>udevadm</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-      <ulink url="https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames">the
-      original page describing stable interface names</ulink>
+      <ulink url="https://systemd.io/PREDICTABLE_INTERFACE_NAMES">Predictable Network Interface Names</ulink>,
+      <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>
     </para>
   </refsect1>