1SYSTEMD.NET-NAMING-SCHEME(7)systemd.net-naming-schemSeYSTEMD.NET-NAMING-SCHEME(7)
2
3
4

NAME

6       systemd.net-naming-scheme - Network device naming schemes
7

DESCRIPTION

9       Network interfaces names and MAC addresses may be generated based on
10       certain stable interface attributes. This is possible when there is
11       enough information about the device to generate those attributes and
12       the use of this information is configured. This page describes
13       interface naming, i.e. what possible names may be generated. Those
14       names are generated by the systemd-udevd.service(8) builtin net_id and
15       exported as udev properties (ID_NET_NAME_ONBOARD=,
16       ID_NET_LABEL_ONBOARD=, ID_NET_NAME_PATH=, ID_NET_NAME_SLOT=).
17
18       Names and MAC addresses are derived from various stable device metadata
19       attributes. Newer versions of udev take more of these attributes into
20       account, improving (and thus possibly changing) the names and addresses
21       used for the same devices. Different versions of those generation rules
22       are called "naming schemes". The default naming scheme is chosen at
23       compilation time. Usually this will be the latest implemented version,
24       but it is also possible to set one of the older versions to preserve
25       compatibility. This may be useful for example for distributions, which
26       may introduce new versions of systemd in stable releases without
27       changing the naming scheme. The naming scheme may also be overridden
28       using the net.naming-scheme= kernel command line switch, see systemd-
29       udevd.service(8). Available naming schemes are described below.
30
31       After the udev properties have been generated, appropriate udev rules
32       may be used to actually rename devices based on those properties. See
33       the description of NamePolicy= and MACAddressPolicy= in
34       systemd.link(5).
35

NAMING

