summaryrefslogtreecommitdiffstats
path: root/man/systemd.net-naming-scheme.xml
blob: e0050e76a5f64e097c209db3cc8d443eea0073ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
<?xml version='1.0'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->

<refentry id="systemd.net-naming-scheme">
  <refentryinfo>
    <title>systemd.net-naming-scheme</title>
    <productname>systemd</productname>
  </refentryinfo>

  <refmeta>
    <refentrytitle>systemd.net-naming-scheme</refentrytitle>
    <manvolnum>7</manvolnum>
  </refmeta>

  <refnamediv>
    <refname>systemd.net-naming-scheme</refname>
    <refpurpose>Network device naming schemes</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Description</title>

    <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 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 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>
    <title>Policies</title>

    <para>All names start with a two-character prefix that signifies the interface type.</para>

    <table>
      <title>Two character prefixes based on the type of interface</title>

      <tgroup cols='2'>
        <thead>
          <row>
            <entry>Prefix</entry>
            <entry>Description</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry><constant>en</constant></entry>
            <entry>Ethernet</entry>
          </row>
          <row>
            <entry><constant>ib</constant></entry>
            <entry>InfiniBand</entry>
          </row>
          <row>
            <entry><constant>sl</constant></entry>
            <entry>Serial line IP (slip)</entry>
          </row>
          <row>
            <entry><constant>wl</constant></entry>
            <entry>Wireless local area network (WLAN)</entry>
          </row>
          <row>
            <entry><constant>ww</constant></entry>
            <entry>Wireless wide area network (WWAN)</entry>
          </row>
        </tbody>
      </tgroup>
    </table>

    <para>The udev <command>net_id</command> builtin exports the following udev device properties:</para>

    <variablelist>
        <varlistentry>
          <term><varname>ID_NET_NAME_ONBOARD=<replaceable>prefix</replaceable><constant>o</constant><replaceable>number</replaceable></varname></term>
          <term><varname>ID_NET_NAME_ONBOARD=<replaceable>prefix</replaceable><constant>d</constant><replaceable>number</replaceable></varname></term>

          <listitem><para>This name is set based on the numeric ordering information given by the firmware
          for on-board devices. Different schemes are used depending on the firmware type, as described in the table below.</para>

            <table>
              <title>Onboard naming schemes</title>

              <tgroup cols='2'>
                <thead>
                  <row>
                    <entry>Format</entry>
                    <entry>Description</entry>
                  </row>
                </thead>

                <tbody>
                  <row>
                    <entry><replaceable>prefix</replaceable><constant>o</constant><replaceable>number</replaceable></entry>
                    <entry>PCI onboard index</entry>
                  </row>

                  <row>
                    <entry><replaceable>prefix</replaceable><constant>d</constant><replaceable>number</replaceable></entry>
                    <entry>Devicetree alias index</entry>
                  </row>

                </tbody>
              </tgroup>
            </table>
          </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 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_MAC=<replaceable>prefix</replaceable><constant>x</constant><replaceable>AABBCCDDEEFF</replaceable></varname></term>

          <listitem><para>This name consists of the prefix, letter <constant>x</constant>, and 12 hexadecimal
          digits of the MAC address. It is available if the device has a fixed MAC address. Because this name
          is based on an attribute of the card itself, it remains "stable" when the device is moved (even
          between machines), but will change when the hardware is replaced.</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>x</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 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>

            <tgroup cols='2'>
              <thead>
                <row>
                  <entry>Format</entry>
                  <entry>Description</entry>
                </row>
              </thead>

              <tbody>
                <row>
                  <entry><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>]</entry>
                  <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><replaceable>prefix</replaceable> <constant>X</constant><replaceable>number</replaceable></entry>
                  <entry>VIF interface number (Xen)</entry>
                </row>

                <row>
                  <entry> <constant>b</constant><replaceable>number</replaceable></entry>
                  <entry>Broadcom bus (BCMA) core number</entry>
                </row>

                <row>
                  <entry> <constant>u</constant><replaceable>port</replaceable> [<constant>c</constant><replaceable>config</replaceable>] [<constant>i</constant><replaceable>interface</replaceable>]</entry>
                  <entry>USB port number chain</entry>
                </row>

                <row>
                  <entry> <constant>v</constant><replaceable>slot</replaceable></entry>
                  <entry>SR-VIO slot number</entry>
                </row>
              </tbody>
            </tgroup>
          </table>

          <para>The PCI domain is only prepended when it is not 0. All multi-function PCI devices will carry
          the <constant>f<replaceable>function</replaceable></constant> number in the device name, including
          the function 0 device. For non-multi-function devices, the number is suppressed if 0. The port name
          <replaceable>port_name</replaceable> is used, or the port number
          <constant>d</constant><replaceable>dev_port</replaceable> if the name is not known.</para>

          <para>For BCMA devices, the core number is suppressed when 0.</para>

          <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>

          <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.</para>

          <para>In some configurations a parent PCI bridge of a given network controller may be associated
          with a slot. In such case we don't generate this device property to avoid possible naming conflicts.</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term><varname>ID_NET_NAME_PATH=<replaceable>prefix</replaceable><constant>c</constant><replaceable>bus_id</replaceable></varname></term>
          <term><varname>ID_NET_NAME_PATH=<replaceable>prefix</replaceable><constant>a</constant><replaceable>vendor</replaceable><replaceable>model</replaceable><constant>i</constant><replaceable>instance</replaceable></varname></term>
          <term><varname>ID_NET_NAME_PATH=<replaceable>prefix</replaceable><constant>i</constant><replaceable>address</replaceable><constant>n</constant><replaceable>port_name</replaceable></varname></term>
          <term><varname>ID_NET_NAME_PATH=<replaceable>prefix</replaceable>[<constant>P</constant><replaceable>domain</replaceable>]<constant>p</constant><replaceable>bus</replaceable><constant>s</constant><replaceable>slot</replaceable>[<constant>f</constant><replaceable>function</replaceable>][<constant>n</constant><replaceable>phys_port_name</replaceable>|<constant>d</constant><replaceable>dev_port</replaceable>]</varname></term>
          <term><varname>ID_NET_NAME_PATH=<replaceable>prefix</replaceable>[<constant>P</constant><replaceable>domain</replaceable>]<constant>p</constant><replaceable>bus</replaceable><constant>s</constant><replaceable>slot</replaceable>[<constant>f</constant><replaceable>function</replaceable>][<constant>n</constant><replaceable>phys_port_name</replaceable>|<constant>d</constant><replaceable>dev_port</replaceable>]<constant>b</constant><replaceable>number</replaceable></varname></term>
          <term><varname>ID_NET_NAME_PATH=<replaceable>prefix</replaceable>[<constant>P</constant><replaceable>domain</replaceable>]<constant>p</constant><replaceable>bus</replaceable><constant>s</constant><replaceable>slot</replaceable>[<constant>f</constant><replaceable>function</replaceable>][<constant>n</constant><replaceable>phys_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>

          <listitem><para>This property describes the device installation location. Different schemes are
          used depending on the bus type, as described in the table below. For BCMA and USB devices, PCI path
          information must known, and the full name consists of the prefix, PCI slot identifier, and USB or
          BCMA location. The first two parts are denoted as "…" in the table below.</para>

          <table>
            <title>Path naming schemes</title>

            <tgroup cols='2'>
              <thead>
                <row>
                  <entry>Format</entry>
                  <entry>Description</entry>
                </row>
              </thead>

              <tbody>
                <row>
                  <entry><replaceable>prefix</replaceable> <constant>c</constant><replaceable>bus_id</replaceable></entry>
                  <entry>CCW or grouped CCW device identifier</entry>
                </row>

                <row>
                  <entry><replaceable>prefix</replaceable> <constant>a</constant><replaceable>vendor</replaceable> <replaceable>model</replaceable> <constant>i</constant><replaceable>instance</replaceable></entry>
                  <entry>ACPI path names for ARM64 platform devices</entry>
                </row>

                <row>
                  <entry><replaceable>prefix</replaceable> <constant>i</constant><replaceable>address</replaceable> <constant>n</constant><replaceable>port_name</replaceable></entry>
                  <entry>Netdevsim (simulated networking device) device number and port name</entry>
                </row>

                <row>
                  <entry><replaceable>prefix</replaceable> [<constant>P</constant><replaceable>domain</replaceable>] <constant>p</constant><replaceable>bus</replaceable> <constant>s</constant><replaceable>slot</replaceable> [<constant>f</constant><replaceable>function</replaceable>] [<constant>n</constant><replaceable>phys_port_name</replaceable> | <constant>d</constant><replaceable>dev_port</replaceable>]</entry>
                  <entry>PCI geographical location</entry>
                </row>

                <row>
                  <entry> <constant>b</constant><replaceable>number</replaceable></entry>
                  <entry>Broadcom bus (BCMA) core number</entry>
                </row>

                <row>
                  <entry> <constant>u</constant><replaceable>port</replaceable> [<constant>c</constant><replaceable>config</replaceable>] [<constant>i</constant><replaceable>interface</replaceable>]</entry>
                  <entry>USB port number chain</entry>
                </row>

              </tbody>
            </tgroup>
          </table>

          <para>CCW and grouped CCW devices are found in IBM System Z mainframes. Any leading zeros and
          dots are suppressed.</para>

          <para>For PCI, BCMA, and USB devices, the same rules as described above for slot naming are
          used.</para>
          </listitem>
        </varlistentry>
    </variablelist>
  </refsect1>

  <refsect1>
    <title>History</title>

    <para>The following "naming schemes" have been defined (which may be chosen at system boot-up time via
    the <varname>net.naming-scheme=</varname> kernel command line switch, see above):</para>

    <variablelist>
        <varlistentry>
          <term><constant>v238</constant></term>

          <listitem><para>This is the naming scheme that was implemented in systemd 238.</para></listitem>
        </varlistentry>

        <varlistentry>
          <term><constant>v239</constant></term>

          <listitem><para>Naming was changed for virtual network interfaces created with SR-IOV and NPAR and
          for devices where the PCI network controller device does not have a slot number associated.</para>

          <para>SR-IOV virtual devices are named based on the name of the parent interface, with a suffix of
          <literal>v<replaceable>port</replaceable></literal>, where <replaceable>port</replaceable> is the
          virtual device number. Previously those virtual devices were named as if completely independent.
          </para>

          <para>The ninth and later NPAR virtual devices are named following the scheme used for the first
          eight NPAR partitions. Previously those devices were not renamed and the kernel default
          ("eth<replaceable>N</replaceable>") was used.</para>

          <para>Names are also generated for PCI devices where the PCI network controller device does not
          have an associated slot number itself, but one of its parents does. Previously those devices were
          not renamed and the kernel default was used.</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term><constant>v240</constant></term>

          <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
          0.</para>

          <para>A new naming policy <varname>NamePolicy=keep</varname> was introduced. With this policy, if
          the network device name was already set by userspace, the device will not be renamed
          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 index="false">.link</filename> file. See
          <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>
          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>

          <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></listitem>
        </varlistentry>

        <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>

        <varlistentry>
          <term><constant>v247</constant></term>

          <listitem><para>When a PCI slot is associated with a PCI bridge that has multiple child network
          controllers, the same value of the <varname>ID_NET_NAME_SLOT</varname> property might be derived
          for those controllers. This would cause a naming conflict if the property is selected as the device
          name. Now, we detect this situation and don't produce the <varname>ID_NET_NAME_SLOT</varname>
          property.</para></listitem>
        </varlistentry>

        <varlistentry>
          <term><constant>v249</constant></term>

          <listitem><para>PCI hotplug slot names for the s390 PCI driver are a hexadecimal representation
          of the <filename>function_id</filename> device attribute. This attribute is now used to build the
          <varname>ID_NET_NAME_SLOT</varname>. Before that, all slot names were parsed as decimal
          numbers, which could either result in an incorrect value of the <varname>ID_NET_NAME_SLOT</varname>
          property or none at all.</para>

          <para>Some firmware and hypervisor implementations report unreasonably high numbers for the onboard
          index. To prevent the generation of bogus onbard interface names, index numbers greater than 16381
          (2¹⁴-1) were ignored. For s390 PCI devices index values up to 65535 (2¹⁶-1) are valid. To account
          for that, the limit was increased to 65535.</para>

          <para>The udev rule <varname>NAME=</varname> replaces <literal>:</literal>,
          <literal>/</literal>, and <literal>%</literal> with an underscore (<literal>_</literal>), and
          refuses strings which contain only numerics.</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term><constant>v250</constant></term>

          <listitem><para>Added naming scheme for Xen netfront "vif" interfaces based on the guest side
          VIF number set from the Xen config (or the interface index in AWS EC2).</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term><constant>v251</constant></term>

          <listitem><para>Since version <constant>v247</constant> we no longer set
          <varname>ID_NET_NAME_SLOT</varname> if we detect that a PCI device associated with a slot is a PCI
          bridge as that would create naming conflict when there are more child devices on that bridge. Now,
          this is relaxed and we will use slot information to generate the name based on it but only if
          the PCI device has multiple functions. This is safe because distinct function number is a part of
          the device name for multifunction devices.</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term><constant>v252</constant></term>

          <listitem><para>Added naming scheme for platform devices with devicetree aliases.</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>
    <title>Examples</title>

    <example>
      <title>Using <command>udevadm test-builtin</command> to display device properties</title>

      <programlisting>$ udevadm test-builtin net_id /sys/class/net/enp0s31f6
...
Using default interface naming scheme 'v243'.
ID_NET_NAMING_SCHEME=v243
ID_NET_NAME_MAC=enx54ee75cb1dc0
ID_OUI_FROM_DATABASE=Wistron InfoComm(Kunshan)Co.,Ltd.
ID_NET_NAME_PATH=enp0s31f6
...</programlisting>
    </example>

    <example>
      <title>PCI Ethernet card with firmware index "1"</title>

      <programlisting>ID_NET_NAME_ONBOARD=eno1
ID_NET_NAME_ONBOARD_LABEL=Ethernet Port 1
      </programlisting>
    </example>

    <example>
      <title>PCI Ethernet card in hotplug slot with firmware index number</title>

      <programlisting># /sys/devices/pci0000:00/0000:00:1c.3/0000:05:00.0/net/ens1
ID_NET_NAME_MAC=enx000000000466
ID_NET_NAME_PATH=enp5s0
ID_NET_NAME_SLOT=ens1</programlisting>
    </example>

    <example>
      <title>PCI Ethernet multi-function card with 2 ports</title>

      <programlisting># /sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0/net/enp2s0f0
ID_NET_NAME_MAC=enx78e7d1ea46da
ID_NET_NAME_PATH=enp2s0f0

# /sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.1/net/enp2s0f1
ID_NET_NAME_MAC=enx78e7d1ea46dc
ID_NET_NAME_PATH=enp2s0f1</programlisting>
    </example>

    <example>
      <title>PCI WLAN card</title>

      <programlisting># /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/net/wlp3s0
ID_NET_NAME_MAC=wlx0024d7e31130
ID_NET_NAME_PATH=wlp3s0</programlisting>
    </example>

    <example>
      <title>PCI IB host adapter with 2 ports</title>

      <programlisting># /sys/devices/pci0000:00/0000:00:03.0/0000:15:00.0/net/ibp21s0f0
ID_NET_NAME_PATH=ibp21s0f0

# /sys/devices/pci0000:00/0000:00:03.0/0000:15:00.1/net/ibp21s0f1
ID_NET_NAME_PATH=ibp21s0f1</programlisting>
    </example>

    <example>
      <title>USB built-in 3G modem</title>

      <programlisting># /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.6/net/wwp0s29u1u4i6
ID_NET_NAME_MAC=wwx028037ec0200
ID_NET_NAME_PATH=wwp0s29u1u4i6</programlisting>
    </example>

    <example>
      <title>USB Android phone</title>

      <programlisting># /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/net/enp0s29u1u2
ID_NET_NAME_MAC=enxd626b3450fb5
ID_NET_NAME_PATH=enp0s29u1u2</programlisting>
    </example>

    <example>
      <title>s390 grouped CCW interface</title>

      <programlisting># /sys/devices/css0/0.0.0007/0.0.f5f0/group_device/net/encf5f0
ID_NET_NAME_MAC=enx026d3c00000a
ID_NET_NAME_PATH=encf5f0</programlisting>
    </example>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
      <citerefentry><refentrytitle>udevadm</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
      <ulink url="https://systemd.io/PREDICTABLE_INTERFACE_NAMES">Predictable Network Interface Names</ulink>,
      <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>
    </para>
  </refsect1>

</refentry>