Debian Codegraph @

upstream/debian-unstable/man7/systemd.net-naming-scheme.7

raw
1 '\" t
2 .TH "SYSTEMD\&.NET\-NAMING\-SCHEME" "7" "" "systemd 261~rc3" "systemd.net-naming-scheme"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 systemd.net-naming-scheme \- Network device naming schemes
24 .SH "DESCRIPTION"
25 .PP
26 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
27 \fBsystemd-udevd.service\fR(8)
28 builtin
29 \fBnet_id\fR
30 and exported as
31 \fBudev\fR(7)
32 properties (\fIID_NET_NAME_ONBOARD=\fR,
33 \fIID_NET_LABEL_ONBOARD=\fR,
34 \fIID_NET_NAME_PATH=\fR,
35 \fIID_NET_NAME_SLOT=\fR)\&.
36 .PP
37 Names and MAC addresses are derived from various stable device metadata attributes\&. Newer versions of
38 \fBsystemd\-udevd\fR
39 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
40 \fInet\&.naming_scheme=\fR
41 kernel command line switch, see
42 \fBsystemd-udevd.service\fR(8)\&. Available naming schemes are described below\&.
43 .PP
44 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
45 \fINamePolicy=\fR
46 and
47 \fIMACAddressPolicy=\fR
48 in
49 \fBsystemd.link\fR(5)\&.
50 .PP
51 Note that while the concept of network interface naming schemes is primarily relevant in the context of
52 systemd\-udevd\&.service, the
53 \fBsystemd-nspawn\fR(1)
54 container manager also takes it into account when naming network interfaces, see below\&.
55 .SH "POLICIES"
56 .PP
57 All names start with a two\-character prefix that signifies the interface type\&.
58 .sp
59 .it 1 an-trap
60 .nr an-no-space-flag 1
61 .nr an-break-flag 1
62 .br
63 .B Table\ \&1.\ \&Two character prefixes based on the type of interface
64 .TS
65 allbox tab(:);
66 lB lB.
67 T{
68 Prefix
69 T}:T{
70 Description
71 T}
72 .T&
73 l l
74 l l
75 l l
76 l l
77 l l
78 l l.
79 T{
80 \fBen\fR
81 T}:T{
82 Ethernet
83 T}
84 T{
85 \fBib\fR
86 T}:T{
87 InfiniBand
88 T}
89 T{
90 \fBsl\fR
91 T}:T{
92 Serial line IP (slip)
93 T}
94 T{
95 \fBwl\fR
96 T}:T{
97 Wireless local area network (WLAN)
98 T}
99 T{
100 \fBww\fR
101 T}:T{
102 Wireless wide area network (WWAN)
103 T}
104 T{
105 \fBmc\fR
106 T}:T{
107 Management Component Transport Protocol (MCTP)
108 T}
109 .TE
110 .sp 1
111 .PP
112 The
113 \fBudev\fR(7)
114 \fBnet_id\fR
115 builtin exports the following device properties:
116 .PP
117 \fIID_NET_NAME_ONBOARD=\fR\fIprefix\fR\fBo\fR\fInumber\fR, \fIID_NET_NAME_ONBOARD=\fR\fIprefix\fR\fBd\fR\fInumber\fR
118 .RS 4
119 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\&.
120 .sp
121 .it 1 an-trap
122 .nr an-no-space-flag 1
123 .nr an-break-flag 1
124 .br
125 .B Table\ \&2.\ \&On\-board naming schemes
126 .TS
127 allbox tab(:);
128 lB lB.
129 T{
130 Format
131 T}:T{
132 Description
133 T}
134 .T&
135 l l
136 l l.
137 T{
138 \fIprefix\fR\fBo\fR\fInumber\fR
139 T}:T{
140 PCI on\-board index
141 T}
142 T{
143 \fIprefix\fR\fBd\fR\fInumber\fR
144 T}:T{
145 DeviceTree alias index
146 T}
147 .TE
148 .sp 1
149 Added in version 243\&.
150 .RE
151 .PP
152 \fIID_NET_LABEL_ONBOARD=\fR\fIlabel\fR
153 .RS 4
154 This property is set based on textual label given by the firmware for on\-board devices\&. This is only available for PCI devices\&.
155 .sp
156 Added in version 243\&.
157 .RE
158 .PP
159 \fIID_NET_NAME_MAC=\fR\fIprefix\fR\fBx\fR\fIAABBCCDDEEFF\fR
160 .RS 4
161 This name consists of the prefix, letter
162 \fBx\fR, 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\&.
163 .sp
164 Added in version 243\&.
165 .RE
166 .PP
167 \fIID_NET_NAME_SLOT=\fR\fIprefix\fR[\fBP\fR\fIdomain\fR]\fBs\fR\fIslot\fR[\fBf\fR\fIfunction\fR][\fBn\fR\fIport_name\fR|\fBd\fR\fIdev_port\fR], \fIID_NET_NAME_SLOT=\fR\fIprefix\fR\fBv\fR\fIslot\fR, \fIID_NET_NAME_SLOT=\fR\fIprefix\fR\fBx\fR\fIslot\fR, \fIID_NET_NAME_SLOT=\fR\fIprefix\fR[\fBP\fR\fIdomain\fR]\fBs\fR\fIslot\fR[\fBf\fR\fIfunction\fR][\fBn\fR\fIport_name\fR|\fBd\fR\fIdev_port\fR]\fBb\fR\fInumber\fR, \fIID_NET_NAME_SLOT=\fR\fIprefix\fR[\fBP\fR\fIdomain\fR]\fBs\fR\fIslot\fR[\fBf\fR\fIfunction\fR][\fBn\fR\fIport_name\fR|\fBd\fR\fIdev_port\fR]\fBu\fR\fIport\fR\&...[\fBc\fR\fIconfig\fR][\fBi\fR\fIinterface\fR], \fIID_NET_NAME_SLOT=\fR\fIprefix\fR[\fBP\fR\fIdomain\fR]\fBs\fR\fIslot\fR[\fBf\fR\fIfunction\fR][\fBn\fR\fIport_name\fR|\fBd\fR\fIdev_port\fR]\fBv\fR\fIslot\fR, \fIID_NET_NAME_SLOT=\fR\fIprefix\fR[\fBP\fR\fIdomain\fR]\fBs\fR\fIslot\fR[\fBf\fR\fIfunction\fR][\fBn\fR\fIport_name\fR|\fBd\fR\fIdev_port\fR]\fBr\fR\fIslot\fR, \fIID_NET_NAME_SLOT=\fR\fIprefix\fR[\fBP\fR\fIdomain\fR]\fBs\fR\fIslot\fR[\fBf\fR\fIfunction\fR][\fBn\fR\fIport_name\fR|\fBd\fR\fIdev_port\fR]\fBS\fR\fIsfnum\fR
168 .RS 4
169 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\&.
170 .sp
171 .it 1 an-trap
172 .nr an-no-space-flag 1
173 .nr an-break-flag 1
174 .br
175 .B Table\ \&3.\ \&Slot naming schemes
176 .TS
177 allbox tab(:);
178 lB lB.
179 T{
180 Format
181 T}:T{
182 Description
183 T}
184 .T&
185 l l
186 l l
187 l l
188 l l
189 l l
190 l l
191 l l
192 l l.
193 T{
194 \fIprefix\fR\ \&[\fBP\fR\fIdomain\fR]\ \&\fBs\fR\fIslot\fR\ \&[\fBf\fR\fIfunction\fR]\ \&[\fBn\fR\fIport_name\fR\ \&|\ \&\fBd\fR\fIdev_port\fR]
195 T}:T{
196 PCI slot number
197 T}
198 T{
199 \fIprefix\fR\ \&\fBv\fR\fIslot\fR
200 T}:T{
201 VIO slot number (IBM PowerVM)
202 T}
203 T{
204 \fIprefix\fR\ \&\fBX\fR\fInumber\fR
205 T}:T{
206 VIF interface number (Xen)
207 T}
208 T{
209 \&...\ \&\fBb\fR\fInumber\fR
210 T}:T{
211 Broadcom bus (BCMA) core number
212 T}
213 T{
214 \&...\ \&\fBu\fR\fIport\fR\&...\ \&[\fBc\fR\fIconfig\fR]\ \&[\fBi\fR\fIinterface\fR]
215 T}:T{
216 USB port number chain
217 T}
218 T{
219 \&...\ \&\fBv\fR\fIslot\fR
220 T}:T{
221 SR\-VIO slot number
222 T}
223 T{
224 \&...\ \&\fBr\fR\fIslot\fR
225 T}:T{
226 SR\-IOV slot number
227 T}
228 T{
229 \&... \fBS\fR\fIsfnum\fR
230 T}:T{
231 Auxiliary sub\-function (SF) number
232 T}
233 .TE
234 .sp 1
235 The PCI domain is only prepended when it is not 0\&. All multi\-function PCI devices will carry the
236 \fBf\fR\fIfunction\fR
237 number in the device name, including the function 0 device\&. For non\-multi\-function devices, the number is suppressed if 0\&. The port name
238 \fIport_name\fR
239 is used, or the port number
240 \fBd\fR\fIdev_port\fR
241 if the name is not known\&.
242 .sp
243 For BCMA devices, the core number is suppressed when 0\&.
244 .sp
245 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\&.
246 .sp
247 SR\-IOV virtual devices are named based on the name of the parent interface, with a suffix of
248 \fBv\fR
249 and the virtual device number, with any leading zeros removed\&. The bus number is ignored\&.
250 .sp
251 SR\-IOV virtual device representors are named based on the name of the physical device interface, with a suffix of
252 \fBr\fR
253 and the number of the virtual device that is linked to the particular representor, with any leading zeros removed\&. The physical port name and the bus number are ignored\&.
254 .sp
255 Auxiliary sub\-function (SF) network devices, where the network device\*(Aqs parent is an auxiliary device exposing a
256 \fBsfnum\fR
257 sysfs attribute (currently mlx5_core SFs), are named based on the underlying PCI function (the PF, or for VF\-SF the PF behind the VF), with a suffix of
258 \fBS\fR
259 and the user\-defined sub\-function number from
260 \fBsfnum\fR\&. This is analogous to how SR\-IOV virtual function devices are named with a
261 \fBv\fR
262 suffix\&.
263 .sp
264 If the SF\*(Aqs parent PCI function is itself an SR\-IOV virtual function (VF\-SF), the name is rooted at the PF and both suffixes are chained, with the
265 \fBv\fR
266 suffix preceding the
267 \fBS\fR
268 suffix (e\&.g\&.
269 "enp193s0f0v0S88")\&. The PF, the VF, and the SF therefore form a stable, hierarchical sequence regardless of the VF\*(Aqs underlying PCI bus/device/function numbering\&.
270 .sp
271 In some configurations a parent PCI bridge of a given network controller may be associated with a slot\&. In such case we do not generate this device property to avoid possible naming conflicts\&.
272 .sp
273 Added in version 243\&.
274 .RE
275 .PP
276 \fIID_NET_NAME_PATH=\fR\fIprefix\fR\fBc\fR\fIbus_id\fR, \fIID_NET_NAME_PATH=\fR\fIprefix\fR\fBa\fR\fIvendor\fR\fImodel\fR\fBi\fR\fIinstance\fR, \fIID_NET_NAME_PATH=\fR\fIprefix\fR\fBi\fR\fIaddress\fR\fBn\fR\fIport_name\fR, \fIID_NET_NAME_PATH=\fR\fIprefix\fR\fBu\fR\fIport\fR\&..., \fIID_NET_NAME_PATH=\fR\fIprefix\fR[\fBP\fR\fIdomain\fR]\fBp\fR\fIbus\fR\fBs\fR\fIslot\fR[\fBf\fR\fIfunction\fR][\fBn\fR\fIphys_port_name\fR|\fBd\fR\fIdev_port\fR], \fIID_NET_NAME_PATH=\fR\fIprefix\fR[\fBP\fR\fIdomain\fR]\fBp\fR\fIbus\fR\fBs\fR\fIslot\fR[\fBf\fR\fIfunction\fR][\fBn\fR\fIphys_port_name\fR|\fBd\fR\fIdev_port\fR]\fBb\fR\fInumber\fR, \fIID_NET_NAME_PATH=\fR\fIprefix\fR[\fBP\fR\fIdomain\fR]\fBp\fR\fIbus\fR\fBs\fR\fIslot\fR[\fBf\fR\fIfunction\fR][\fBn\fR\fIphys_port_name\fR|\fBd\fR\fIdev_port\fR]\fBu\fR\fIport\fR\&...[\fBc\fR\fIconfig\fR][\fBi\fR\fIinterface\fR], \fIID_NET_NAME_PATH=\fR\fIprefix\fR[\fBP\fR\fIdomain\fR]\fBp\fR\fIbus\fR\fBs\fR\fIslot\fR[\fBf\fR\fIfunction\fR][\fBn\fR\fIphys_port_name\fR|\fBd\fR\fIdev_port\fR]\fBS\fR\fIsfnum\fR
277 .RS 4
278 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\&.
279 .sp
280 .it 1 an-trap
281 .nr an-no-space-flag 1
282 .nr an-break-flag 1
283 .br
284 .B Table\ \&4.\ \&Path naming schemes
285 .TS
286 allbox tab(:);
287 lB lB.
288 T{
289 Format
290 T}:T{
291 Description
292 T}
293 .T&
294 l l
295 l l
296 l l
297 l l
298 l l
299 l l
300 l l.
301 T{
302 \fIprefix\fR\ \&\fBc\fR\fIbus_id\fR
303 T}:T{
304 CCW or grouped CCW device identifier
305 T}
306 T{
307 \fIprefix\fR\ \&\fBa\fR\fIvendor\fR\ \&\fImodel\fR\ \&\fBi\fR\fIinstance\fR
308 T}:T{
309 ACPI path names for ARM64 platform devices
310 T}
311 T{
312 \fIprefix\fR\ \&\fBi\fR\fIaddress\fR\ \&\fBn\fR\fIport_name\fR
313 T}:T{
314 Netdevsim (simulated networking device) device number and port name
315 T}
316 T{
317 \fIprefix\fR\ \&[\fBP\fR\fIdomain\fR]\ \&\fBp\fR\fIbus\fR\ \&\fBs\fR\fIslot\fR\ \&[\fBf\fR\fIfunction\fR]\ \&[\fBn\fR\fIphys_port_name\fR\ \&|\ \&\fBd\fR\fIdev_port\fR]
318 T}:T{
319 PCI geographical location
320 T}
321 T{
322 \&...\ \&\fBb\fR\fInumber\fR
323 T}:T{
324 Broadcom bus (BCMA) core number
325 T}
326 T{
327 \&...\ \&\fBu\fR\fIport\fR\&...\ \&[\fBc\fR\fIconfig\fR]\ \&[\fBi\fR\fIinterface\fR]
328 T}:T{
329 USB port number chain
330 T}
331 T{
332 \&... \fBS\fR\fIsfnum\fR
333 T}:T{
334 Auxiliary sub\-function (SF) number
335 T}
336 .TE
337 .sp 1
338 CCW and grouped CCW devices are found in IBM System Z mainframes\&. Any leading zeros and dots are suppressed\&.
339 .sp
340 For PCI, BCMA, and USB devices, the same rules as described above for slot naming are used\&.
341 .sp
342 Added in version 243\&.
343 .RE
344 .SH "HISTORY"
345 .PP
346 The following "naming schemes" have been defined (which may be chosen at system boot\-up time via the
347 \fInet\&.naming_scheme=\fR
348 kernel command line switch, see above):
349 .PP
350 \fBv238\fR
351 .RS 4
352 This is the naming scheme that was implemented in systemd 238\&.
353 .sp
354 Added in version 243\&.
355 .RE
356 .PP
357 \fBv239\fR
358 .RS 4
359 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\&.
360 .sp
361 SR\-IOV virtual devices are named based on the name of the parent interface, with a suffix of
362 "v\fIport\fR", where
363 \fIport\fR
364 is the virtual device number\&. Previously those virtual devices were named as if completely independent\&.
365 .sp
366 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\fIN\fR") was used\&.
367 .sp
368 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\&.
369 .sp
370 Added in version 243\&.
371 .RE
372 .PP
373 \fBv240\fR
374 .RS 4
375 The
376 "ib"
377 prefix and stable names for infiniband devices are introduced\&. Previously those devices were not renamed\&.
378 .sp
379 The ACPI index field (used in
380 \fIID_NET_NAME_ONBOARD=\fR) is now also used when 0\&.
381 .sp
382 A new naming policy
383 \fINamePolicy=keep\fR
384 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
385 \fBkeep\fR
386 is not specified as the naming policy in the
387 \&.link
388 file\&. See
389 \fBsystemd.link\fR(5)
390 for a description of
391 \fINamePolicy=\fR\&.
392 .sp
393 Added in version 243\&.
394 .RE
395 .PP
396 \fBv241\fR
397 .RS 4
398 \fBMACAddressPolicy=persistent\fR
399 was extended to set MAC addresses based on the device name\&. Previously addresses were only based on the
400 \fIID_NET_NAME_*\fR
401 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\&.
402 .sp
403 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\&.
404 .sp
405 Added in version 243\&.
406 .RE
407 .PP
408 \fBv243\fR
409 .RS 4
410 Support for renaming netdevsim (simulated networking) devices was added\&. Previously those devices were not renamed\&.
411 .sp
412 Previously two\-letter interface type prefix was prepended to
413 \fIID_NET_LABEL_ONBOARD=\fR\&. This is not done anymore\&.
414 .sp
415 Added in version 243\&.
416 .RE
417 .PP
418 \fBv245\fR
419 .RS 4
420 When
421 \fBsystemd-nspawn\fR(1)
422 derives the name for the host side of the network interface created with
423 \fB\-\-network\-veth\fR
424 from the container name it previously simply truncated the result at 15 characters if longer (since that\*(Aqs 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)\&.
425 .sp
426 Added in version 245\&.
427 .RE
428 .PP
429 \fBv247\fR
430 .RS 4
431 When a PCI slot is associated with a PCI bridge that has multiple child network controllers, the same value of the
432 \fIID_NET_NAME_SLOT\fR
433 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 do not produce the
434 \fIID_NET_NAME_SLOT\fR
435 property\&.
436 .sp
437 Added in version 247\&.
438 .RE
439 .PP
440 \fBv249\fR
441 .RS 4
442 PCI hotplug slot names for the s390 PCI driver are a hexadecimal representation of the
443 function_id
444 device attribute\&. This attribute is now used to build the
445 \fIID_NET_NAME_SLOT\fR\&. Before that, all slot names were parsed as decimal numbers, which could either result in an incorrect value of the
446 \fIID_NET_NAME_SLOT\fR
447 property or none at all\&.
448 .sp
449 Some firmware and hypervisor implementations report unreasonably high numbers for the on\-board index\&. To prevent the generation of bogus on\-board interface names, index numbers greater than 16381 (2\(S1⁴\-1) were ignored\&. For s390 PCI devices index values up to 65535 (2\(S1⁶\-1) are valid\&. To account for that, the limit was increased to 65535\&.
450 .sp
451 The
452 \fBudev\fR(7)
453 rule
454 \fINAME=\fR
455 replaces
456 ":",
457 "/", and
458 "%"
459 with an underscore ("_"), and refuses strings which contain only digits\&.
460 .sp
461 Added in version 249\&.
462 .RE
463 .PP
464 \fBv250\fR
465 .RS 4
466 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)\&.
467 .sp
468 Added in version 250\&.
469 .RE
470 .PP
471 \fBv251\fR
472 .RS 4
473 Since version
474 \fBv247\fR
475 we no longer set
476 \fIID_NET_NAME_SLOT\fR
477 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\&. Note, this is reverted in
478 \fBv255\fR\&. See below\&.
479 .sp
480 Added in version 251\&.
481 .RE
482 .PP
483 \fBv252\fR
484 .RS 4
485 Added naming scheme for platform devices with devicetree aliases\&.
486 .sp
487 Added in version 252\&.
488 .RE
489 .PP
490 \fBv253\fR
491 .RS 4
492 Set
493 \fIID_NET_NAME_PATH\fR
494 for usb devices not connected via a PCI bus\&.
495 .sp
496 Added in version 253\&.
497 .RE
498 .PP
499 \fBv254\fR
500 .RS 4
501 Naming was changed for SR\-IOV virtual device representors, optionally settable at compilation time\&. The
502 "r\fIslot\fR"
503 suffix was added to differentiate SR\-IOV virtual device representors attached to a single physical device interface\&. Because of a mistake, this scheme was
504 \fInot the default scheme for systemd version 254\fR\&.
505 .sp
506 Added in version 255\&.
507 .RE
508 .PP
509 \fBv255\fR
510 .RS 4
511 Naming was changed for SR\-IOV virtual device representors to enable the change introduced in
512 \fBv254\fR
513 by default\&.
514 .sp
515 If we detect that a PCI device associated with a slot is a PCI bridge, we no longer set
516 \fIID_NET_NAME_SLOT\fR, reverting a change that was introduced in
517 \fBv251\fR\&.
518 .sp
519 Added in version 255\&.
520 .RE
521 .PP
522 \fBv257\fR
523 .RS 4
524 PCI slot number is now read from
525 \fBfirmware_node/sun\fR
526 sysfs file\&.
527 .sp
528 The naming scheme based on devicetree aliases was extended to support aliases for individual interfaces of controllers with multiple ports\&.
529 .sp
530 Added in version 257\&.
531 .RE
532 .PP
533 \fBv258\fR
534 .RS 4
535 When no renaming is requested,
536 \fIID_NET_NAME\fR
537 property is now equivalent to
538 \fIINTERFACE\fR
539 property\&.
540 .sp
541 Added in version 258\&.
542 .RE
543 .PP
544 \fBv259\fR
545 .RS 4
546 The naming scheme based on devicetree aliases was extended to support WLAN devices\&.
547 .sp
548 Added in version 259\&.
549 .RE
550 .PP
551 \fBv260\fR
552 .RS 4
553 MCTP interfaces are now assigned persistent names, using a
554 \fBmc\fR
555 prefix\&.
556 .sp
557 Added in version 260\&.
558 .RE
559 .PP
560 \fBv261\fR
561 .RS 4
562 Stable names are now generated for auxiliary sub\-function (SF) network devices (such as
563 "mlx5_core"
564 SFs)\&. The name is built from the parent PCI Physical Function\*(Aqs path with an
565 "S\fIsfnum\fR"
566 suffix, where
567 \fIsfnum\fR
568 is the user\-defined SF number (the value passed to
569 \fBdevlink port add \&... sfnum \fR\fB\fIN\fR\fR, exposed by the kernel as the
570 \fBsfnum\fR
571 sysfs attribute on the auxiliary device)\&. This is analogous to the
572 "v\fIN\fR"
573 suffix used for SR\-IOV virtual functions; for SFs hosted on SR\-IOV VFs (VF\-SF), the two suffixes are chained on top of the PF\*(Aqs base name\&.
574 .sp
575 Added in version 261\&.
576 .RE
577 .PP
578 Note that
579 \fBlatest\fR
580 may be used to denote the latest scheme known (to this particular version of systemd)\&.
581 .SH "LIMITING THE USE OF SPECIFIC SYSFS ATTRIBUTES"
582 .PP
583 When creating names for network cards, some naming schemes use data from sysfs populated by the kernel\&. This means that although a specific naming scheme in
584 \fBudev\fR(7)
585 is picked, the network card\*(Aqs name can still change when a new kernel version adds a new sysfs attribute\&. For example, if kernel starts setting the
586 \fBphys_port_name\fR,
587 \fBudev\fR
588 will append the "\fBn\fR\fIphys_port_name\fR" suffix to the device name\&.
589 .PP
590 \fIID_NET_NAME_ALLOW=\fR\fIBOOL\fR
591 .RS 4
592 This udev property sets a fallback policy for reading a sysfs attribute\&. If set to
593 \fB0\fR
594 udev will not read any sysfs attribute by default, unless it is explicitly allowlisted, see below\&. If set to
595 \fB1\fR
596 udev can use any sysfs attribute unless it is explicitly forbidden\&. The default value is
597 \fB1\fR\&.
598 .sp
599 Added in version 256\&.
600 .RE
601 .PP
602 \fIID_NET_NAME_ALLOW_\fR\fI\fIsysfsattr\fR\fR\fI=\fR\fI\fIBOOL\fR\fR
603 .RS 4
604 This udev property explicitly states if udev shall use the specified
605 \fIsysfsattr\fR, when composing the device name\&.
606 .sp
607 Added in version 256\&.
608 .RE
609 .PP
610 With these options, users can set an allowlist or denylist for sysfs attributes\&. To create an allowlist, the user needs to set
611 \fIID_NET_NAME_ALLOW=0\fR
612 for the device and then list the allowed attributes with the
613 \fIID_NET_NAME_ALLOW_\fR\fI\fIsysfsattr\fR\fR\fI=1\fR
614 options\&. In case of a denylist, the user needs to provide the list of denied attributes with the
615 \fIID_NET_NAME_ALLOW_\fR\fI\fIsysfsattr\fR\fR\fI=0\fR
616 options\&.
617 .SH "EXAMPLES"
618 .PP
619 \fBExample\ \&1.\ \&Using udevadm test\-builtin to display device properties\fR
620 .sp
621 .if n \{\
622 .RS 4
623 .\}
624 .nf
625 $ udevadm test\-builtin net_id /sys/class/net/enp0s31f6
626 \&.\&.\&.
627 Using default interface naming scheme \*(Aqv243\*(Aq\&.
628 ID_NET_NAMING_SCHEME=v243
629 ID_NET_NAME_MAC=enx54ee75cb1dc0
630 ID_OUI_FROM_DATABASE=Wistron InfoComm(Kunshan)Co\&.,Ltd\&.
631 ID_NET_NAME_PATH=enp0s31f6
632 \&.\&.\&.
633 .fi
634 .if n \{\
635 .RE
636 .\}
637 .PP
638 \fBExample\ \&2.\ \&PCI Ethernet card with firmware index "1"\fR
639 .sp
640 .if n \{\
641 .RS 4
642 .\}
643 .nf
644 ID_NET_NAME_ONBOARD=eno1
645 ID_NET_NAME_ONBOARD_LABEL=Ethernet Port 1
646 .fi
647 .if n \{\
648 .RE
649 .\}
650 .PP
651 \fBExample\ \&3.\ \&PCI Ethernet card in slot with firmware index number\fR
652 .sp
653 .if n \{\
654 .RS 4
655 .\}
656 .nf
657 # /sys/devices/pci0000:00/0000:00:1c\&.3/0000:05:00\&.0/net/ens1
658 ID_NET_NAME_MAC=enx000000000466
659 ID_NET_NAME_PATH=enp5s0
660 ID_NET_NAME_SLOT=ens1
661 .fi
662 .if n \{\
663 .RE
664 .\}
665 .PP
666 \fBExample\ \&4.\ \&PCI Ethernet multi\-function card with 2 ports\fR
667 .sp
668 .if n \{\
669 .RS 4
670 .\}
671 .nf
672 # /sys/devices/pci0000:00/0000:00:1c\&.0/0000:02:00\&.0/net/enp2s0f0
673 ID_NET_NAME_MAC=enx78e7d1ea46da
674 ID_NET_NAME_PATH=enp2s0f0
675
676 # /sys/devices/pci0000:00/0000:00:1c\&.0/0000:02:00\&.1/net/enp2s0f1
677 ID_NET_NAME_MAC=enx78e7d1ea46dc
678 ID_NET_NAME_PATH=enp2s0f1
679 .fi
680 .if n \{\
681 .RE
682 .\}
683 .PP
684 \fBExample\ \&5.\ \&PCI WLAN card\fR
685 .sp
686 .if n \{\
687 .RS 4
688 .\}
689 .nf
690 # /sys/devices/pci0000:00/0000:00:1c\&.1/0000:03:00\&.0/net/wlp3s0
691 ID_NET_NAME_MAC=wlx0024d7e31130
692 ID_NET_NAME_PATH=wlp3s0
693 .fi
694 .if n \{\
695 .RE
696 .\}
697 .PP
698 \fBExample\ \&6.\ \&PCI IB host adapter with 2 ports\fR
699 .sp
700 .if n \{\
701 .RS 4
702 .\}
703 .nf
704 # /sys/devices/pci0000:00/0000:00:03\&.0/0000:15:00\&.0/net/ibp21s0f0
705 ID_NET_NAME_PATH=ibp21s0f0
706
707 # /sys/devices/pci0000:00/0000:00:03\&.0/0000:15:00\&.1/net/ibp21s0f1
708 ID_NET_NAME_PATH=ibp21s0f1
709 .fi
710 .if n \{\
711 .RE
712 .\}
713 .PP
714 \fBExample\ \&7.\ \&USB built\-in 3G modem\fR
715 .sp
716 .if n \{\
717 .RS 4
718 .\}
719 .nf
720 # /sys/devices/pci0000:00/0000:00:1d\&.0/usb2/2\-1/2\-1\&.4/2\-1\&.4:1\&.6/net/wwp0s29u1u4i6
721 ID_NET_NAME_MAC=wwx028037ec0200
722 ID_NET_NAME_PATH=wwp0s29u1u4i6
723 .fi
724 .if n \{\
725 .RE
726 .\}
727 .PP
728 \fBExample\ \&8.\ \&USB Android phone\fR
729 .sp
730 .if n \{\
731 .RS 4
732 .\}
733 .nf
734 # /sys/devices/pci0000:00/0000:00:1d\&.0/usb2/2\-1/2\-1\&.2/2\-1\&.2:1\&.0/net/enp0s29u1u2
735 ID_NET_NAME_MAC=enxd626b3450fb5
736 ID_NET_NAME_PATH=enp0s29u1u2
737 .fi
738 .if n \{\
739 .RE
740 .\}
741 .PP
742 \fBExample\ \&9.\ \&s390 grouped CCW interface\fR
743 .sp
744 .if n \{\
745 .RS 4
746 .\}
747 .nf
748 # /sys/devices/css0/0\&.0\&.0007/0\&.0\&.f5f0/group_device/net/encf5f0
749 ID_NET_NAME_MAC=enx026d3c00000a
750 ID_NET_NAME_PATH=encf5f0
751 .fi
752 .if n \{\
753 .RE
754 .\}
755 .PP
756 \fBExample\ \&10.\ \&Set an allowlist for reading sysfs attributes for network card naming\fR
757 .sp
758 .if n \{\
759 .RS 4
760 .\}
761 .nf
762 /etc/udev/hwdb\&.d/50\-net\-naming\-allowlist\&.hwdb
763 net:naming:drvirtio_net:*
764 ID_NET_NAME_ALLOW=0
765 ID_NET_NAME_ALLOW_ACPI_INDEX=1
766 ID_NET_NAME_ALLOW_ADDR_ASSIGN_TYPE=1
767 ID_NET_NAME_ALLOW_ADDRESS=1
768 ID_NET_NAME_ALLOW_ARI_ENABLED=1
769 ID_NET_NAME_ALLOW_DEV_PORT=1
770 ID_NET_NAME_ALLOW_FUNCTION_ID=1
771 ID_NET_NAME_ALLOW_IFLINK=1
772 ID_NET_NAME_ALLOW_INDEX=1
773 ID_NET_NAME_ALLOW_LABEL=1
774 ID_NET_NAME_ALLOW_PHYS_PORT_NAME=1
775 ID_NET_NAME_ALLOW_TYPE=1
776 .fi
777 .if n \{\
778 .RE
779 .\}
780 .PP
781 \fBExample\ \&11.\ \&Set a denylist so that specified sysfs attribute are ignored\fR
782 .sp
783 .if n \{\
784 .RS 4
785 .\}
786 .nf
787 /etc/udev/hwdb\&.d/50\-net\-naming\-denylist\&.hwdb
788 net:naming:drvirtio_net:*
789 ID_NET_NAME_ALLOW=1
790 ID_NET_NAME_ALLOW_DEV_PORT=0
791 ID_NET_NAME_ALLOW_PHYS_PORT_NAME=0
792 .fi
793 .if n \{\
794 .RE
795 .\}
796 .SH "SEE ALSO"
797 .PP
798 \fBudev\fR(7), \fBudevadm\fR(8), \fBsystemd-udevd.service\fR(8), \m[blue]\fBPredictable Network Interface Names\fR\m[]\&\s-2\u[1]\d\s+2, \fBsystemd-nspawn\fR(1)
799 .SH "NOTES"
800 .IP " 1." 4
801 Predictable Network Interface Names
802 .RS 4
803 \%https://systemd.io/PREDICTABLE_INTERFACE_NAMES
804 .RE