]>
Commit | Line | Data |
---|---|---|
0b1e5b6e ZJS |
1 | <?xml version='1.0'?> |
2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" | |
3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> | |
db9ecf05 | 4 | <!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
0b1e5b6e ZJS |
5 | |
6 | <refentry id="systemd.net-naming-scheme"> | |
7 | <refentryinfo> | |
8 | <title>systemd.net-naming-scheme</title> | |
9 | <productname>systemd</productname> | |
10 | </refentryinfo> | |
11 | ||
12 | <refmeta> | |
13 | <refentrytitle>systemd.net-naming-scheme</refentrytitle> | |
14 | <manvolnum>7</manvolnum> | |
15 | </refmeta> | |
16 | ||
17 | <refnamediv> | |
18 | <refname>systemd.net-naming-scheme</refname> | |
19 | <refpurpose>Network device naming schemes</refpurpose> | |
20 | </refnamediv> | |
21 | ||
22 | <refsect1> | |
23 | <title>Description</title> | |
24 | ||
2ebe027b ZJS |
25 | <para>Network interfaces names and MAC addresses may be generated based on certain stable interface |
26 | attributes. This is possible when there is enough information about the device to generate those | |
27 | attributes and the use of this information is configured. This page describes interface naming, i.e. what | |
28 | possible names may be generated. Those names are generated by the | |
0b1e5b6e ZJS |
29 | <citerefentry><refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
30 | builtin <command>net_id</command> and exported as udev properties | |
31 | (<varname>ID_NET_NAME_ONBOARD=</varname>, <varname>ID_NET_LABEL_ONBOARD=</varname>, | |
32 | <varname>ID_NET_NAME_PATH=</varname>, <varname>ID_NET_NAME_SLOT=</varname>).</para> | |
33 | ||
2ebe027b ZJS |
34 | <para>Names and MAC addresses are derived from various stable device metadata attributes. Newer versions |
35 | of udev take more of these attributes into account, improving (and thus possibly changing) the names and | |
36 | addresses used for the same devices. Different versions of those generation rules are called "naming | |
37 | schemes". The default naming scheme is chosen at compilation time. Usually this will be the latest | |
38 | implemented version, but it is also possible to set one of the older versions to preserve | |
39 | compatibility. This may be useful for example for distributions, which may introduce new versions of | |
d238709c | 40 | systemd in stable releases without changing the naming scheme. The naming scheme may also be overridden |
2ebe027b | 41 | using the <varname>net.naming-scheme=</varname> kernel command line switch, see |
0b1e5b6e ZJS |
42 | <citerefentry><refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. |
43 | Available naming schemes are described below.</para> | |
44 | ||
ce6304f7 | 45 | <para>After the udev properties have been generated, appropriate udev rules may be used to actually rename |
2ebe027b ZJS |
46 | devices based on those properties. See the description of <varname>NamePolicy=</varname> and |
47 | <varname>MACAddressPolicy=</varname> in | |
48 | <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para> | |
bc5ea049 KK |
49 | |
50 | <para>Note that while the concept of network interface naming schemes is primarily relevant in the | |
51 | context of <filename>systemd-udevd.service</filename>, the | |
52 | <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
53 | container manager also takes it into account when naming network interfaces, see below.</para> | |
0b1e5b6e ZJS |
54 | </refsect1> |
55 | ||
56 | <refsect1> | |
57 | <title>Naming</title> | |
58 | ||
59 | <para>All names start with a two-character prefix that signifies the interface type.</para> | |
60 | ||
61 | <table> | |
62 | <title>Two character prefixes based on the type of interface</title> | |
63 | ||
64 | <tgroup cols='2'> | |
65 | <thead> | |
66 | <row> | |
67 | <entry>Prefix</entry> | |
68 | <entry>Description</entry> | |
69 | </row> | |
70 | </thead> | |
71 | <tbody> | |
72 | <row> | |
73 | <entry><constant>en</constant></entry> | |
74 | <entry>Ethernet</entry> | |
75 | </row> | |
76 | <row> | |
77 | <entry><constant>ib</constant></entry> | |
78 | <entry>InfiniBand</entry> | |
79 | </row> | |
80 | <row> | |
81 | <entry><constant>sl</constant></entry> | |
ab015b13 | 82 | <entry>Serial line IP (slip)</entry> |
0b1e5b6e ZJS |
83 | </row> |
84 | <row> | |
85 | <entry><constant>wl</constant></entry> | |
86 | <entry>Wireless local area network (WLAN)</entry> | |
87 | </row> | |
88 | <row> | |
89 | <entry><constant>ww</constant></entry> | |
90 | <entry>Wireless wide area network (WWAN)</entry> | |
91 | </row> | |
92 | </tbody> | |
93 | </tgroup> | |
94 | </table> | |
95 | ||
96 | <para>The udev <command>net_id</command> builtin exports the following udev device properties:</para> | |
97 | ||
98 | <variablelist> | |
99 | <varlistentry> | |
100 | <term><varname>ID_NET_NAME_ONBOARD=<replaceable>prefix</replaceable><constant>o</constant><replaceable>number</replaceable></varname></term> | |
101 | ||
e232c307 LP |
102 | <listitem><para>This name is set based on the numeric ordering information given by the firmware |
103 | for on-board devices. The name consists of the prefix, letter <constant>o</constant>, and a number | |
0b1e5b6e ZJS |
104 | specified by the firmware. This is only available for PCI devices.</para> |
105 | </listitem> | |
106 | </varlistentry> | |
107 | ||
108 | <varlistentry> | |
109 | <term><varname>ID_NET_LABEL_ONBOARD=<replaceable>prefix</replaceable> <replaceable>label</replaceable></varname></term> | |
110 | ||
e232c307 LP |
111 | <listitem><para>This property is set based on textual label given by the firmware for on-board |
112 | devices. The name consists of the prefix concatenated with the label. This is only available for | |
113 | PCI devices. | |
0b1e5b6e ZJS |
114 | </para> |
115 | </listitem> | |
116 | </varlistentry> | |
117 | ||
118 | <varlistentry> | |
119 | <term><varname>ID_NET_NAME_MAC=<replaceable>prefix</replaceable><constant>x</constant><replaceable>AABBCCDDEEFF</replaceable></varname></term> | |
120 | ||
121 | <listitem><para>This name consists of the prefix, letter <constant>x</constant>, and 12 hexadecimal | |
122 | digits of the MAC address. It is available if the device has a fixed MAC address. Because this name | |
123 | is based on an attribute of the card itself, it remains "stable" when the device is moved (even | |
124 | between machines), but will change when the hardware is replaced.</para> | |
125 | </listitem> | |
126 | </varlistentry> | |
127 | ||
128 | <varlistentry> | |
129 | <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> | |
a1686563 | 130 | <term><varname>ID_NET_NAME_SLOT=<replaceable>prefix</replaceable><constant>v</constant><replaceable>slot</replaceable></varname></term> |
0b1e5b6e ZJS |
131 | <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> |
132 | <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> | |
133 | <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> | |
134 | ||
135 | <listitem><para>This property describes the slot position. Different schemes are used depending on | |
a1686563 LP |
136 | the bus type, as described in the table below. In case of USB, BCMA, and SR-VIO devices, the full |
137 | name consists of the prefix, PCI slot identifier, and USB or BCMA or SR-VIO slot identifier. The | |
138 | first two parts are denoted as "…" in the table below.</para> | |
0b1e5b6e ZJS |
139 | |
140 | <table> | |
141 | <title>Slot naming schemes</title> | |
142 | ||
143 | <tgroup cols='2'> | |
144 | <thead> | |
145 | <row> | |
146 | <entry>Format</entry> | |
147 | <entry>Description</entry> | |
148 | </row> | |
149 | </thead> | |
150 | ||
151 | <tbody> | |
152 | <row> | |
153 | <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> | |
154 | <entry>PCI slot number</entry> | |
155 | </row> | |
156 | ||
a1686563 LP |
157 | <row> |
158 | <entry><replaceable>prefix</replaceable> <constant>v</constant><replaceable>slot</replaceable></entry> | |
159 | <entry>VIO slot number (IBM PowerVM)</entry> | |
160 | </row> | |
161 | ||
0b1e5b6e ZJS |
162 | <row> |
163 | <entry>… <constant>b</constant><replaceable>number</replaceable></entry> | |
164 | <entry>Broadcom bus (BCMA) core number</entry> | |
165 | </row> | |
166 | ||
167 | <row> | |
168 | <entry>… <constant>u</constant><replaceable>port</replaceable>… [<constant>c</constant><replaceable>config</replaceable>] [<constant>i</constant><replaceable>interface</replaceable>]</entry> | |
169 | <entry>USB port number chain</entry> | |
170 | </row> | |
171 | ||
172 | <row> | |
173 | <entry>… <constant>v</constant><replaceable>slot</replaceable></entry> | |
174 | <entry>SR-VIO slot number</entry> | |
175 | </row> | |
176 | </tbody> | |
177 | </tgroup> | |
178 | </table> | |
179 | ||
180 | <para>The PCI domain is only prepended when it is not 0. All multi-function PCI devices will carry | |
181 | the <constant>f<replaceable>function</replaceable></constant> number in the device name, including | |
182 | the function 0 device. For non-multi-function devices, the number is suppressed if 0. The port name | |
183 | <replaceable>port_name</replaceable> is used, or the port number | |
184 | <constant>d</constant><replaceable>dev_port</replaceable> if the name is not known.</para> | |
185 | ||
186 | <para>For BCMA devices, the core number is suppressed when 0.</para> | |
187 | ||
188 | <para>For USB devices the full chain of port numbers of hubs is composed. If the name gets longer | |
189 | than the maximum number of 15 characters, the name is not exported. The usual USB configuration | |
190 | number 1 and interface number 0 values are suppressed.</para> | |
0b1e5b6e ZJS |
191 | |
192 | <para>SR-IOV virtual devices are named based on the name of the parent interface, with a suffix of | |
193 | <constant>v</constant> and the virtual device number, with any leading zeros removed. The bus | |
a1686563 | 194 | number is ignored.</para> |
2c8ec009 MS |
195 | |
196 | <para>In some configurations a parent PCI bridge of a given network controller may be associated | |
197 | with a slot. In such case we don't generate this device property to avoid possible naming conflicts.</para> | |
a1686563 | 198 | </listitem> |
0b1e5b6e ZJS |
199 | </varlistentry> |
200 | ||
201 | <varlistentry> | |
202 | <term><varname>ID_NET_NAME_PATH=<replaceable>prefix</replaceable><constant>c</constant><replaceable>bus_id</replaceable></varname></term> | |
203 | <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> | |
204 | <term><varname>ID_NET_NAME_PATH=<replaceable>prefix</replaceable><constant>i</constant><replaceable>address</replaceable><constant>n</constant><replaceable>port_name</replaceable></varname></term> | |
205 | <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> | |
206 | <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> | |
207 | <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> | |
208 | ||
209 | <listitem><para>This property describes the device installation location. Different schemes are | |
210 | used depending on the bus type, as described in the table below. For BCMA and USB devices, PCI path | |
211 | information must known, and the full name consists of the prefix, PCI slot identifier, and USB or | |
212 | BCMA location. The first two parts are denoted as "…" in the table below.</para> | |
213 | ||
214 | <table> | |
215 | <title>Path naming schemes</title> | |
216 | ||
217 | <tgroup cols='2'> | |
218 | <thead> | |
219 | <row> | |
220 | <entry>Format</entry> | |
221 | <entry>Description</entry> | |
222 | </row> | |
223 | </thead> | |
224 | ||
225 | <tbody> | |
226 | <row> | |
227 | <entry><replaceable>prefix</replaceable> <constant>c</constant><replaceable>bus_id</replaceable></entry> | |
228 | <entry>CCW or grouped CCW device identifier</entry> | |
229 | </row> | |
230 | ||
231 | <row> | |
232 | <entry><replaceable>prefix</replaceable> <constant>a</constant><replaceable>vendor</replaceable> <replaceable>model</replaceable> <constant>i</constant><replaceable>instance</replaceable></entry> | |
233 | <entry>ACPI path names for ARM64 platform devices</entry> | |
234 | </row> | |
235 | ||
236 | <row> | |
237 | <entry><replaceable>prefix</replaceable> <constant>i</constant><replaceable>address</replaceable> <constant>n</constant><replaceable>port_name</replaceable></entry> | |
238 | <entry>Netdevsim (simulated networking device) device number and port name</entry> | |
239 | </row> | |
240 | ||
241 | <row> | |
242 | <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> | |
243 | <entry>PCI geographical location</entry> | |
244 | </row> | |
245 | ||
246 | <row> | |
247 | <entry>… <constant>b</constant><replaceable>number</replaceable></entry> | |
248 | <entry>Broadcom bus (BCMA) core number</entry> | |
249 | </row> | |
250 | ||
251 | <row> | |
252 | <entry>… <constant>u</constant><replaceable>port</replaceable>… [<constant>c</constant><replaceable>config</replaceable>] [<constant>i</constant><replaceable>interface</replaceable>]</entry> | |
253 | <entry>USB port number chain</entry> | |
254 | </row> | |
255 | ||
256 | </tbody> | |
257 | </tgroup> | |
258 | </table> | |
259 | ||
260 | <para>CCW and grouped CCW devices are found in IBM System Z mainframes. Any leading zeros and | |
261 | dots are suppressed.</para> | |
262 | ||
263 | <para>For PCI, BCMA, and USB devices, the same rules as described above for slot naming are | |
264 | used.</para> | |
265 | </listitem> | |
266 | </varlistentry> | |
267 | </variablelist> | |
268 | </refsect1> | |
269 | ||
270 | <refsect1> | |
271 | <title>History</title> | |
272 | ||
66ad93e8 LP |
273 | <para>The following "naming schemes" have been defined (which may be chosen at system boot-up time via |
274 | the <varname>net.naming-scheme=</varname> kernel command line switch, see above:</para> | |
0b1e5b6e ZJS |
275 | |
276 | <variablelist> | |
277 | <varlistentry> | |
278 | <term><constant>v238</constant></term> | |
279 | ||
955ed5d5 | 280 | <listitem><para>This is the naming scheme that was implemented in systemd 238.</para></listitem> |
0b1e5b6e ZJS |
281 | </varlistentry> |
282 | ||
283 | <varlistentry> | |
284 | <term><constant>v239</constant></term> | |
285 | ||
286 | <listitem><para>Naming was changed for virtual network interfaces created with SR-IOV and NPAR and | |
287 | for devices where the PCI network controller device does not have a slot number associated.</para> | |
288 | ||
289 | <para>SR-IOV virtual devices are named based on the name of the parent interface, with a suffix of | |
290 | <literal>v<replaceable>port</replaceable></literal>, where <replaceable>port</replaceable> is the | |
291 | virtual device number. Previously those virtual devices were named as if completely independent. | |
292 | </para> | |
293 | ||
294 | <para>The ninth and later NPAR virtual devices are named following the scheme used for the first | |
295 | eight NPAR partitions. Previously those devices were not renamed and the kernel default | |
296 | ("eth<replaceable>N</replaceable>") was used.</para> | |
297 | ||
298 | <para>Names are also generated for PCI devices where the PCI network controller device does not | |
299 | have an associated slot number itself, but one of its parents does. Previously those devices were | |
300 | not renamed and the kernel default was used.</para> | |
301 | </listitem> | |
302 | </varlistentry> | |
303 | ||
304 | <varlistentry> | |
305 | <term><constant>v240</constant></term> | |
306 | ||
2ebe027b | 307 | <listitem><para>The <literal>ib</literal> prefix and stable names for infiniband devices are |
0b1e5b6e ZJS |
308 | introduced. Previously those devices were not renamed.</para> |
309 | ||
310 | <para>The ACPI index field (used in <varname>ID_NET_NAME_ONBOARD=</varname>) is now also used when | |
311 | 0.</para> | |
312 | ||
313 | <para>A new naming policy <varname>NamePolicy=keep</varname> was introduced. With this policy, if | |
314 | the network device name was already set by userspace, the device will not be renamed | |
315 | again. Previously, this naming policy applied implicitly, and now it must be explicitly | |
316 | requested. Effectively, this means that network devices will be renamed according to the | |
317 | configuration, even if they have been renamed already, if <constant>keep</constant> is not | |
b0343f8c | 318 | specified as the naming policy in the <filename index="false">.link</filename> file. See |
0b1e5b6e | 319 | <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
2ebe027b | 320 | for a description of <varname>NamePolicy=</varname>.</para></listitem> |
0b1e5b6e ZJS |
321 | </varlistentry> |
322 | ||
96848152 ZJS |
323 | <varlistentry> |
324 | <term><constant>v241</constant></term> | |
325 | ||
326 | <listitem><para><option>MACAddressPolicy=persistent</option> was extended to set MAC addresses | |
327 | based on the device name. Previously addresses were only based on the | |
b0343f8c | 328 | <varname index="false">ID_NET_NAME_*</varname> attributes, which meant that interface names would |
96848152 ZJS |
329 | never be generated for virtual devices. Now a persistent address will be generated for most |
330 | devices, including in particular bridges.</para> | |
331 | ||
332 | <para>Note: when userspace does not set a MAC address for a bridge device, the kernel will | |
333 | initially assign a random address, and then change it when the first device is enslaved to the | |
334 | bridge. With this naming policy change, bridges get a persistent MAC address based on the bridge | |
335 | name instead of the first enslaved device.</para></listitem> | |
336 | </varlistentry> | |
337 | ||
0b1e5b6e ZJS |
338 | <varlistentry> |
339 | <term><constant>v243</constant></term> | |
340 | ||
2ebe027b ZJS |
341 | <listitem><para>Support for renaming netdevsim (simulated networking) devices was added. Previously |
342 | those devices were not renamed.</para> | |
8c053c83 ZJS |
343 | |
344 | <para>Previously two-letter interface type prefix was prepended to | |
2ebe027b | 345 | <varname>ID_NET_LABEL_ONBOARD=</varname>. This is not done anymore.</para></listitem> |
0b1e5b6e | 346 | </varlistentry> |
bc5ea049 KK |
347 | |
348 | <varlistentry> | |
349 | <term><constant>v245</constant></term> | |
350 | ||
351 | <listitem><para>When | |
352 | <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
353 | derives the name for the host side of the network interface created with | |
354 | <option>--network-veth</option> from the container name it previously simply truncated the result | |
355 | at 15 characters if longer (since that's the maximum length for network interface names). From now | |
356 | on, for any interface name that would be longer than 15 characters the last 4 characters are set to | |
357 | a 24bit hash value of the full interface name. This way network interface name collisions between | |
358 | multiple similarly named containers (who only differ in container name suffix) should be less | |
359 | likely (but still possible, since the 24bit hash value is very small).</para></listitem> | |
360 | </varlistentry> | |
2c8ec009 MS |
361 | |
362 | <varlistentry> | |
66ad93e8 | 363 | <term><constant>v247</constant></term> |
2c8ec009 | 364 | |
377a9545 | 365 | <listitem><para>If the PCI slot is associated with PCI bridge and that has multiple child network |
2c8ec009 MS |
366 | controllers then all of them might derive the same value of <varname>ID_NET_NAME_SLOT</varname> |
367 | property. That could cause naming conflict if the property is selected as a device name. Now, we detect the | |
368 | situation, slot - bridge relation, and we don't produce the <varname>ID_NET_NAME_SLOT</varname> property to | |
369 | avoid possible naming conflict.</para></listitem> | |
370 | </varlistentry> | |
371 | ||
bc5ea049 | 372 | </variablelist> |
2ebe027b ZJS |
373 | |
374 | <para>Note that <constant>latest</constant> may be used to denote the latest scheme known (to this | |
e9dd6984 | 375 | particular version of systemd).</para> |
0b1e5b6e ZJS |
376 | </refsect1> |
377 | ||
378 | <refsect1> | |
379 | <title>Examples</title> | |
380 | ||
381 | <example> | |
382 | <title>Using <command>udevadm test-builtin</command> to display device properties</title> | |
383 | ||
384 | <programlisting>$ udevadm test-builtin net_id /sys/class/net/enp0s31f6 | |
385 | ... | |
386 | Using default interface naming scheme 'v243'. | |
387 | ID_NET_NAMING_SCHEME=v243 | |
388 | ID_NET_NAME_MAC=enx54ee75cb1dc0 | |
389 | ID_OUI_FROM_DATABASE=Wistron InfoComm(Kunshan)Co.,Ltd. | |
390 | ID_NET_NAME_PATH=enp0s31f6 | |
391 | ...</programlisting> | |
392 | </example> | |
393 | ||
394 | <example> | |
395 | <title>PCI Ethernet card with firmware index "1"</title> | |
396 | ||
397 | <programlisting>ID_NET_NAME_ONBOARD=eno1 | |
8c053c83 | 398 | ID_NET_NAME_ONBOARD_LABEL=Ethernet Port 1 |
0b1e5b6e | 399 | </programlisting> |
0b1e5b6e ZJS |
400 | </example> |
401 | ||
402 | <example> | |
403 | <title>PCI Ethernet card in hotplug slot with firmware index number</title> | |
404 | ||
405 | <programlisting># /sys/devices/pci0000:00/0000:00:1c.3/0000:05:00.0/net/ens1 | |
406 | ID_NET_NAME_MAC=enx000000000466 | |
407 | ID_NET_NAME_PATH=enp5s0 | |
408 | ID_NET_NAME_SLOT=ens1</programlisting> | |
409 | </example> | |
410 | ||
411 | <example> | |
412 | <title>PCI Ethernet multi-function card with 2 ports</title> | |
413 | ||
414 | <programlisting># /sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0/net/enp2s0f0 | |
415 | ID_NET_NAME_MAC=enx78e7d1ea46da | |
416 | ID_NET_NAME_PATH=enp2s0f0 | |
417 | ||
418 | # /sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.1/net/enp2s0f1 | |
419 | ID_NET_NAME_MAC=enx78e7d1ea46dc | |
420 | ID_NET_NAME_PATH=enp2s0f1</programlisting> | |
421 | </example> | |
422 | ||
423 | <example> | |
424 | <title>PCI WLAN card</title> | |
425 | ||
426 | <programlisting># /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/net/wlp3s0 | |
427 | ID_NET_NAME_MAC=wlx0024d7e31130 | |
428 | ID_NET_NAME_PATH=wlp3s0</programlisting> | |
429 | </example> | |
430 | ||
431 | <example> | |
432 | <title>PCI IB host adapter with 2 ports</title> | |
433 | ||
434 | <programlisting># /sys/devices/pci0000:00/0000:00:03.0/0000:15:00.0/net/ibp21s0f0 | |
435 | ID_NET_NAME_PATH=ibp21s0f0 | |
436 | ||
437 | # /sys/devices/pci0000:00/0000:00:03.0/0000:15:00.1/net/ibp21s0f1 | |
438 | ID_NET_NAME_PATH=ibp21s0f1</programlisting> | |
439 | </example> | |
440 | ||
441 | <example> | |
442 | <title>USB built-in 3G modem</title> | |
443 | ||
444 | <programlisting># /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.6/net/wwp0s29u1u4i6 | |
445 | ID_NET_NAME_MAC=wwx028037ec0200 | |
446 | ID_NET_NAME_PATH=wwp0s29u1u4i6</programlisting> | |
447 | </example> | |
448 | ||
449 | <example> | |
450 | <title>USB Android phone</title> | |
451 | ||
452 | <programlisting># /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/net/enp0s29u1u2 | |
453 | ID_NET_NAME_MAC=enxd626b3450fb5 | |
454 | ID_NET_NAME_PATH=enp0s29u1u2</programlisting> | |
455 | </example> | |
456 | ||
457 | <example> | |
458 | <title>s390 grouped CCW interface</title> | |
459 | ||
460 | <programlisting># /sys/devices/css0/0.0.0007/0.0.f5f0/group_device/net/encf5f0 | |
461 | ID_NET_NAME_MAC=enx026d3c00000a | |
462 | ID_NET_NAME_PATH=encf5f0</programlisting> | |
463 | </example> | |
464 | </refsect1> | |
465 | ||
466 | <refsect1> | |
467 | <title>See Also</title> | |
468 | <para> | |
469 | <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>, | |
470 | <citerefentry><refentrytitle>udevadm</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
bc5ea049 KK |
471 | <ulink url="https://systemd.io/PREDICTABLE_INTERFACE_NAMES">Predictable Network Interface Names</ulink>, |
472 | <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
0b1e5b6e ZJS |
473 | </para> |
474 | </refsect1> | |
475 | ||
476 | </refentry> |