1SYSTEMD.LINK(5) systemd.link SYSTEMD.LINK(5)
2
3
4
6 systemd.link - Network device configuration
7
9 link.link
10
12 A plain ini-style text file that encodes configuration for matching
13 network devices, used by systemd-udevd(8) and in particular its
14 net_setup_link builtin. See systemd.syntax(7) for a general description
15 of the syntax.
16
17 The .link files are read from the files located in the system network
18 directory /usr/lib/systemd/network and /usr/local/lib/systemd/network,
19 the volatile runtime network directory /run/systemd/network, and the
20 local administration network directory /etc/systemd/network. All
21 configuration files are collectively sorted and processed in
22 alphanumeric order, regardless of the directories in which they live.
23 However, files with identical filenames replace each other. It is
24 recommended that each filename is prefixed with a number (e.g.
25 10-eth0.link). Otherwise, the default .link files or those generated by
26 systemd-network-generator.service(8) may take precedence over user
27 configured files. Files in /etc/ have the highest priority, files in
28 /run/ take precedence over files with the same name in /usr/lib/. This
29 can be used to override a system-supplied link file with a local file
30 if needed. As a special case, an empty file (file size 0) or symlink
31 with the same name pointing to /dev/null disables the configuration
32 file entirely (it is "masked").
33
34 Along with the link file foo.link, a "drop-in" directory foo.link.d/
35 may exist. All files with the suffix ".conf" from this directory will
36 be merged in the alphanumeric order and parsed after the main file
37 itself has been parsed. This is useful to alter or add configuration
38 settings, without having to modify the main configuration file. Each
39 drop-in file must have appropriate section headers.
40
41 In addition to /etc/systemd/network, drop-in ".d" directories can be
42 placed in /usr/lib/systemd/network or /run/systemd/network directories.
43 Drop-in files in /etc/ take precedence over those in /run/ which in
44 turn take precedence over those in /usr/lib/. Drop-in files under any
45 of these directories take precedence over the main link file wherever
46 located.
47
48 The link file contains a [Match] section, which determines if a given
49 link file may be applied to a given device, as well as a [Link] section
50 specifying how the device should be configured. The first (in lexical
51 order) of the link files that matches a given device is applied. Note
52 that a default file 99-default.link is shipped by the system. Any
53 user-supplied .link should hence have a lexically earlier name to be
54 considered at all.
55
56 See udevadm(8) for diagnosing problems with .link files.
57
59 A link file is said to match an interface if all matches specified by
60 the [Match] section are satisfied. When a link file does not contain
61 valid settings in [Match] section, then the file will match all
62 interfaces and systemd-udevd warns about that. Hint: to avoid the
63 warning and to make it clear that all interfaces shall be matched, add
64 the following:
65
66 OriginalName=*
67
68 The first (in alphanumeric order) of the link files that matches a
69 given interface is applied, all later files are ignored, even if they
70 match as well. The following keys are accepted:
71
72 MACAddress=
73 A whitespace-separated list of hardware addresses. The acceptable
74 formats are:
75
76 colon-delimited hexadecimal
77 Each field must be one byte. E.g. "12:34:56:78:90:ab" or
78 "AA:BB:CC:DD:EE:FF".
79
80 hyphen-delimited hexadecimal
81 Each field must be one byte. E.g. "12-34-56-78-90-ab" or
82 "AA-BB-CC-DD-EE-FF".
83
84 dot-delimited hexadecimal
85 Each field must be two bytes. E.g. "1234.5678.90ab" or
86 "AABB.CCDD.EEFF".
87
88 IPv4 address format
89 E.g. "127.0.0.1" or "192.168.0.1".
90
91 IPv6 address format
92 E.g. "2001:0db8:85a3::8a2e:0370:7334" or "::1".
93
94 The total length of each MAC address must be 4 (for IPv4 tunnel), 6
95 (for Ethernet), 16 (for IPv6 tunnel), or 20 (for InfiniBand). This
96 option may appear more than once, in which case the lists are
97 merged. If the empty string is assigned to this option, the list of
98 hardware addresses defined prior to this is reset. Defaults to
99 unset.
100
101 PermanentMACAddress=
102 A whitespace-separated list of hardware's permanent addresses.
103 While MACAddress= matches the device's current MAC address, this
104 matches the device's permanent MAC address, which may be different
105 from the current one. Use full colon-, hyphen- or dot-delimited
106 hexadecimal, or IPv4 or IPv6 address format. This option may appear
107 more than once, in which case the lists are merged. If the empty
108 string is assigned to this option, the list of hardware addresses
109 defined prior to this is reset. Defaults to unset.
110
111 Path=
112 A whitespace-separated list of shell-style globs matching the
113 persistent path, as exposed by the udev property ID_PATH.
114
115 Driver=
116 A whitespace-separated list of shell-style globs matching the
117 driver currently bound to the device, as exposed by the udev
118 property ID_NET_DRIVER of its parent device, or if that is not set,
119 the driver as exposed by ethtool -i of the device itself. If the
120 list is prefixed with a "!", the test is inverted.
121
122 Type=
123 A whitespace-separated list of shell-style globs matching the
124 device type, as exposed by networkctl list. If the list is prefixed
125 with a "!", the test is inverted. Some valid values are "ether",
126 "loopback", "wlan", "wwan". Valid types are named either from the
127 udev "DEVTYPE" attribute, or "ARPHRD_" macros in linux/if_arp.h, so
128 this is not comprehensive.
129
130 Kind=
131 A whitespace-separated list of shell-style globs matching the
132 device kind, as exposed by networkctl status INTERFACE or ip -d
133 link show INTERFACE. If the list is prefixed with a "!", the test
134 is inverted. Some valid values are "bond", "bridge", "gre", "tun",
135 "veth". Valid kinds are given by netlink's "IFLA_INFO_KIND"
136 attribute, so this is not comprehensive.
137
138 Property=
139 A whitespace-separated list of udev property names with their
140 values after equals sign ("="). If multiple properties are
141 specified, the test results are ANDed. If the list is prefixed with
142 a "!", the test is inverted. If a value contains white spaces, then
143 please quote whole key and value pair. If a value contains
144 quotation, then please escape the quotation with "\".
145
146 Example: if a .link file has the following:
147
148 Property=ID_MODEL_ID=9999 "ID_VENDOR_FROM_DATABASE=vendor name" "KEY=with \"quotation\""
149
150 then, the .link file matches only when an interface has all the
151 above three properties.
152
153 OriginalName=
154 A whitespace-separated list of shell-style globs matching the
155 device name, as exposed by the udev property "INTERFACE". This
156 cannot be used to match on names that have already been changed
157 from userspace. Caution is advised when matching on kernel-assigned
158 names, as they are known to be unstable between reboots.
159
160 Host=
161 Matches against the hostname or machine ID of the host. See
162 ConditionHost= in systemd.unit(5) for details. When prefixed with
163 an exclamation mark ("!"), the result is negated. If an empty
164 string is assigned, the previously assigned value is cleared.
165
166 Virtualization=
167 Checks whether the system is executed in a virtualized environment
168 and optionally test whether it is a specific implementation. See
169 ConditionVirtualization= in systemd.unit(5) for details. When
170 prefixed with an exclamation mark ("!"), the result is negated. If
171 an empty string is assigned, the previously assigned value is
172 cleared.
173
174 KernelCommandLine=
175 Checks whether a specific kernel command line option is set. See
176 ConditionKernelCommandLine= in systemd.unit(5) for details. When
177 prefixed with an exclamation mark ("!"), the result is negated. If
178 an empty string is assigned, the previously assigned value is
179 cleared.
180
181 KernelVersion=
182 Checks whether the kernel version (as reported by uname -r) matches
183 a certain expression. See ConditionKernelVersion= in
184 systemd.unit(5) for details. When prefixed with an exclamation mark
185 ("!"), the result is negated. If an empty string is assigned, the
186 previously assigned value is cleared.
187
188 Credential=
189 Checks whether the specified credential was passed to the
190 systemd-udevd.service service. See System and Service
191 Credentials[1] for details. When prefixed with an exclamation mark
192 ("!"), the result is negated. If an empty string is assigned, the
193 previously assigned value is cleared.
194
195 Architecture=
196 Checks whether the system is running on a specific architecture.
197 See ConditionArchitecture= in systemd.unit(5) for details. When
198 prefixed with an exclamation mark ("!"), the result is negated. If
199 an empty string is assigned, the previously assigned value is
200 cleared.
201
202 Firmware=
203 Checks whether the system is running on a machine with the
204 specified firmware. See ConditionFirmware= in systemd.unit(5) for
205 details. When prefixed with an exclamation mark ("!"), the result
206 is negated. If an empty string is assigned, the previously assigned
207 value is cleared.
208
210 The [Link] section accepts the following keys:
211
212 Description=
213 A description of the device.
214
215 Alias=
216 The ifalias interface property is set to this value.
217
218 MACAddressPolicy=
219 The policy by which the MAC address should be set. The available
220 policies are:
221
222 persistent
223 If the hardware has a persistent MAC address, as most hardware
224 should, and if it is used by the kernel, nothing is done.
225 Otherwise, a new MAC address is generated which is guaranteed
226 to be the same on every boot for the given machine and the
227 given device, but which is otherwise random. This feature
228 depends on ID_NET_NAME_* properties to exist for the link. On
229 hardware where these properties are not set, the generation of
230 a persistent MAC address will fail.
231
232 random
233 If the kernel is using a random MAC address, nothing is done.
234 Otherwise, a new address is randomly generated each time the
235 device appears, typically at boot. Either way, the random
236 address will have the "unicast" and "locally administered" bits
237 set.
238
239 none
240 Keeps the MAC address assigned by the kernel. Or use the MAC
241 address specified in MACAddress=.
242
243 An empty string assignment is equivalent to setting "none".
244
245 MACAddress=
246 The interface MAC address to use. For this setting to take effect,
247 MACAddressPolicy= must either be unset, empty, or "none".
248
249 NamePolicy=
250 An ordered, space-separated list of policies by which the interface
251 name should be set. NamePolicy= may be disabled by specifying
252 net.ifnames=0 on the kernel command line. Each of the policies may
253 fail, and the first successful one is used. The name is not set
254 directly, but is exported to udev as the property ID_NET_NAME,
255 which is, by default, used by a udev(7), rule to set NAME. The
256 available policies are:
257
258 kernel
259 If the kernel claims that the name it has set for a device is
260 predictable, then no renaming is performed.
261
262 database
263 The name is set based on entries in the udev's Hardware
264 Database with the key ID_NET_NAME_FROM_DATABASE.
265
266 onboard
267 The name is set based on information given by the firmware for
268 on-board devices, as exported by the udev property
269 ID_NET_NAME_ONBOARD. See systemd.net-naming-scheme(7).
270
271 slot
272 The name is set based on information given by the firmware for
273 hot-plug devices, as exported by the udev property
274 ID_NET_NAME_SLOT. See systemd.net-naming-scheme(7).
275
276 path
277 The name is set based on the device's physical location, as
278 exported by the udev property ID_NET_NAME_PATH. See
279 systemd.net-naming-scheme(7).
280
281 mac
282 The name is set based on the device's persistent MAC address,
283 as exported by the udev property ID_NET_NAME_MAC. See
284 systemd.net-naming-scheme(7).
285
286 keep
287 If the device already had a name given by userspace (as part of
288 creation of the device or a rename), keep it.
289
290 Name=
291 The interface name to use. This option has lower precedence than
292 NamePolicy=, so for this setting to take effect, NamePolicy= must
293 either be unset, empty, disabled, or all policies configured there
294 must fail. Also see the example below with "Name=dmz0".
295
296 Note that specifying a name that the kernel might use for another
297 interface (for example "eth0") is dangerous because the name
298 assignment done by udev will race with the assignment done by the
299 kernel, and only one interface may use the name. Depending on the
300 order of operations, either udev or the kernel will win, making the
301 naming unpredictable. It is best to use some different prefix, for
302 example "internal0"/"external0" or "lan0"/"lan1"/"lan3".
303
304 Interface names must have a minimum length of 1 character and a
305 maximum length of 15 characters, and may contain any 7bit ASCII
306 character, with the exception of control characters, ":", "/" and
307 "%". While "." is an allowed character, it's recommended to avoid
308 it when naming interfaces as various tools (such as resolvconf(1))
309 use it as separator character. Also, fully numeric interface names
310 are not allowed (in order to avoid ambiguity with interface
311 specification by numeric indexes), as are the special strings ".",
312 "..", "all" and "default".
313
314 AlternativeNamesPolicy=
315 A space-separated list of policies by which the interface's
316 alternative names should be set. Each of the policies may fail, and
317 all successful policies are used. The available policies are
318 "database", "onboard", "slot", "path", and "mac". If the kernel
319 does not support the alternative names, then this setting will be
320 ignored.
321
322 AlternativeName=
323 The alternative interface name to use. This option can be specified
324 multiple times. If the empty string is assigned to this option, the
325 list is reset, and all prior assignments have no effect. If the
326 kernel does not support the alternative names, then this setting
327 will be ignored.
328
329 Alternative interface names may be used to identify interfaces in
330 various tools. In contrast to the primary name (as configured with
331 Name= above) there may be multiple alternative names referring to
332 the same interface. Alternative names may have a maximum length of
333 127 characters, in contrast to the 15 allowed for the primary
334 interface name, but otherwise are subject to the same naming
335 constraints.
336
337 TransmitQueues=
338 Specifies the device's number of transmit queues. An integer in the
339 range 1...4096. When unset, the kernel's default will be used.
340
341 ReceiveQueues=
342 Specifies the device's number of receive queues. An integer in the
343 range 1...4096. When unset, the kernel's default will be used.
344
345 TransmitQueueLength=
346 Specifies the transmit queue length of the device in number of
347 packets. An unsigned integer in the range 0...4294967294. When
348 unset, the kernel's default will be used.
349
350 MTUBytes=
351 The maximum transmission unit in bytes to set for the device. The
352 usual suffixes K, M, G are supported and are understood to the base
353 of 1024.
354
355 BitsPerSecond=
356 The speed to set for the device, the value is rounded down to the
357 nearest Mbps. The usual suffixes K, M, G are supported and are
358 understood to the base of 1000.
359
360 Duplex=
361 The duplex mode to set for the device. The accepted values are half
362 and full.
363
364 AutoNegotiation=
365 Takes a boolean. If set to yes, automatic negotiation of
366 transmission parameters is enabled. Autonegotiation is a procedure
367 by which two connected ethernet devices choose common transmission
368 parameters, such as speed, duplex mode, and flow control. When
369 unset, the kernel's default will be used.
370
371 Note that if autonegotiation is enabled, speed and duplex settings
372 are read-only. If autonegotiation is disabled, speed and duplex
373 settings are writable if the driver supports multiple link modes.
374
375 WakeOnLan=
376 The Wake-on-LAN policy to set for the device. Takes the special
377 value "off" which disables Wake-on-LAN, or space separated list of
378 the following words:
379
380 phy
381 Wake on PHY activity.
382
383 unicast
384 Wake on unicast messages.
385
386 multicast
387 Wake on multicast messages.
388
389 broadcast
390 Wake on broadcast messages.
391
392 arp
393 Wake on ARP.
394
395 magic
396 Wake on receipt of a magic packet.
397
398 secureon
399 Enable SecureOn password for MagicPacket. Implied when
400 WakeOnLanPassword= is specified. If specified without
401 WakeOnLanPassword= option, then the password is read from the
402 credential "LINK.link.wol.password" (e.g.,
403 "60-foo.link.wol.password"), and if the credential not found,
404 then read from "wol.password". See
405 ImportCredential=/LoadCredential=/SetCredential= in
406 systemd.exec(1) for details. The password in the credential,
407 must be 6 bytes in hex format with each byte separated by a
408 colon (":") like an Ethernet MAC address, e.g.,
409 "aa:bb:cc:dd:ee:ff".
410
411 Defaults to unset, and the device's default will be used. This
412 setting can be specified multiple times. If an empty string is
413 assigned, then the all previous assignments are cleared.
414
415 WakeOnLanPassword=
416 Specifies the SecureOn password for MagicPacket. Takes an absolute
417 path to a regular file or an AF_UNIX stream socket, or the plain
418 password. When a path to a regular file is specified, the password
419 is read from it. When an AF_UNIX stream socket is specified, a
420 connection is made to it and the password is read from it. The
421 password must be 6 bytes in hex format with each byte separated by
422 a colon (":") like an Ethernet MAC address, e.g.,
423 "aa:bb:cc:dd:ee:ff". This implies WakeOnLan=secureon. Defaults to
424 unset, and the current value will not be changed.
425
426 Port=
427 The port option is used to select the device port. The supported
428 values are:
429
430 tp
431 An Ethernet interface using Twisted-Pair cable as the medium.
432
433 aui
434 Attachment Unit Interface (AUI). Normally used with hubs.
435
436 bnc
437 An Ethernet interface using BNC connectors and co-axial cable.
438
439 mii
440 An Ethernet interface using a Media Independent Interface
441 (MII).
442
443 fibre
444 An Ethernet interface using Optical Fibre as the medium.
445
446 Advertise=
447 This sets what speeds and duplex modes of operation are advertised
448 for auto-negotiation. This implies "AutoNegotiation=yes". The
449 supported values are:
450
451 Table 1. Supported advertise values
452 ┌───────────────────────────┬──────────────┬─────────────┐
453 │Advertise │ Speed (Mbps) │ Duplex Mode │
454 ├───────────────────────────┼──────────────┼─────────────┤
455 │10baset-full │ 10 │ full │
456 ├───────────────────────────┼──────────────┼─────────────┤
457 │10baset1l-full │ 10 │ full │
458 ├───────────────────────────┼──────────────┼─────────────┤
459 │10baset-half │ 10 │ half │
460 ├───────────────────────────┼──────────────┼─────────────┤
461 │100basefx-full │ 100 │ full │
462 ├───────────────────────────┼──────────────┼─────────────┤
463 │100baset-full │ 100 │ full │
464 ├───────────────────────────┼──────────────┼─────────────┤
465 │100baset1-full │ 100 │ full │
466 ├───────────────────────────┼──────────────┼─────────────┤
467 │100basefx-half │ 100 │ half │
468 ├───────────────────────────┼──────────────┼─────────────┤
469 │100baset-half │ 100 │ half │
470 ├───────────────────────────┼──────────────┼─────────────┤
471 │1000basekx-full │ 1000 │ full │
472 ├───────────────────────────┼──────────────┼─────────────┤
473 │1000baset-full │ 1000 │ full │
474 ├───────────────────────────┼──────────────┼─────────────┤
475 │1000baset1-full │ 1000 │ full │
476 ├───────────────────────────┼──────────────┼─────────────┤
477 │1000basex-full │ 1000 │ full │
478 ├───────────────────────────┼──────────────┼─────────────┤
479 │1000baset-half │ 1000 │ half │
480 ├───────────────────────────┼──────────────┼─────────────┤
481 │2500baset-full │ 2500 │ full │
482 ├───────────────────────────┼──────────────┼─────────────┤
483 │2500basex-full │ 2500 │ full │
484 ├───────────────────────────┼──────────────┼─────────────┤
485 │5000baset-full │ 5000 │ full │
486 ├───────────────────────────┼──────────────┼─────────────┤
487 │10000baser-fec │ 10000 │ │
488 ├───────────────────────────┼──────────────┼─────────────┤
489 │10000basecr-full │ 10000 │ full │
490 ├───────────────────────────┼──────────────┼─────────────┤
491 │10000baseer-full │ 10000 │ full │
492 ├───────────────────────────┼──────────────┼─────────────┤
493 │10000basekr-full │ 10000 │ full │
494 ├───────────────────────────┼──────────────┼─────────────┤
495 │10000basekx4-full │ 10000 │ full │
496 ├───────────────────────────┼──────────────┼─────────────┤
497 │10000baselr-full │ 10000 │ full │
498 ├───────────────────────────┼──────────────┼─────────────┤
499 │10000baselrm-full │ 10000 │ full │
500 ├───────────────────────────┼──────────────┼─────────────┤
501 │10000basesr-full │ 10000 │ full │
502 ├───────────────────────────┼──────────────┼─────────────┤
503 │10000baset-full │ 10000 │ full │
504 ├───────────────────────────┼──────────────┼─────────────┤
505 │20000basekr2-full │ 20000 │ full │
506 ├───────────────────────────┼──────────────┼─────────────┤
507 │20000basemld2-full │ 20000 │ full │
508 ├───────────────────────────┼──────────────┼─────────────┤
509 │25000basecr-full │ 25000 │ full │
510 ├───────────────────────────┼──────────────┼─────────────┤
511 │25000basekr-full │ 25000 │ full │
512 ├───────────────────────────┼──────────────┼─────────────┤
513 │25000basesr-full │ 25000 │ full │
514 ├───────────────────────────┼──────────────┼─────────────┤
515 │40000basecr4-full │ 40000 │ full │
516 ├───────────────────────────┼──────────────┼─────────────┤
517 │40000basekr4-full │ 40000 │ full │
518 ├───────────────────────────┼──────────────┼─────────────┤
519 │40000baselr4-full │ 40000 │ full │
520 ├───────────────────────────┼──────────────┼─────────────┤
521 │40000basesr4-full │ 40000 │ full │
522 ├───────────────────────────┼──────────────┼─────────────┤
523 │50000basecr-full │ 50000 │ full │
524 ├───────────────────────────┼──────────────┼─────────────┤
525 │50000basecr2-full │ 50000 │ full │
526 ├───────────────────────────┼──────────────┼─────────────┤
527 │50000basedr-full │ 50000 │ full │
528 ├───────────────────────────┼──────────────┼─────────────┤
529 │50000basekr-full │ 50000 │ full │
530 ├───────────────────────────┼──────────────┼─────────────┤
531 │50000basekr2-full │ 50000 │ full │
532 ├───────────────────────────┼──────────────┼─────────────┤
533 │50000baselr-er-fr-full │ 50000 │ full │
534 ├───────────────────────────┼──────────────┼─────────────┤
535 │50000basesr-full │ 50000 │ full │
536 ├───────────────────────────┼──────────────┼─────────────┤
537 │50000basesr2-full │ 50000 │ full │
538 ├───────────────────────────┼──────────────┼─────────────┤
539 │56000basecr4-full │ 56000 │ full │
540 ├───────────────────────────┼──────────────┼─────────────┤
541 │56000basekr4-full │ 56000 │ full │
542 ├───────────────────────────┼──────────────┼─────────────┤
543 │56000baselr4-full │ 56000 │ full │
544 ├───────────────────────────┼──────────────┼─────────────┤
545 │56000basesr4-full │ 56000 │ full │
546 ├───────────────────────────┼──────────────┼─────────────┤
547 │100000basecr-full │ 100000 │ full │
548 ├───────────────────────────┼──────────────┼─────────────┤
549 │100000basecr2-full │ 100000 │ full │
550 ├───────────────────────────┼──────────────┼─────────────┤
551 │100000basecr4-full │ 100000 │ full │
552 ├───────────────────────────┼──────────────┼─────────────┤
553 │100000basedr-full │ 100000 │ full │
554 ├───────────────────────────┼──────────────┼─────────────┤
555 │100000basedr2-full │ 100000 │ full │
556 ├───────────────────────────┼──────────────┼─────────────┤
557 │100000basekr-full │ 100000 │ full │
558 ├───────────────────────────┼──────────────┼─────────────┤
559 │100000basekr2-full │ 100000 │ full │
560 ├───────────────────────────┼──────────────┼─────────────┤
561 │100000basekr4-full │ 100000 │ full │
562 ├───────────────────────────┼──────────────┼─────────────┤
563 │100000baselr-er-fr-full │ 100000 │ full │
564 ├───────────────────────────┼──────────────┼─────────────┤
565 │100000baselr2-er2-fr2-full │ 100000 │ full │
566 ├───────────────────────────┼──────────────┼─────────────┤
567 │100000baselr4-er4-full │ 100000 │ full │
568 ├───────────────────────────┼──────────────┼─────────────┤
569 │100000basesr-full │ 100000 │ full │
570 ├───────────────────────────┼──────────────┼─────────────┤
571 │100000basesr2-full │ 100000 │ full │
572 ├───────────────────────────┼──────────────┼─────────────┤
573 │100000basesr4-full │ 100000 │ full │
574 ├───────────────────────────┼──────────────┼─────────────┤
575 │200000basecr2-full │ 200000 │ full │
576 ├───────────────────────────┼──────────────┼─────────────┤
577 │200000basecr4-full │ 200000 │ full │
578 ├───────────────────────────┼──────────────┼─────────────┤
579 │200000basedr2-full │ 200000 │ full │
580 ├───────────────────────────┼──────────────┼─────────────┤
581 │200000basedr4-full │ 200000 │ full │
582 ├───────────────────────────┼──────────────┼─────────────┤
583 │200000basekr2-full │ 200000 │ full │
584 ├───────────────────────────┼──────────────┼─────────────┤
585 │200000basekr4-full │ 200000 │ full │
586 ├───────────────────────────┼──────────────┼─────────────┤
587 │200000baselr2-er2-fr2-full │ 200000 │ full │
588 ├───────────────────────────┼──────────────┼─────────────┤
589 │200000baselr4-er4-fr4-full │ 200000 │ full │
590 ├───────────────────────────┼──────────────┼─────────────┤
591 │200000basesr2-full │ 200000 │ full │
592 ├───────────────────────────┼──────────────┼─────────────┤
593 │200000basesr4-full │ 200000 │ full │
594 ├───────────────────────────┼──────────────┼─────────────┤
595 │400000basecr4-full │ 400000 │ full │
596 ├───────────────────────────┼──────────────┼─────────────┤
597 │400000basecr8-full │ 400000 │ full │
598 ├───────────────────────────┼──────────────┼─────────────┤
599 │400000basedr4-full │ 400000 │ full │
600 ├───────────────────────────┼──────────────┼─────────────┤
601 │400000basedr8-full │ 400000 │ full │
602 ├───────────────────────────┼──────────────┼─────────────┤
603 │400000basekr4-full │ 400000 │ full │
604 ├───────────────────────────┼──────────────┼─────────────┤
605 │400000basekr8-full │ 400000 │ full │
606 ├───────────────────────────┼──────────────┼─────────────┤
607 │400000baselr4-er4-fr4-full │ 400000 │ full │
608 ├───────────────────────────┼──────────────┼─────────────┤
609 │400000baselr8-er8-fr8-full │ 400000 │ full │
610 ├───────────────────────────┼──────────────┼─────────────┤
611 │400000basesr4-full │ 400000 │ full │
612 ├───────────────────────────┼──────────────┼─────────────┤
613 │400000basesr8-full │ 400000 │ full │
614 ├───────────────────────────┼──────────────┼─────────────┤
615 │800000basecr8-full │ 800000 │ full │
616 ├───────────────────────────┼──────────────┼─────────────┤
617 │800000basedr8-2-full │ 800000 │ full │
618 ├───────────────────────────┼──────────────┼─────────────┤
619 │800000basedr8-full │ 800000 │ full │
620 ├───────────────────────────┼──────────────┼─────────────┤
621 │800000basekr8-full │ 800000 │ full │
622 ├───────────────────────────┼──────────────┼─────────────┤
623 │800000basesr8-full │ 800000 │ full │
624 ├───────────────────────────┼──────────────┼─────────────┤
625 │800000basevr8-full │ 800000 │ full │
626 ├───────────────────────────┼──────────────┼─────────────┤
627 │asym-pause │ │ │
628 ├───────────────────────────┼──────────────┼─────────────┤
629 │aui │ │ │
630 ├───────────────────────────┼──────────────┼─────────────┤
631 │autonegotiation │ │ │
632 ├───────────────────────────┼──────────────┼─────────────┤
633 │backplane │ │ │
634 ├───────────────────────────┼──────────────┼─────────────┤
635 │bnc │ │ │
636 ├───────────────────────────┼──────────────┼─────────────┤
637 │fec-baser │ │ │
638 ├───────────────────────────┼──────────────┼─────────────┤
639 │fec-llrs │ │ │
640 ├───────────────────────────┼──────────────┼─────────────┤
641 │fec-none │ │ │
642 ├───────────────────────────┼──────────────┼─────────────┤
643 │fec-rs │ │ │
644 ├───────────────────────────┼──────────────┼─────────────┤
645 │fibre │ │ │
646 ├───────────────────────────┼──────────────┼─────────────┤
647 │mii │ │ │
648 ├───────────────────────────┼──────────────┼─────────────┤
649 │pause │ │ │
650 ├───────────────────────────┼──────────────┼─────────────┤
651 │tp │ │ │
652 └───────────────────────────┴──────────────┴─────────────┘
653 By default this is unset, i.e. all possible modes will be
654 advertised. This option may be specified more than once, in which
655 case all specified speeds and modes are advertised. If the empty
656 string is assigned to this option, the list is reset, and all prior
657 assignments have no effect.
658
659 ReceiveChecksumOffload=
660 Takes a boolean. If set to true, hardware offload for checksumming
661 of ingress network packets is enabled. When unset, the kernel's
662 default will be used.
663
664 TransmitChecksumOffload=
665 Takes a boolean. If set to true, hardware offload for checksumming
666 of egress network packets is enabled. When unset, the kernel's
667 default will be used.
668
669 TCPSegmentationOffload=
670 Takes a boolean. If set to true, TCP Segmentation Offload (TSO) is
671 enabled. When unset, the kernel's default will be used.
672
673 TCP6SegmentationOffload=
674 Takes a boolean. If set to true, TCP6 Segmentation Offload
675 (tx-tcp6-segmentation) is enabled. When unset, the kernel's default
676 will be used.
677
678 GenericSegmentationOffload=
679 Takes a boolean. If set to true, Generic Segmentation Offload (GSO)
680 is enabled. When unset, the kernel's default will be used.
681
682 GenericReceiveOffload=
683 Takes a boolean. If set to true, Generic Receive Offload (GRO) is
684 enabled. When unset, the kernel's default will be used.
685
686 GenericReceiveOffloadHardware=
687 Takes a boolean. If set to true, hardware accelerated Generic
688 Receive Offload (GRO) is enabled. When unset, the kernel's default
689 will be used.
690
691 LargeReceiveOffload=
692 Takes a boolean. If set to true, Large Receive Offload (LRO) is
693 enabled. When unset, the kernel's default will be used.
694
695 ReceiveVLANCTAGHardwareAcceleration=
696 Takes a boolean. If set to true, receive VLAN CTAG hardware
697 acceleration is enabled. When unset, the kernel's default will be
698 used.
699
700 TransmitVLANCTAGHardwareAcceleration=
701 Takes a boolean. If set to true, transmit VLAN CTAG hardware
702 acceleration is enabled. When unset, the kernel's default will be
703 used.
704
705 ReceiveVLANCTAGFilter=
706 Takes a boolean. If set to true, receive filtering on VLAN CTAGs is
707 enabled. When unset, the kernel's default will be used.
708
709 TransmitVLANSTAGHardwareAcceleration=
710 Takes a boolean. If set to true, transmit VLAN STAG hardware
711 acceleration is enabled. When unset, the kernel's default will be
712 used.
713
714 NTupleFilter=
715 Takes a boolean. If set to true, receive N-tuple filters and
716 actions are enabled. When unset, the kernel's default will be used.
717
718 RxChannels=, TxChannels=, OtherChannels=, CombinedChannels=
719 Specifies the number of receive, transmit, other, or combined
720 channels, respectively. Takes an unsigned integer in the range
721 1...4294967295 or "max". If set to "max", the advertised maximum
722 value of the hardware will be used. When unset, the number will not
723 be changed. Defaults to unset.
724
725 RxBufferSize=, RxMiniBufferSize=, RxJumboBufferSize=, TxBufferSize=
726 Specifies the maximum number of pending packets in the NIC receive
727 buffer, mini receive buffer, jumbo receive buffer, or transmit
728 buffer, respectively. Takes an unsigned integer in the range
729 1...4294967295 or "max". If set to "max", the advertised maximum
730 value of the hardware will be used. When unset, the number will not
731 be changed. Defaults to unset.
732
733 RxFlowControl=
734 Takes a boolean. When set, enables receive flow control, also known
735 as the ethernet receive PAUSE message (generate and send ethernet
736 PAUSE frames). When unset, the kernel's default will be used.
737
738 TxFlowControl=
739 Takes a boolean. When set, enables transmit flow control, also
740 known as the ethernet transmit PAUSE message (respond to received
741 ethernet PAUSE frames). When unset, the kernel's default will be
742 used.
743
744 AutoNegotiationFlowControl=
745 Takes a boolean. When set, auto negotiation enables the interface
746 to exchange state advertisements with the connected peer so that
747 the two devices can agree on the ethernet PAUSE configuration. When
748 unset, the kernel's default will be used.
749
750 GenericSegmentOffloadMaxBytes=
751 Specifies the maximum size of a Generic Segment Offload (GSO)
752 packet the device should accept. The usual suffixes K, M, G are
753 supported and are understood to the base of 1024. An unsigned
754 integer in the range 1...65536. Defaults to unset.
755
756 GenericSegmentOffloadMaxSegments=
757 Specifies the maximum number of Generic Segment Offload (GSO)
758 segments the device should accept. An unsigned integer in the range
759 1...65535. Defaults to unset.
760
761 UseAdaptiveRxCoalesce=, UseAdaptiveTxCoalesce=
762 Boolean properties that, when set, enable/disable adaptive Rx/Tx
763 coalescing if the hardware supports it. When unset, the kernel's
764 default will be used.
765
766 RxCoalesceSec=, RxCoalesceIrqSec=, RxCoalesceLowSec=,
767 RxCoalesceHighSec=, TxCoalesceSec=, TxCoalesceIrqSec=,
768 TxCoalesceLowSec=, TxCoalesceHighSec=
769 These properties configure the delay before Rx/Tx interrupts are
770 generated after a packet is sent/received. The "Irq" properties
771 come into effect when the host is servicing an IRQ. The "Low" and
772 "High" properties come into effect when the packet rate drops below
773 the low packet rate threshold or exceeds the high packet rate
774 threshold respectively if adaptive Rx/Tx coalescing is enabled.
775 When unset, the kernel's defaults will be used.
776
777 RxMaxCoalescedFrames=, RxMaxCoalescedIrqFrames=,
778 RxMaxCoalescedLowFrames=, RxMaxCoalescedHighFrames=,
779 TxMaxCoalescedFrames=, TxMaxCoalescedIrqFrames=,
780 TxMaxCoalescedLowFrames=, TxMaxCoalescedHighFrames=
781 These properties configure the maximum number of frames that are
782 sent/received before a Rx/Tx interrupt is generated. The "Irq"
783 properties come into effect when the host is servicing an IRQ. The
784 "Low" and "High" properties come into effect when the packet rate
785 drops below the low packet rate threshold or exceeds the high
786 packet rate threshold respectively if adaptive Rx/Tx coalescing is
787 enabled. When unset, the kernel's defaults will be used.
788
789 CoalescePacketRateLow=, CoalescePacketRateHigh=
790 These properties configure the low and high packet rate (expressed
791 in packets per second) threshold respectively and are used to
792 determine when the corresponding coalescing settings for low and
793 high packet rates come into effect if adaptive Rx/Tx coalescing is
794 enabled. If unset, the kernel's defaults will be used.
795
796 CoalescePacketRateSampleIntervalSec=
797 Configures how often to sample the packet rate used for adaptive
798 Rx/Tx coalescing. This property cannot be zero. This lowest time
799 granularity supported by this property is seconds. Partial seconds
800 will be rounded up before being passed to the kernel. If unset, the
801 kernel's default will be used.
802
803 StatisticsBlockCoalesceSec=
804 How long to delay driver in-memory statistics block updates. If the
805 driver does not have an in-memory statistic block, this property is
806 ignored. This property cannot be zero. If unset, the kernel's
807 default will be used.
808
809 MDI=
810 Specifies the medium dependent interface (MDI) mode for the
811 interface. A MDI describes the interface from a physical layer
812 implementation to the physical medium used to carry the
813 transmission. Takes one of the following words: "straight" (or
814 equivalently: "mdi"), "crossover" (or equivalently: "mdi-x",
815 "mdix"), and "auto". When "straight", the MDI straight through mode
816 will be used. When "crossover", the MDI crossover (MDI-X) mode will
817 be used. When "auto", the MDI status is automatically detected.
818 Defaults to unset, and the kernel's default will be used.
819
820 SR-IOVVirtualFunctions=
821 Specifies the number of SR-IOV virtual functions. Takes an integer
822 in the range 0...2147483647. Defaults to unset, and automatically
823 determined from the values specified in the VirtualFunction=
824 settings in the [SR-IOV] sections.
825
827 The [SR-IOV] section accepts the following keys. Specify several
828 [SR-IOV] sections to configure several SR-IOVs. SR-IOV provides the
829 ability to partition a single physical PCI resource into virtual PCI
830 functions which can then be injected into a VM. In the case of network
831 VFs, SR-IOV improves north-south network performance (that is, traffic
832 with endpoints outside the host machine) by allowing traffic to bypass
833 the host machine’s network stack.
834
835 VirtualFunction=
836 Specifies a Virtual Function (VF), lightweight PCIe function
837 designed solely to move data in and out. Takes an integer in the
838 range 0...2147483646. This option is compulsory.
839
840 VLANId=
841 Specifies VLAN ID of the virtual function. Takes an integer in the
842 range 1...4095.
843
844 QualityOfService=
845 Specifies quality of service of the virtual function. Takes an
846 integer in the range 1...4294967294.
847
848 VLANProtocol=
849 Specifies VLAN protocol of the virtual function. Takes "802.1Q" or
850 "802.1ad".
851
852 MACSpoofCheck=
853 Takes a boolean. Controls the MAC spoof checking. When unset, the
854 kernel's default will be used.
855
856 QueryReceiveSideScaling=
857 Takes a boolean. Toggle the ability of querying the receive side
858 scaling (RSS) configuration of the virtual function (VF). The VF
859 RSS information like RSS hash key may be considered sensitive on
860 some devices where this information is shared between VF and the
861 physical function (PF). When unset, the kernel's default will be
862 used.
863
864 Trust=
865 Takes a boolean. Allows one to set trust mode of the virtual
866 function (VF). When set, VF users can set a specific feature which
867 may impact security and/or performance. When unset, the kernel's
868 default will be used.
869
870 LinkState=
871 Allows one to set the link state of the virtual function (VF).
872 Takes a boolean or a special value "auto". Setting to "auto" means
873 a reflection of the physical function (PF) link state, "yes" lets
874 the VF to communicate with other VFs on this host even if the PF
875 link state is down, "no" causes the hardware to drop any packets
876 sent by the VF. When unset, the kernel's default will be used.
877
878 MACAddress=
879 Specifies the MAC address for the virtual function.
880
882 Example 1. /usr/lib/systemd/network/99-default.link
883
884 The link file 99-default.link that is shipped with systemd defines the
885 default policies for the interface name, alternative names, and MAC
886 address of links.
887
888 [Match]
889 OriginalName=*
890
891 [Link]
892 NamePolicy=keep kernel database onboard slot path
893 AlternativeNamesPolicy=database onboard slot path
894 MACAddressPolicy=persistent
895
896 Example 2. /etc/systemd/network/10-dmz.link
897
898 This example assigns the fixed name "dmz0" to the interface with the
899 MAC address 00:a0:de:63:7a:e6:
900
901 [Match]
902 MACAddress=00:a0:de:63:7a:e6
903
904 [Link]
905 Name=dmz0
906
907 NamePolicy= is not set, so Name= takes effect. We use the "10-" prefix
908 to order this file early in the list. Note that it needs to be before
909 99-default.link, i.e. it needs a numerical prefix, to have any effect
910 at all.
911
912 Example 3. (Re-)applying a .link file to an interface
913
914 After a new .link file has been created, or an existing .link file
915 modified, the new settings may be applied to the matching interface
916 with the following commands:
917
918 $ sudo udevadm control --reload
919 $ sudo ip link set eth0 down
920 $ sudo udevadm trigger --verbose --settle --action add /sys/class/net/eth0
921
922 You may also need to stop the service that manages the network
923 interface, e.g. systemd-networkd.service or NetworkManager.service
924 before the above operation, and then restart the service after that.
925 For more details about udevadm command, see udevadm(8).
926
927 Example 4. Debugging NamePolicy= assignments
928
929 $ sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/hub0
930 ...
931 Parsed configuration file /usr/lib/systemd/network/99-default.link
932 Parsed configuration file /etc/systemd/network/10-eth0.link
933 ID_NET_DRIVER=cdc_ether
934 Config file /etc/systemd/network/10-eth0.link applies to device hub0
935 link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
936 hub0: Device has name_assign_type=4
937 Using default interface naming scheme 'v240'.
938 hub0: Policies didn't yield a name, using specified Name=hub0.
939 ID_NET_LINK_FILE=/etc/systemd/network/10-eth0.link
940 ID_NET_NAME=hub0
941 ...
942
943 Explicit Name= configuration wins in this case.
944
945 sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/enp0s31f6
946 ...
947 Parsed configuration file /usr/lib/systemd/network/99-default.link
948 Parsed configuration file /etc/systemd/network/10-eth0.link
949 Created link configuration context.
950 ID_NET_DRIVER=e1000e
951 Config file /usr/lib/systemd/network/99-default.link applies to device enp0s31f6
952 link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
953 enp0s31f6: Device has name_assign_type=4
954 Using default interface naming scheme 'v240'.
955 enp0s31f6: Policy *keep*: keeping existing userspace name
956 enp0s31f6: Device has addr_assign_type=0
957 enp0s31f6: MAC on the device already matches policy *persistent*
958 ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
959 ...
960
961 In this case, the interface was already renamed, so the keep policy
962 specified as the first option in 99-default.link means that the
963 existing name is preserved. If keep was removed, or if were in boot
964 before the renaming has happened, we might get the following instead:
965
966 enp0s31f6: Policy *path* yields "enp0s31f6".
967 enp0s31f6: Device has addr_assign_type=0
968 enp0s31f6: MAC on the device already matches policy *persistent*
969 ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
970 ID_NET_NAME=enp0s31f6
971 ...
972
973 Please note that the details of output are subject to change.
974
975 Example 5. /etc/systemd/network/10-internet.link
976
977 This example assigns the fixed name "internet0" to the interface with
978 the device path "pci-0000:00:1a.0-*":
979
980 [Match]
981 Path=pci-0000:00:1a.0-*
982
983 [Link]
984 Name=internet0
985
986 Example 6. /etc/systemd/network/25-wireless.link
987
988 Here's an overly complex example that shows the use of a large number
989 of [Match] and [Link] settings.
990
991 [Match]
992 MACAddress=12:34:56:78:9a:bc
993 Driver=brcmsmac
994 Path=pci-0000:02:00.0-*
995 Type=wlan
996 Virtualization=no
997 Host=my-laptop
998 Architecture=x86-64
999
1000 [Link]
1001 Name=wireless0
1002 MTUBytes=1450
1003 BitsPerSecond=10M
1004 WakeOnLan=magic
1005 MACAddress=cb:a9:87:65:43:21
1006
1008 systemd-udevd.service(8), udevadm(8), systemd.netdev(5),
1009 systemd.network(5), systemd-network-generator.service(8)
1010
1012 1. System and Service Credentials
1013 https://systemd.io/CREDENTIALS
1014
1015
1016
1017systemd 254 SYSTEMD.LINK(5)