]>
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> | |
65c2ad98 | 101 | <term><varname>ID_NET_NAME_ONBOARD=<replaceable>prefix</replaceable><constant>d</constant><replaceable>number</replaceable></varname></term> |
0b1e5b6e | 102 | |
e232c307 | 103 | <listitem><para>This name is set based on the numeric ordering information given by the firmware |
8fb35004 ZJS |
104 | for on-board devices. Different schemes are used depending on the firmware type, as described in |
105 | the table below.</para> | |
65c2ad98 SA |
106 | |
107 | <table> | |
8fb35004 | 108 | <title>On-board naming schemes</title> |
65c2ad98 SA |
109 | |
110 | <tgroup cols='2'> | |
111 | <thead> | |
112 | <row> | |
113 | <entry>Format</entry> | |
114 | <entry>Description</entry> | |
115 | </row> | |
116 | </thead> | |
117 | ||
118 | <tbody> | |
119 | <row> | |
120 | <entry><replaceable>prefix</replaceable><constant>o</constant><replaceable>number</replaceable></entry> | |
8fb35004 | 121 | <entry>PCI on-board index</entry> |
65c2ad98 SA |
122 | </row> |
123 | ||
124 | <row> | |
125 | <entry><replaceable>prefix</replaceable><constant>d</constant><replaceable>number</replaceable></entry> | |
126 | <entry>Devicetree alias index</entry> | |
127 | </row> | |
128 | ||
129 | </tbody> | |
130 | </tgroup> | |
131 | </table> | |
0b1e5b6e ZJS |
132 | </listitem> |
133 | </varlistentry> | |
134 | ||
135 | <varlistentry> | |
136 | <term><varname>ID_NET_LABEL_ONBOARD=<replaceable>prefix</replaceable> <replaceable>label</replaceable></varname></term> | |
137 | ||
e232c307 LP |
138 | <listitem><para>This property is set based on textual label given by the firmware for on-board |
139 | devices. The name consists of the prefix concatenated with the label. This is only available for | |
140 | PCI devices. | |
0b1e5b6e ZJS |
141 | </para> |
142 | </listitem> | |
143 | </varlistentry> | |
144 | ||
145 | <varlistentry> | |
146 | <term><varname>ID_NET_NAME_MAC=<replaceable>prefix</replaceable><constant>x</constant><replaceable>AABBCCDDEEFF</replaceable></varname></term> | |
147 | ||
148 | <listitem><para>This name consists of the prefix, letter <constant>x</constant>, and 12 hexadecimal | |
149 | digits of the MAC address. It is available if the device has a fixed MAC address. Because this name | |
150 | is based on an attribute of the card itself, it remains "stable" when the device is moved (even | |
151 | between machines), but will change when the hardware is replaced.</para> | |
152 | </listitem> | |
153 | </varlistentry> | |
154 | ||
155 | <varlistentry> | |
156 | <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 | 157 | <term><varname>ID_NET_NAME_SLOT=<replaceable>prefix</replaceable><constant>v</constant><replaceable>slot</replaceable></varname></term> |
d6eda677 | 158 | <term><varname>ID_NET_NAME_SLOT=<replaceable>prefix</replaceable><constant>x</constant><replaceable>slot</replaceable></varname></term> |
0b1e5b6e ZJS |
159 | <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> |
160 | <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> | |
161 | <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> | |
162 | ||
163 | <listitem><para>This property describes the slot position. Different schemes are used depending on | |
a1686563 LP |
164 | the bus type, as described in the table below. In case of USB, BCMA, and SR-VIO devices, the full |
165 | name consists of the prefix, PCI slot identifier, and USB or BCMA or SR-VIO slot identifier. The | |
166 | first two parts are denoted as "…" in the table below.</para> | |
0b1e5b6e ZJS |
167 | |
168 | <table> | |
169 | <title>Slot naming schemes</title> | |
170 | ||
171 | <tgroup cols='2'> | |
172 | <thead> | |
173 | <row> | |
174 | <entry>Format</entry> | |
175 | <entry>Description</entry> | |
176 | </row> | |
177 | </thead> | |
178 | ||
179 | <tbody> | |
180 | <row> | |
181 | <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> | |
182 | <entry>PCI slot number</entry> | |
183 | </row> | |
184 | ||
a1686563 LP |
185 | <row> |
186 | <entry><replaceable>prefix</replaceable> <constant>v</constant><replaceable>slot</replaceable></entry> | |
187 | <entry>VIO slot number (IBM PowerVM)</entry> | |
188 | </row> | |
189 | ||
d6eda677 BH |
190 | <row> |
191 | <entry><replaceable>prefix</replaceable> <constant>X</constant><replaceable>number</replaceable></entry> | |
192 | <entry>VIF interface number (Xen)</entry> | |
193 | </row> | |
194 | ||
0b1e5b6e ZJS |
195 | <row> |
196 | <entry>… <constant>b</constant><replaceable>number</replaceable></entry> | |
197 | <entry>Broadcom bus (BCMA) core number</entry> | |
198 | </row> | |
199 | ||
200 | <row> | |
201 | <entry>… <constant>u</constant><replaceable>port</replaceable>… [<constant>c</constant><replaceable>config</replaceable>] [<constant>i</constant><replaceable>interface</replaceable>]</entry> | |
202 | <entry>USB port number chain</entry> | |
203 | </row> | |
204 | ||
205 | <row> | |
206 | <entry>… <constant>v</constant><replaceable>slot</replaceable></entry> | |
207 | <entry>SR-VIO slot number</entry> | |
208 | </row> | |
209 | </tbody> | |
210 | </tgroup> | |
211 | </table> | |
212 | ||
213 | <para>The PCI domain is only prepended when it is not 0. All multi-function PCI devices will carry | |
214 | the <constant>f<replaceable>function</replaceable></constant> number in the device name, including | |
215 | the function 0 device. For non-multi-function devices, the number is suppressed if 0. The port name | |
216 | <replaceable>port_name</replaceable> is used, or the port number | |
217 | <constant>d</constant><replaceable>dev_port</replaceable> if the name is not known.</para> | |
218 | ||
219 | <para>For BCMA devices, the core number is suppressed when 0.</para> | |
220 | ||
221 | <para>For USB devices the full chain of port numbers of hubs is composed. If the name gets longer | |
222 | than the maximum number of 15 characters, the name is not exported. The usual USB configuration | |
223 | number 1 and interface number 0 values are suppressed.</para> | |
0b1e5b6e ZJS |
224 | |
225 | <para>SR-IOV virtual devices are named based on the name of the parent interface, with a suffix of | |
226 | <constant>v</constant> and the virtual device number, with any leading zeros removed. The bus | |
a1686563 | 227 | number is ignored.</para> |
2c8ec009 MS |
228 | |
229 | <para>In some configurations a parent PCI bridge of a given network controller may be associated | |
230 | with a slot. In such case we don't generate this device property to avoid possible naming conflicts.</para> | |
a1686563 | 231 | </listitem> |
0b1e5b6e ZJS |
232 | </varlistentry> |
233 | ||
234 | <varlistentry> | |
235 | <term><varname>ID_NET_NAME_PATH=<replaceable>prefix</replaceable><constant>c</constant><replaceable>bus_id</replaceable></varname></term> | |
236 | <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> | |
237 | <term><varname>ID_NET_NAME_PATH=<replaceable>prefix</replaceable><constant>i</constant><replaceable>address</replaceable><constant>n</constant><replaceable>port_name</replaceable></varname></term> | |
a0961675 | 238 | <term><varname>ID_NET_NAME_PATH=<replaceable>prefix</replaceable><constant>u</constant><replaceable>port</replaceable>…</varname></term> |
0b1e5b6e ZJS |
239 | <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> |
240 | <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> | |
241 | <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> | |
242 | ||
243 | <listitem><para>This property describes the device installation location. Different schemes are | |
244 | used depending on the bus type, as described in the table below. For BCMA and USB devices, PCI path | |
245 | information must known, and the full name consists of the prefix, PCI slot identifier, and USB or | |
246 | BCMA location. The first two parts are denoted as "…" in the table below.</para> | |
247 | ||
248 | <table> | |
249 | <title>Path naming schemes</title> | |
250 | ||
251 | <tgroup cols='2'> | |
252 | <thead> | |
253 | <row> | |
254 | <entry>Format</entry> | |
255 | <entry>Description</entry> | |
256 | </row> | |
257 | </thead> | |
258 | ||
259 | <tbody> | |
260 | <row> | |
261 | <entry><replaceable>prefix</replaceable> <constant>c</constant><replaceable>bus_id</replaceable></entry> | |
262 | <entry>CCW or grouped CCW device identifier</entry> | |
263 | </row> | |
264 | ||
265 | <row> | |
266 | <entry><replaceable>prefix</replaceable> <constant>a</constant><replaceable>vendor</replaceable> <replaceable>model</replaceable> <constant>i</constant><replaceable>instance</replaceable></entry> | |
267 | <entry>ACPI path names for ARM64 platform devices</entry> | |
268 | </row> | |
269 | ||
270 | <row> | |
271 | <entry><replaceable>prefix</replaceable> <constant>i</constant><replaceable>address</replaceable> <constant>n</constant><replaceable>port_name</replaceable></entry> | |
272 | <entry>Netdevsim (simulated networking device) device number and port name</entry> | |
273 | </row> | |
274 | ||
275 | <row> | |
276 | <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> | |
277 | <entry>PCI geographical location</entry> | |
278 | </row> | |
279 | ||
280 | <row> | |
281 | <entry>… <constant>b</constant><replaceable>number</replaceable></entry> | |
282 | <entry>Broadcom bus (BCMA) core number</entry> | |
283 | </row> | |
284 | ||
285 | <row> | |
286 | <entry>… <constant>u</constant><replaceable>port</replaceable>… [<constant>c</constant><replaceable>config</replaceable>] [<constant>i</constant><replaceable>interface</replaceable>]</entry> | |
287 | <entry>USB port number chain</entry> | |
288 | </row> | |
289 | ||
290 | </tbody> | |
291 | </tgroup> | |
292 | </table> | |
293 | ||
294 | <para>CCW and grouped CCW devices are found in IBM System Z mainframes. Any leading zeros and | |
295 | dots are suppressed.</para> | |
296 | ||
297 | <para>For PCI, BCMA, and USB devices, the same rules as described above for slot naming are | |
298 | used.</para> | |
299 | </listitem> | |
300 | </varlistentry> | |
301 | </variablelist> | |
302 | </refsect1> | |
303 | ||
304 | <refsect1> | |
305 | <title>History</title> | |
306 | ||
66ad93e8 | 307 | <para>The following "naming schemes" have been defined (which may be chosen at system boot-up time via |
75909cc7 | 308 | the <varname>net.naming-scheme=</varname> kernel command line switch, see above):</para> |
0b1e5b6e ZJS |
309 | |
310 | <variablelist> | |
311 | <varlistentry> | |
312 | <term><constant>v238</constant></term> | |
313 | ||
955ed5d5 | 314 | <listitem><para>This is the naming scheme that was implemented in systemd 238.</para></listitem> |
0b1e5b6e ZJS |
315 | </varlistentry> |
316 | ||
317 | <varlistentry> | |
318 | <term><constant>v239</constant></term> | |
319 | ||
320 | <listitem><para>Naming was changed for virtual network interfaces created with SR-IOV and NPAR and | |
321 | for devices where the PCI network controller device does not have a slot number associated.</para> | |
322 | ||
323 | <para>SR-IOV virtual devices are named based on the name of the parent interface, with a suffix of | |
324 | <literal>v<replaceable>port</replaceable></literal>, where <replaceable>port</replaceable> is the | |
325 | virtual device number. Previously those virtual devices were named as if completely independent. | |
326 | </para> | |
327 | ||
328 | <para>The ninth and later NPAR virtual devices are named following the scheme used for the first | |
329 | eight NPAR partitions. Previously those devices were not renamed and the kernel default | |
330 | ("eth<replaceable>N</replaceable>") was used.</para> | |
331 | ||
332 | <para>Names are also generated for PCI devices where the PCI network controller device does not | |
333 | have an associated slot number itself, but one of its parents does. Previously those devices were | |
334 | not renamed and the kernel default was used.</para> | |
335 | </listitem> | |
336 | </varlistentry> | |
337 | ||
338 | <varlistentry> | |
339 | <term><constant>v240</constant></term> | |
340 | ||
2ebe027b | 341 | <listitem><para>The <literal>ib</literal> prefix and stable names for infiniband devices are |
0b1e5b6e ZJS |
342 | introduced. Previously those devices were not renamed.</para> |
343 | ||
344 | <para>The ACPI index field (used in <varname>ID_NET_NAME_ONBOARD=</varname>) is now also used when | |
345 | 0.</para> | |
346 | ||
347 | <para>A new naming policy <varname>NamePolicy=keep</varname> was introduced. With this policy, if | |
348 | the network device name was already set by userspace, the device will not be renamed | |
349 | again. Previously, this naming policy applied implicitly, and now it must be explicitly | |
350 | requested. Effectively, this means that network devices will be renamed according to the | |
351 | configuration, even if they have been renamed already, if <constant>keep</constant> is not | |
b0343f8c | 352 | specified as the naming policy in the <filename index="false">.link</filename> file. See |
0b1e5b6e | 353 | <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
2ebe027b | 354 | for a description of <varname>NamePolicy=</varname>.</para></listitem> |
0b1e5b6e ZJS |
355 | </varlistentry> |
356 | ||
96848152 ZJS |
357 | <varlistentry> |
358 | <term><constant>v241</constant></term> | |
359 | ||
360 | <listitem><para><option>MACAddressPolicy=persistent</option> was extended to set MAC addresses | |
361 | based on the device name. Previously addresses were only based on the | |
b0343f8c | 362 | <varname index="false">ID_NET_NAME_*</varname> attributes, which meant that interface names would |
96848152 ZJS |
363 | never be generated for virtual devices. Now a persistent address will be generated for most |
364 | devices, including in particular bridges.</para> | |
365 | ||
366 | <para>Note: when userspace does not set a MAC address for a bridge device, the kernel will | |
367 | initially assign a random address, and then change it when the first device is enslaved to the | |
368 | bridge. With this naming policy change, bridges get a persistent MAC address based on the bridge | |
369 | name instead of the first enslaved device.</para></listitem> | |
370 | </varlistentry> | |
371 | ||
0b1e5b6e ZJS |
372 | <varlistentry> |
373 | <term><constant>v243</constant></term> | |
374 | ||
2ebe027b ZJS |
375 | <listitem><para>Support for renaming netdevsim (simulated networking) devices was added. Previously |
376 | those devices were not renamed.</para> | |
8c053c83 ZJS |
377 | |
378 | <para>Previously two-letter interface type prefix was prepended to | |
2ebe027b | 379 | <varname>ID_NET_LABEL_ONBOARD=</varname>. This is not done anymore.</para></listitem> |
0b1e5b6e | 380 | </varlistentry> |
bc5ea049 KK |
381 | |
382 | <varlistentry> | |
383 | <term><constant>v245</constant></term> | |
384 | ||
385 | <listitem><para>When | |
386 | <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
387 | derives the name for the host side of the network interface created with | |
388 | <option>--network-veth</option> from the container name it previously simply truncated the result | |
389 | at 15 characters if longer (since that's the maximum length for network interface names). From now | |
390 | on, for any interface name that would be longer than 15 characters the last 4 characters are set to | |
391 | a 24bit hash value of the full interface name. This way network interface name collisions between | |
392 | multiple similarly named containers (who only differ in container name suffix) should be less | |
393 | likely (but still possible, since the 24bit hash value is very small).</para></listitem> | |
394 | </varlistentry> | |
2c8ec009 MS |
395 | |
396 | <varlistentry> | |
66ad93e8 | 397 | <term><constant>v247</constant></term> |
2c8ec009 | 398 | |
75909cc7 ZJS |
399 | <listitem><para>When a PCI slot is associated with a PCI bridge that has multiple child network |
400 | controllers, the same value of the <varname>ID_NET_NAME_SLOT</varname> property might be derived | |
401 | for those controllers. This would cause a naming conflict if the property is selected as the device | |
402 | name. Now, we detect this situation and don't produce the <varname>ID_NET_NAME_SLOT</varname> | |
403 | property.</para></listitem> | |
2c8ec009 MS |
404 | </varlistentry> |
405 | ||
a496a238 VM |
406 | <varlistentry> |
407 | <term><constant>v249</constant></term> | |
408 | ||
409 | <listitem><para>PCI hotplug slot names for the s390 PCI driver are a hexadecimal representation | |
410 | of the <filename>function_id</filename> device attribute. This attribute is now used to build the | |
411 | <varname>ID_NET_NAME_SLOT</varname>. Before that, all slot names were parsed as decimal | |
412 | numbers, which could either result in an incorrect value of the <varname>ID_NET_NAME_SLOT</varname> | |
5a7eb46c VM |
413 | property or none at all.</para> |
414 | ||
8fb35004 ZJS |
415 | <para>Some firmware and hypervisor implementations report unreasonably high numbers for the |
416 | on-board index. To prevent the generation of bogus onbard interface names, index numbers greater | |
417 | than 16381 (2¹⁴-1) were ignored. For s390 PCI devices index values up to 65535 (2¹⁶-1) are valid. | |
418 | To account for that, the limit was increased to 65535.</para> | |
c8de9b0e YW |
419 | |
420 | <para>The udev rule <varname>NAME=</varname> replaces <literal>:</literal>, | |
421 | <literal>/</literal>, and <literal>%</literal> with an underscore (<literal>_</literal>), and | |
422 | refuses strings which contain only numerics.</para> | |
423 | </listitem> | |
a496a238 VM |
424 | </varlistentry> |
425 | ||
d6eda677 BH |
426 | <varlistentry> |
427 | <term><constant>v250</constant></term> | |
428 | ||
429 | <listitem><para>Added naming scheme for Xen netfront "vif" interfaces based on the guest side | |
430 | VIF number set from the Xen config (or the interface index in AWS EC2).</para> | |
431 | </listitem> | |
432 | </varlistentry> | |
433 | ||
66425daf MS |
434 | <varlistentry> |
435 | <term><constant>v251</constant></term> | |
436 | ||
437 | <listitem><para>Since version <constant>v247</constant> we no longer set | |
438 | <varname>ID_NET_NAME_SLOT</varname> if we detect that a PCI device associated with a slot is a PCI | |
439 | bridge as that would create naming conflict when there are more child devices on that bridge. Now, | |
440 | this is relaxed and we will use slot information to generate the name based on it but only if | |
441 | the PCI device has multiple functions. This is safe because distinct function number is a part of | |
442 | the device name for multifunction devices.</para> | |
443 | </listitem> | |
444 | </varlistentry> | |
445 | ||
65c2ad98 SA |
446 | <varlistentry> |
447 | <term><constant>v252</constant></term> | |
448 | ||
449 | <listitem><para>Added naming scheme for platform devices with devicetree aliases.</para> | |
450 | </listitem> | |
451 | </varlistentry> | |
452 | ||
a0961675 CH |
453 | <varlistentry> |
454 | <term><constant>v253</constant></term> | |
455 | ||
456 | <listitem><para>Set <varname>ID_NET_NAME_PATH</varname> for usb devices not connected via a PCI bus.</para> | |
457 | </listitem> | |
458 | </varlistentry> | |
459 | ||
bc5ea049 | 460 | </variablelist> |
2ebe027b ZJS |
461 | |
462 | <para>Note that <constant>latest</constant> may be used to denote the latest scheme known (to this | |
e9dd6984 | 463 | particular version of systemd).</para> |
0b1e5b6e ZJS |
464 | </refsect1> |
465 | ||
466 | <refsect1> | |
467 | <title>Examples</title> | |
468 | ||
469 | <example> | |
470 | <title>Using <command>udevadm test-builtin</command> to display device properties</title> | |
471 | ||
472 | <programlisting>$ udevadm test-builtin net_id /sys/class/net/enp0s31f6 | |
473 | ... | |
474 | Using default interface naming scheme 'v243'. | |
475 | ID_NET_NAMING_SCHEME=v243 | |
476 | ID_NET_NAME_MAC=enx54ee75cb1dc0 | |
477 | ID_OUI_FROM_DATABASE=Wistron InfoComm(Kunshan)Co.,Ltd. | |
478 | ID_NET_NAME_PATH=enp0s31f6 | |
479 | ...</programlisting> | |
480 | </example> | |
481 | ||
482 | <example> | |
483 | <title>PCI Ethernet card with firmware index "1"</title> | |
484 | ||
485 | <programlisting>ID_NET_NAME_ONBOARD=eno1 | |
8c053c83 | 486 | ID_NET_NAME_ONBOARD_LABEL=Ethernet Port 1 |
0b1e5b6e | 487 | </programlisting> |
0b1e5b6e ZJS |
488 | </example> |
489 | ||
490 | <example> | |
491 | <title>PCI Ethernet card in hotplug slot with firmware index number</title> | |
492 | ||
493 | <programlisting># /sys/devices/pci0000:00/0000:00:1c.3/0000:05:00.0/net/ens1 | |
494 | ID_NET_NAME_MAC=enx000000000466 | |
495 | ID_NET_NAME_PATH=enp5s0 | |
496 | ID_NET_NAME_SLOT=ens1</programlisting> | |
497 | </example> | |
498 | ||
499 | <example> | |
500 | <title>PCI Ethernet multi-function card with 2 ports</title> | |
501 | ||
502 | <programlisting># /sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0/net/enp2s0f0 | |
503 | ID_NET_NAME_MAC=enx78e7d1ea46da | |
504 | ID_NET_NAME_PATH=enp2s0f0 | |
505 | ||
506 | # /sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.1/net/enp2s0f1 | |
507 | ID_NET_NAME_MAC=enx78e7d1ea46dc | |
508 | ID_NET_NAME_PATH=enp2s0f1</programlisting> | |
509 | </example> | |
510 | ||
511 | <example> | |
512 | <title>PCI WLAN card</title> | |
513 | ||
514 | <programlisting># /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/net/wlp3s0 | |
515 | ID_NET_NAME_MAC=wlx0024d7e31130 | |
516 | ID_NET_NAME_PATH=wlp3s0</programlisting> | |
517 | </example> | |
518 | ||
519 | <example> | |
520 | <title>PCI IB host adapter with 2 ports</title> | |
521 | ||
522 | <programlisting># /sys/devices/pci0000:00/0000:00:03.0/0000:15:00.0/net/ibp21s0f0 | |
523 | ID_NET_NAME_PATH=ibp21s0f0 | |
524 | ||
525 | # /sys/devices/pci0000:00/0000:00:03.0/0000:15:00.1/net/ibp21s0f1 | |
526 | ID_NET_NAME_PATH=ibp21s0f1</programlisting> | |
527 | </example> | |
528 | ||
529 | <example> | |
530 | <title>USB built-in 3G modem</title> | |
531 | ||
532 | <programlisting># /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.6/net/wwp0s29u1u4i6 | |
533 | ID_NET_NAME_MAC=wwx028037ec0200 | |
534 | ID_NET_NAME_PATH=wwp0s29u1u4i6</programlisting> | |
535 | </example> | |
536 | ||
537 | <example> | |
538 | <title>USB Android phone</title> | |
539 | ||
540 | <programlisting># /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/net/enp0s29u1u2 | |
541 | ID_NET_NAME_MAC=enxd626b3450fb5 | |
542 | ID_NET_NAME_PATH=enp0s29u1u2</programlisting> | |
543 | </example> | |
544 | ||
545 | <example> | |
546 | <title>s390 grouped CCW interface</title> | |
547 | ||
548 | <programlisting># /sys/devices/css0/0.0.0007/0.0.f5f0/group_device/net/encf5f0 | |
549 | ID_NET_NAME_MAC=enx026d3c00000a | |
550 | ID_NET_NAME_PATH=encf5f0</programlisting> | |
551 | </example> | |
552 | </refsect1> | |
553 | ||
554 | <refsect1> | |
555 | <title>See Also</title> | |
556 | <para> | |
557 | <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>, | |
558 | <citerefentry><refentrytitle>udevadm</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
bc5ea049 KK |
559 | <ulink url="https://systemd.io/PREDICTABLE_INTERFACE_NAMES">Predictable Network Interface Names</ulink>, |
560 | <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
0b1e5b6e ZJS |
561 | </para> |
562 | </refsect1> | |
563 | ||
564 | </refentry> |