37       All names start with a two-character prefix that signifies the
38       interface type.
39
40       Table 1. Two character prefixes based on the type of interface
41       ┌───────┬────────────────────────────┐
42Prefix Description                
43       ├───────┼────────────────────────────┤
44en     │ Ethernet                   │
45       ├───────┼────────────────────────────┤
46ib     │ InfiniBand                 │
47       ├───────┼────────────────────────────┤
48sl     │ serial line IP (slip)      │
49       ├───────┼────────────────────────────┤
50wl     │ Wireless local area        │
51       │       │ network (WLAN)             │
52       ├───────┼────────────────────────────┤
53ww     │ Wireless wide area network │
54       │       │ (WWAN)                     │
55       └───────┴────────────────────────────┘
56
57       The udev net_id builtin exports the following udev device properties:
58
59       ID_NET_NAME_ONBOARD=prefixonumber
60           This name is set based on the ordering information given by the
61           firmware for on-board devices. The name consists of the prefix,
62           letter o, and a number specified by the firmware. This is only
63           available for PCI devices.
64
65       ID_NET_LABEL_ONBOARD=prefix label
66           This property is set based on label given by the firmware for
67           on-board devices. The name consists of the prefix concatenated with
68           the label. This is only available for PCI devices.
69
70       ID_NET_NAME_MAC=prefixxAABBCCDDEEFF
71           This name consists of the prefix, letter x, and 12 hexadecimal
72           digits of the MAC address. It is available if the device has a
73           fixed MAC address. Because this name is based on an attribute of
74           the card itself, it remains "stable" when the device is moved (even
75           between machines), but will change when the hardware is replaced.
76
77       ID_NET_NAME_SLOT=prefix[Pdomain]sslot[ffunction][nport_name|ddev_port],
78       ID_NET_NAME_SLOT=prefix[Pdomain]sslot[ffunction][nport_name|ddev_port]bnumber,
79       ID_NET_NAME_SLOT=prefix[Pdomain]sslot[ffunction][nport_name|ddev_port]uport...[cconfig][iinterface],
80       ID_NET_NAME_SLOT=prefix[Pdomain]sslot[ffunction][nport_name|ddev_port]vslot
81           This property describes the slot position. Different schemes are
82           used depending on the bus type, as described in the table below. In
83           all cases, PCI slot information must be known. In case of USB,
84           BCMA, and SR-VIO devices, the full name consists of the prefix, PCI
85           slot identifier, and USB or BCMA or SR-VIO slot identifier. The
86           first two parts are denoted as "..." in the table below.
87
88           Table 2. Slot naming schemes
89           ┌────────────────────────────────────────────────────────────┬──────────────────────────┐
90Format                                                      Description              
91           ├────────────────────────────────────────────────────────────┼──────────────────────────┤
92prefix [Pdomain] sslot [ffunction] [nport_name | ddev_port] │ PCI slot number          │
93           ├────────────────────────────────────────────────────────────┼──────────────────────────┤
94           │... bnumber                                                 │ Broadcom bus (BCMA) core │
95           │                                                            │ number                   │
96           ├────────────────────────────────────────────────────────────┼──────────────────────────┤
97           │... uport... [cconfig] [iinterface]                         │ USB port number chain    │
98           ├────────────────────────────────────────────────────────────┼──────────────────────────┤
99           │... vslot                                                   │ SR-VIO slot number       │
100           └────────────────────────────────────────────────────────────┴──────────────────────────┘
101           The PCI domain is only prepended when it is not 0. All
102           multi-function PCI devices will carry the ffunction number in the
103           device name, including the function 0 device. For
104           non-multi-function devices, the number is suppressed if 0. The port
105           name port_name is used, or the port number ddev_port if the name is
106           not known.
107
108           For BCMA devices, the core number is suppressed when 0.
109
110           For USB devices the full chain of port numbers of hubs is composed.
111           If the name gets longer than the maximum number of 15 characters,
112           the name is not exported. The usual USB configuration number 1 and
113           interface number 0 values are suppressed.
114
115           SR-IOV virtual devices are named based on the name of the parent
116           interface, with a suffix of v and the virtual device number, with
117           any leading zeros removed. The bus number is ignored. This device
118           type is found in IBM PowerVMs.
119
120       ID_NET_NAME_PATH=prefixcbus_id,
121       ID_NET_NAME_PATH=prefixavendormodeliinstance,
122       ID_NET_NAME_PATH=prefixiaddressnport_name,
123       ID_NET_NAME_PATH=prefix[Pdomain]pbussslot[ffunction][nphys_port_name|ddev_port],
124       ID_NET_NAME_PATH=prefix[Pdomain]pbussslot[ffunction][nphys_port_name|ddev_port]bnumber,
125       ID_NET_NAME_PATH=prefix[Pdomain]pbussslot[ffunction][nphys_port_name|ddev_port]uport...[cconfig][iinterface]
126           This property describes the device installation location. Different
127           schemes are used depending on the bus type, as described in the
128           table below. For BCMA and USB devices, PCI path information must
129           known, and the full name consists of the prefix, PCI slot
130           identifier, and USB or BCMA location. The first two parts are
131           denoted as "..." in the table below.
132
133           Table 3. Path naming schemes
134           ┌──────────────────────────────────────────────────────────────────────┬───────────────────────────┐
135Format                                                                Description               
136           ├──────────────────────────────────────────────────────────────────────┼───────────────────────────┤
137prefix cbus_id                                                        │ CCW or grouped CCW device │
138           │                                                                      │ identifier                │
139           ├──────────────────────────────────────────────────────────────────────┼───────────────────────────┤
140prefix avendor model iinstance                                        │ ACPI path names for ARM64 │
141           │                                                                      │ platform devices          │
142           ├──────────────────────────────────────────────────────────────────────┼───────────────────────────┤
143prefix iaddress nport_name                                            │ Netdevsim (simulated      │
144           │                                                                      │ networking device) device │
145           │                                                                      │ number and port name      │
146           ├──────────────────────────────────────────────────────────────────────┼───────────────────────────┤
147prefix [Pdomain] pbus sslot [ffunction] [nphys_port_name | ddev_port] │ PCI geographical location │
148           ├──────────────────────────────────────────────────────────────────────┼───────────────────────────┤
149           │... bnumber                                                           │ Broadcom bus (BCMA) core  │
150           │                                                                      │ number                    │
151           ├──────────────────────────────────────────────────────────────────────┼───────────────────────────┤
152           │... uport... [cconfig] [iinterface]                                   │ USB port number chain     │
153           └──────────────────────────────────────────────────────────────────────┴───────────────────────────┘
154           CCW and grouped CCW devices are found in IBM System Z mainframes.
155           Any leading zeros and dots are suppressed.
156
157           For PCI, BCMA, and USB devices, the same rules as described above
158           for slot naming are used.
159

HISTORY

161       The following "naming schemes" have been defined:
162
163       v238
164           This is the naming scheme that was implemented in systemd 238.
165
166       v239
167           Naming was changed for virtual network interfaces created with
168           SR-IOV and NPAR and for devices where the PCI network controller
169           device does not have a slot number associated.
170
171           SR-IOV virtual devices are named based on the name of the parent
172           interface, with a suffix of "vport", where port is the virtual
173           device number. Previously those virtual devices were named as if
174           completely independent.
175
176           The ninth and later NPAR virtual devices are named following the
177           scheme used for the first eight NPAR partitions. Previously those
178           devices were not renamed and the kernel default ("ethN") was used.
179
180           Names are also generated for PCI devices where the PCI network
181           controller device does not have an associated slot number itself,
182           but one of its parents does. Previously those devices were not
183           renamed and the kernel default was used.
184
185       v240
186           The "ib" prefix and stable names for infiniband devices are
187           introduced. Previously those devices were not renamed.
188
189           The ACPI index field (used in ID_NET_NAME_ONBOARD=) is now also
190           used when 0.
191
192           A new naming policy NamePolicy=keep was introduced. With this
193           policy, if the network device name was already set by userspace,
194           the device will not be renamed again. Previously, this naming
195           policy applied implicitly, and now it must be explicitly requested.
196           Effectively, this means that network devices will be renamed
197           according to the configuration, even if they have been renamed
198           already, if keep is not specified as the naming policy in the .link
199           file. See systemd.link(5) for a description of NamePolicy=.
200
201       v241
202           MACAddressPolicy=persistent was extended to set MAC addresses based
203           on the device name. Previously addresses were only based on the
204           ID_NET_NAME_* attributes, which meant that interface names would
205           never be generated for virtual devices. Now a persistent address
206           will be generated for most devices, including in particular
207           bridges.
208
209           Note: when userspace does not set a MAC address for a bridge
210           device, the kernel will initially assign a random address, and then
211           change it when the first device is enslaved to the bridge. With
212           this naming policy change, bridges get a persistent MAC address
213           based on the bridge name instead of the first enslaved device.
214
215       v243
216           Support for renaming netdevsim (simulated networking) devices was
217           added. Previously those devices were not renamed.
218
219           Previously two-letter interface type prefix was prepended to
220           ID_NET_LABEL_ONBOARD=. This is not done anymore.
221
222       Note that latest may be used to denote the latest scheme known (to this
223       particular version of systemd.
224

EXAMPLES

226       Example 1. Using udevadm test-builtin to display device properties
227
228           $ udevadm test-builtin net_id /sys/class/net/enp0s31f6
229           ...
230           Using default interface naming scheme 'v243'.
231           ID_NET_NAMING_SCHEME=v243
232           ID_NET_NAME_MAC=enx54ee75cb1dc0
233           ID_OUI_FROM_DATABASE=Wistron InfoComm(Kunshan)Co.,Ltd.
234           ID_NET_NAME_PATH=enp0s31f6
235           ...
236
237       Example 2. PCI Ethernet card with firmware index "1"
238
239           ID_NET_NAME_ONBOARD=eno1
240           ID_NET_NAME_ONBOARD_LABEL=Ethernet Port 1
241
242
243       Example 3. PCI Ethernet card in hotplug slot with firmware index number
244
245           # /sys/devices/pci0000:00/0000:00:1c.3/0000:05:00.0/net/ens1
246           ID_NET_NAME_MAC=enx000000000466
247           ID_NET_NAME_PATH=enp5s0
248           ID_NET_NAME_SLOT=ens1
249
250       Example 4. PCI Ethernet multi-function card with 2 ports
251
252           # /sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0/net/enp2s0f0
253           ID_NET_NAME_MAC=enx78e7d1ea46da
254           ID_NET_NAME_PATH=enp2s0f0
255
256           # /sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.1/net/enp2s0f1
257           ID_NET_NAME_MAC=enx78e7d1ea46dc
258           ID_NET_NAME_PATH=enp2s0f1
259
260       Example 5. PCI WLAN card
261
262           # /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/net/wlp3s0
263           ID_NET_NAME_MAC=wlx0024d7e31130
264           ID_NET_NAME_PATH=wlp3s0
265
266       Example 6. PCI IB host adapter with 2 ports
267
268           # /sys/devices/pci0000:00/0000:00:03.0/0000:15:00.0/net/ibp21s0f0
269           ID_NET_NAME_PATH=ibp21s0f0
270
271           # /sys/devices/pci0000:00/0000:00:03.0/0000:15:00.1/net/ibp21s0f1
272           ID_NET_NAME_PATH=ibp21s0f1
273
274       Example 7. USB built-in 3G modem
275
276           # /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.6/net/wwp0s29u1u4i6
277           ID_NET_NAME_MAC=wwx028037ec0200
278           ID_NET_NAME_PATH=wwp0s29u1u4i6
279
280       Example 8. USB Android phone
281
282           # /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/net/enp0s29u1u2
283           ID_NET_NAME_MAC=enxd626b3450fb5
284           ID_NET_NAME_PATH=enp0s29u1u2
285
286       Example 9. s390 grouped CCW interface
287
288           # /sys/devices/css0/0.0.0007/0.0.f5f0/group_device/net/encf5f0
289           ID_NET_NAME_MAC=enx026d3c00000a
290           ID_NET_NAME_PATH=encf5f0
291

SEE ALSO

293       udev(7), udevadm(8), the original page describing stable interface
294       names[1]
295

NOTES

297        1. the original page describing stable interface names
298           https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames
299
300
301
302systemd 243                                       SYSTEMD.NET-NAMING-SCHEME(7)
Impressum