1SYSTEMD.LINK(5)                  systemd.link                  SYSTEMD.LINK(5)
2
3
4

NAME

6       systemd.link - Network device configuration
7

SYNOPSIS

9       link.link
10

DESCRIPTION

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, the volatile runtime network
19       directory /run/systemd/network, and the local administration network
20       directory /etc/systemd/network. Link files must have the extension
21       .link; other extensions are ignored. All link files are collectively
22       sorted and processed in lexical order, regardless of the directories in
23       which they live. However, files with identical filenames replace each
24       other. Files in /etc/ have the highest priority, files in /run/ take
25       precedence over files with the same name in /usr/lib/. This can be used
26       to override a system-supplied link file with a local file if needed. As
27       a special case, an empty file (file size 0) or symlink with the same
28       name pointing to /dev/null disables the configuration file entirely (it
29       is "masked").
30
31       Along with the link file foo.link, a "drop-in" directory foo.link.d/
32       may exist. All files with the suffix ".conf" from this directory will
33       be merged in the alphanumeric order and parsed after the main file
34       itself has been parsed. This is useful to alter or add configuration
35       settings, without having to modify the main configuration file. Each
36       drop-in file must have appropriate section headers.
37
38       In addition to /etc/systemd/network, drop-in ".d" directories can be
39       placed in /usr/lib/systemd/network or /run/systemd/network directories.
40       Drop-in files in /etc/ take precedence over those in /run/ which in
41       turn take precedence over those in /usr/lib/. Drop-in files under any
42       of these directories take precedence over the main link file wherever
43       located.
44
45       The link file contains a [Match] section, which determines if a given
46       link file may be applied to a given device, as well as a [Link] section
47       specifying how the device should be configured. The first (in lexical
48       order) of the link files that matches a given device is applied. Note
49       that a default file 99-default.link is shipped by the system. Any
50       user-supplied .link should hence have a lexically earlier name to be
51       considered at all.
52
53       See udevadm(8) for diagnosing problems with .link files.
54

[MATCH] SECTION OPTIONS

56       A link file is said to match a device if all matches specified by the
57       [Match] section are satisfied. When a link file does not contain valid
58       settings in [Match] section, then the file will match all devices and
59       systemd-udevd warns about that. Hint: to avoid the warning and to make
60       it clear that all interfaces shall be matched, add the following:
61
62           OriginalName=*
63
64       The following keys are accepted:
65
66       MACAddress=
67           A whitespace-separated list of hardware addresses. The acceptable
68           formats are:
69
70           colon-delimited hexadecimal
71               Each field must be one byte. E.g.  "12:34:56:78:90:ab" or
72               "AA:BB:CC:DD:EE:FF".
73
74           hyphen-delimited hexadecimal
75               Each field must be one byte. E.g.  "12-34-56-78-90-ab" or
76               "AA-BB-CC-DD-EE-FF".
77
78           dot-delimited hexadecimal
79               Each field must be two bytes. E.g.  "1234.5678.90ab" or
80               "AABB.CCDD.EEFF".
81
82           IPv4 address format
83               E.g.  "127.0.0.1" or "192.168.0.1".
84
85           IPv6 address format
86               E.g.  "2001:0db8:85a3::8a2e:0370:7334" or "::1".
87
88           The total length of each MAC address must be 4 (for IPv4 tunnel), 6
89           (for Ethernet), 16 (for IPv6 tunnel), or 20 (for InfiniBand). This
90           option may appear more than once, in which case the lists are
91           merged. If the empty string is assigned to this option, the list of
92           hardware addresses defined prior to this is reset. Defaults to
93           unset.
94
95       PermanentMACAddress=
96           A whitespace-separated list of hardware's permanent addresses.
97           While MACAddress= matches the device's current MAC address, this
98           matches the device's permanent MAC address, which may be different
99           from the current one. Use full colon-, hyphen- or dot-delimited
100           hexadecimal, or IPv4 or IPv6 address format. This option may appear
101           more than once, in which case the lists are merged. If the empty
102           string is assigned to this option, the list of hardware addresses
103           defined prior to this is reset. Defaults to unset.
104
105       Path=
106           A whitespace-separated list of shell-style globs matching the
107           persistent path, as exposed by the udev property ID_PATH.
108
109       Driver=
110           A whitespace-separated list of shell-style globs matching the
111           driver currently bound to the device, as exposed by the udev
112           property ID_NET_DRIVER of its parent device, or if that is not set,
113           the driver as exposed by ethtool -i of the device itself. If the
114           list is prefixed with a "!", the test is inverted.
115
116       Type=
117           A whitespace-separated list of shell-style globs matching the
118           device type, as exposed by networkctl list. If the list is prefixed
119           with a "!", the test is inverted. Some valid values are "ether",
120           "loopback", "wlan", "wwan". Valid types are named either from the
121           udev "DEVTYPE" attribute, or "ARPHRD_" macros in linux/if_arp.h, so
122           this is not comprehensive.
123
124       Property=
125           A whitespace-separated list of udev property names with their
126           values after equals sign ("="). If multiple properties are
127           specified, the test results are ANDed. If the list is prefixed with
128           a "!", the test is inverted. If a value contains white spaces, then
129           please quote whole key and value pair. If a value contains
130           quotation, then please escape the quotation with "\".
131
132           Example: if a .link file has the following:
133
134               Property=ID_MODEL_ID=9999 "ID_VENDOR_FROM_DATABASE=vendor name" "KEY=with \"quotation\""
135
136           then, the .link file matches only when an interface has all the
137           above three properties.
138
139       OriginalName=
140           A whitespace-separated list of shell-style globs matching the
141           device name, as exposed by the udev property "INTERFACE". This
142           cannot be used to match on names that have already been changed
143           from userspace. Caution is advised when matching on kernel-assigned
144           names, as they are known to be unstable between reboots.
145
146       Host=
147           Matches against the hostname or machine ID of the host. See
148           ConditionHost= in systemd.unit(5) for details. When prefixed with
149           an exclamation mark ("!"), the result is negated. If an empty
150           string is assigned, then previously assigned value is cleared.
151
152       Virtualization=
153           Checks whether the system is executed in a virtualized environment
154           and optionally test whether it is a specific implementation. See
155           ConditionVirtualization= in systemd.unit(5) for details. When
156           prefixed with an exclamation mark ("!"), the result is negated. If
157           an empty string is assigned, then previously assigned value is
158           cleared.
159
160       KernelCommandLine=
161           Checks whether a specific kernel command line option is set. See
162           ConditionKernelCommandLine= in systemd.unit(5) for details. When
163           prefixed with an exclamation mark ("!"), the result is negated. If
164           an empty string is assigned, then previously assigned value is
165           cleared.
166
167       KernelVersion=
168           Checks whether the kernel version (as reported by uname -r) matches
169           a certain expression. See ConditionKernelVersion= in
170           systemd.unit(5) for details. When prefixed with an exclamation mark
171           ("!"), the result is negated. If an empty string is assigned, then
172           previously assigned value is cleared.
173
174       Architecture=
175           Checks whether the system is running on a specific architecture.
176           See ConditionArchitecture= in systemd.unit(5) for details. When
177           prefixed with an exclamation mark ("!"), the result is negated. If
178           an empty string is assigned, then previously assigned value is
179           cleared.
180
181       Firmware=
182           Checks whether the system is running on a machine with the
183           specified firmware. See ConditionFirmware= in systemd.unit(5) for
184           details. When prefixed with an exclamation mark ("!"), the result
185           is negated. If an empty string is assigned, then previously
186           assigned value is cleared.
187

[LINK] SECTION OPTIONS

189       The [Link] section accepts the following keys:
190
191       Description=
192           A description of the device.
193
194       Alias=
195           The ifalias interface property is set to this value.
196
197       MACAddressPolicy=
198           The policy by which the MAC address should be set. The available
199           policies are:
200
201           persistent
202               If the hardware has a persistent MAC address, as most hardware
203               should, and if it is used by the kernel, nothing is done.
204               Otherwise, a new MAC address is generated which is guaranteed
205               to be the same on every boot for the given machine and the
206               given device, but which is otherwise random. This feature
207               depends on ID_NET_NAME_* properties to exist for the link. On
208               hardware where these properties are not set, the generation of
209               a persistent MAC address will fail.
210
211           random
212               If the kernel is using a random MAC address, nothing is done.
213               Otherwise, a new address is randomly generated each time the
214               device appears, typically at boot. Either way, the random
215               address will have the "unicast" and "locally administered" bits
216               set.
217
218           none
219               Keeps the MAC address assigned by the kernel. Or use the MAC
220               address specified in MACAddress=.
221
222           An empty string assignment is equivalent to setting "none".
223
224       MACAddress=
225           The interface MAC address to use. For this setting to take effect,
226           MACAddressPolicy= must either be unset, empty, or "none".
227
228       NamePolicy=
229           An ordered, space-separated list of policies by which the interface
230           name should be set.  NamePolicy= may be disabled by specifying
231           net.ifnames=0 on the kernel command line. Each of the policies may
232           fail, and the first successful one is used. The name is not set
233           directly, but is exported to udev as the property ID_NET_NAME,
234           which is, by default, used by a udev(7), rule to set NAME. The
235           available policies are:
236
237           kernel
238               If the kernel claims that the name it has set for a device is
239               predictable, then no renaming is performed.
240
241           database
242               The name is set based on entries in the udev's Hardware
243               Database with the key ID_NET_NAME_FROM_DATABASE.
244
245           onboard
246               The name is set based on information given by the firmware for
247               on-board devices, as exported by the udev property
248               ID_NET_NAME_ONBOARD. See systemd.net-naming-scheme(7).
249
250           slot
251               The name is set based on information given by the firmware for
252               hot-plug devices, as exported by the udev property
253               ID_NET_NAME_SLOT. See systemd.net-naming-scheme(7).
254
255           path
256               The name is set based on the device's physical location, as
257               exported by the udev property ID_NET_NAME_PATH. See
258               systemd.net-naming-scheme(7).
259
260           mac
261               The name is set based on the device's persistent MAC address,
262               as exported by the udev property ID_NET_NAME_MAC. See
263               systemd.net-naming-scheme(7).
264
265           keep
266               If the device already had a name given by userspace (as part of
267               creation of the device or a rename), keep it.
268
269       Name=
270           The interface name to use. This option has lower precedence than
271           NamePolicy=, so for this setting to take effect, NamePolicy= must
272           either be unset, empty, disabled, or all policies configured there
273           must fail. Also see the example below with "Name=dmz0".
274
275           Note that specifying a name that the kernel might use for another
276           interface (for example "eth0") is dangerous because the name
277           assignment done by udev will race with the assignment done by the
278           kernel, and only one interface may use the name. Depending on the
279           order of operations, either udev or the kernel will win, making the
280           naming unpredictable. It is best to use some different prefix, for
281           example "internal0"/"external0" or "lan0"/"lan1"/"lan3".
282
283       AlternativeNamesPolicy=
284           A space-separated list of policies by which the interface's
285           alternative names should be set. Each of the policies may fail, and
286           all successful policies are used. The available policies are
287           "database", "onboard", "slot", "path", and "mac". If the kernel
288           does not support the alternative names, then this setting will be
289           ignored.
290
291       AlternativeName=
292           The alternative interface name to use. This option can be specified
293           multiple times. If the empty string is assigned to this option, the
294           list is reset, and all prior assignments have no effect. If the
295           kernel does not support the alternative names, then this setting
296           will be ignored.
297
298       TransmitQueues=
299           Specifies the device's number of transmit queues. An integer in the
300           range 1...4096. When unset, the kernel's default will be used.
301
302       ReceiveQueues=
303           Specifies the device's number of receive queues. An integer in the
304           range 1...4096. When unset, the kernel's default will be used.
305
306       TransmitQueueLength=
307           Specifies the transmit queue length of the device in number of
308           packets. An unsigned integer in the range 0...4294967294. When
309           unset, the kernel's default will be used.
310
311       MTUBytes=
312           The maximum transmission unit in bytes to set for the device. The
313           usual suffixes K, M, G are supported and are understood to the base
314           of 1024.
315
316       BitsPerSecond=
317           The speed to set for the device, the value is rounded down to the
318           nearest Mbps. The usual suffixes K, M, G are supported and are
319           understood to the base of 1000.
320
321       Duplex=
322           The duplex mode to set for the device. The accepted values are half
323           and full.
324
325       AutoNegotiation=
326           Takes a boolean. If set to yes, automatic negotiation of
327           transmission parameters is enabled. Autonegotiation is a procedure
328           by which two connected ethernet devices choose common transmission
329           parameters, such as speed, duplex mode, and flow control. When
330           unset, the kernel's default will be used.
331
332           Note that if autonegotiation is enabled, speed and duplex settings
333           are read-only. If autonegotiation is disabled, speed and duplex
334           settings are writable if the driver supports multiple link modes.
335
336       WakeOnLan=
337           The Wake-on-LAN policy to set for the device. Takes the special
338           value "off" which disables Wake-on-LAN, or space separated list of
339           the following words:
340
341           phy
342               Wake on PHY activity.
343
344           unicast
345               Wake on unicast messages.
346
347           multicast
348               Wake on multicast messages.
349
350           broadcast
351               Wake on broadcast messages.
352
353           arp
354               Wake on ARP.
355
356           magic
357               Wake on receipt of a magic packet.
358
359           secureon
360               Enable SecureOn password for MagicPacket. Implied when
361               WakeOnLanPassword= is specified. If specified without
362               WakeOnLanPassword= option, then the password is read from the
363               credential "LINK.link.wol.password" (e.g.,
364               "60-foo.link.wol.password"), and if the credential not found,
365               then read from "wol.password". See
366               LoadCredential=/SetCredential= in systemd.exec(1) for details.
367               The password in the credential, must be 6 bytes in hex format
368               with each byte separated by a colon (":") like an Ethernet MAC
369               address, e.g., "aa:bb:cc:dd:ee:ff".
370
371           Defaults to unset, and the device's default will be used. This
372           setting can be specified multiple times. If an empty string is
373           assigned, then the all previous assignments are cleared.
374
375       WakeOnLanPassword=
376           Specifies the SecureOn password for MagicPacket. Takes an absolute
377           path to a regular file or an AF_UNIX stream socket, or the plain
378           password. When a path to a regular file is specified, the password
379           is read from it. When an AF_UNIX stream socket is specified, a
380           connection is made to it and the password is read from it. The
381           password must be 6 bytes in hex format with each byte separated by
382           a colon (":") like an Ethernet MAC address, e.g.,
383           "aa:bb:cc:dd:ee:ff". This implies WakeOnLan=secureon. Defaults to
384           unset, and the current value will not be changed.
385
386       Port=
387           The port option is used to select the device port. The supported
388           values are:
389
390           tp
391               An Ethernet interface using Twisted-Pair cable as the medium.
392
393           aui
394               Attachment Unit Interface (AUI). Normally used with hubs.
395
396           bnc
397               An Ethernet interface using BNC connectors and co-axial cable.
398
399           mii
400               An Ethernet interface using a Media Independent Interface
401               (MII).
402
403           fibre
404               An Ethernet interface using Optical Fibre as the medium.
405
406       Advertise=
407           This sets what speeds and duplex modes of operation are advertised
408           for auto-negotiation. This implies "AutoNegotiation=yes". The
409           supported values are:
410
411           Table 1. Supported advertise values
412           ┌───────────────────┬──────────────┬─────────────┐
413Advertise          Speed (Mbps) Duplex Mode 
414           ├───────────────────┼──────────────┼─────────────┤
41510baset-half       │ 10           │ half        │
416           ├───────────────────┼──────────────┼─────────────┤
41710baset-full       │ 10           │ full        │
418           ├───────────────────┼──────────────┼─────────────┤
419100baset-half      │ 100          │ half        │
420           ├───────────────────┼──────────────┼─────────────┤
421100baset-full      │ 100          │ full        │
422           ├───────────────────┼──────────────┼─────────────┤
4231000baset-half     │ 1000         │ half        │
424           ├───────────────────┼──────────────┼─────────────┤
4251000baset-full     │ 1000         │ full        │
426           ├───────────────────┼──────────────┼─────────────┤
42710000baset-full    │ 10000        │ full        │
428           ├───────────────────┼──────────────┼─────────────┤
4292500basex-full     │ 2500         │ full        │
430           ├───────────────────┼──────────────┼─────────────┤
4311000basekx-full    │ 1000         │ full        │
432           ├───────────────────┼──────────────┼─────────────┤
43310000basekx4-full  │ 10000        │ full        │
434           ├───────────────────┼──────────────┼─────────────┤
43510000basekr-full   │ 10000        │ full        │
436           ├───────────────────┼──────────────┼─────────────┤
43710000baser-fec     │ 10000        │ full        │
438           ├───────────────────┼──────────────┼─────────────┤
43920000basemld2-full │ 20000        │ full        │
440           ├───────────────────┼──────────────┼─────────────┤
44120000basekr2-full  │ 20000        │ full        │
442           └───────────────────┴──────────────┴─────────────┘
443           By default this is unset, i.e. all possible modes will be
444           advertised. This option may be specified more than once, in which
445           case all specified speeds and modes are advertised. If the empty
446           string is assigned to this option, the list is reset, and all prior
447           assignments have no effect.
448
449       ReceiveChecksumOffload=
450           Takes a boolean. If set to true, hardware offload for checksumming
451           of ingress network packets is enabled. When unset, the kernel's
452           default will be used.
453
454       TransmitChecksumOffload=
455           Takes a boolean. If set to true, hardware offload for checksumming
456           of egress network packets is enabled. When unset, the kernel's
457           default will be used.
458
459       TCPSegmentationOffload=
460           Takes a boolean. If set to true, TCP Segmentation Offload (TSO) is
461           enabled. When unset, the kernel's default will be used.
462
463       TCP6SegmentationOffload=
464           Takes a boolean. If set to true, TCP6 Segmentation Offload
465           (tx-tcp6-segmentation) is enabled. When unset, the kernel's default
466           will be used.
467
468       GenericSegmentationOffload=
469           Takes a boolean. If set to true, Generic Segmentation Offload (GSO)
470           is enabled. When unset, the kernel's default will be used.
471
472       GenericReceiveOffload=
473           Takes a boolean. If set to true, Generic Receive Offload (GRO) is
474           enabled. When unset, the kernel's default will be used.
475
476       GenericReceiveOffloadHardware=
477           Takes a boolean. If set to true, hardware accelerated Generic
478           Receive Offload (GRO) is enabled. When unset, the kernel's default
479           will be used.
480
481       LargeReceiveOffload=
482           Takes a boolean. If set to true, Large Receive Offload (LRO) is
483           enabled. When unset, the kernel's default will be used.
484
485       ReceiveVLANCTAGHardwareAcceleration=
486           Takes a boolean. If set to true, receive VLAN CTAG hardware
487           acceleration is enabled. When unset, the kernel's default will be
488           used.
489
490       TransmitVLANCTAGHardwareAcceleration=
491           Takes a boolean. If set to true, transmit VLAN CTAG hardware
492           acceleration is enabled. When unset, the kernel's default will be
493           used.
494
495       ReceiveVLANCTAGFilter=
496           Takes a boolean. If set to true, receive filtering on VLAN CTAGs is
497           enabled. When unset, the kernel's default will be used.
498
499       TransmitVLANSTAGHardwareAcceleration=
500           Takes a boolean. If set to true, transmit VLAN STAG hardware
501           acceleration is enabled. When unset, the kernel's default will be
502           used.
503
504       NTupleFilter=
505           Takes a boolean. If set to true, receive N-tuple filters and
506           actions are enabled. When unset, the kernel's default will be used.
507
508       RxChannels=, TxChannels=, OtherChannels=, CombinedChannels=
509           Specifies the number of receive, transmit, other, or combined
510           channels, respectively. Takes an unsigned integer in the range
511           1...4294967295 or "max". If set to "max", the advertised maximum
512           value of the hardware will be used. When unset, the number will not
513           be changed. Defaults to unset.
514
515       RxBufferSize=, RxMiniBufferSize=, RxJumboBufferSize=, TxBufferSize=
516           Specifies the maximum number of pending packets in the NIC receive
517           buffer, mini receive buffer, jumbo receive buffer, or transmit
518           buffer, respectively. Takes an unsigned integer in the range
519           1...4294967295 or "max". If set to "max", the advertised maximum
520           value of the hardware will be used. When unset, the number will not
521           be changed. Defaults to unset.
522
523       RxFlowControl=
524           Takes a boolean. When set, enables receive flow control, also known
525           as the ethernet receive PAUSE message (generate and send ethernet
526           PAUSE frames). When unset, the kernel's default will be used.
527
528       TxFlowControl=
529           Takes a boolean. When set, enables transmit flow control, also
530           known as the ethernet transmit PAUSE message (respond to received
531           ethernet PAUSE frames). When unset, the kernel's default will be
532           used.
533
534       AutoNegotiationFlowControl=
535           Takes a boolean. When set, auto negotiation enables the interface
536           to exchange state advertisements with the connected peer so that
537           the two devices can agree on the ethernet PAUSE configuration. When
538           unset, the kernel's default will be used.
539
540       GenericSegmentOffloadMaxBytes=
541           Specifies the maximum size of a Generic Segment Offload (GSO)
542           packet the device should accept. The usual suffixes K, M, G are
543           supported and are understood to the base of 1024. An unsigned
544           integer in the range 1...65536. Defaults to unset.
545
546       GenericSegmentOffloadMaxSegments=
547           Specifies the maximum number of Generic Segment Offload (GSO)
548           segments the device should accept. An unsigned integer in the range
549           1...65535. Defaults to unset.
550
551       UseAdaptiveRxCoalesce=, UseAdaptiveTxCoalesce=
552           Boolean properties that, when set, enable/disable adaptive Rx/Tx
553           coalescing if the hardware supports it. When unset, the kernel's
554           default will be used.
555
556       RxCoalesceSec=, RxCoalesceIrqSec=, RxCoalesceLowSec=,
557       RxCoalesceHighSec=, TxCoalesceSec=, TxCoalesceIrqSec=,
558       TxCoalesceLowSec=, TxCoalesceHighSec=
559           These properties configure the delay before Rx/Tx interrupts are
560           generated after a packet is sent/received. The "Irq" properties
561           come into effect when the host is servicing an IRQ. The "Low" and
562           "High" properties come into effect when the packet rate drops below
563           the low packet rate threshold or exceeds the high packet rate
564           threshold respectively if adaptive Rx/Tx coalescing is enabled.
565           When unset, the kernel's defaults will be used.
566
567       RxMaxCoalescedFrames=, RxMaxCoalescedIrqFrames=,
568       RxMaxCoalescedLowFrames=, RxMaxCoalescedHighFrames=,
569       TxMaxCoalescedFrames=, TxMaxCoalescedIrqFrames=,
570       TxMaxCoalescedLowFrames=, TxMaxCoalescedHighFrames=
571           These properties configure the maximum number of frames that are
572           sent/received before a Rx/Tx interrupt is generated. The "Irq"
573           properties come into effect when the host is servicing an IRQ. The
574           "Low" and "High" properties come into effect when the packet rate
575           drops below the low packet rate threshold or exceeds the high
576           packet rate threshold respectively if adaptive Rx/Tx coalescing is
577           enabled. When unset, the kernel's defaults will be used.
578
579       CoalescePacketRateLow=, CoalescePacketRateHigh=
580           These properties configure the low and high packet rate (expressed
581           in packets per second) threshold respectively and are used to
582           determine when the corresponding coalescing settings for low and
583           high packet rates come into effect if adaptive Rx/Tx coalescing is
584           enabled. If unset, the kernel's defaults will be used.
585
586       CoalescePacketRateSampleIntervalSec=
587           Configures how often to sample the packet rate used for adaptive
588           Rx/Tx coalescing. This property cannot be zero. This lowest time
589           granularity supported by this property is seconds. Partial seconds
590           will be rounded up before being passed to the kernel. If unset, the
591           kernel's default will be used.
592
593       StatisticsBlockCoalesceSec=
594           How long to delay driver in-memory statistics block updates. If the
595           driver does not have an in-memory statistic block, this property is
596           ignored. This property cannot be zero. If unset, the kernel's
597           default will be used.
598

EXAMPLES

600       Example 1. /usr/lib/systemd/network/99-default.link
601
602       The link file 99-default.link that is shipped with systemd defines the
603       default naming policy for links.
604
605           [Link]
606           NamePolicy=kernel database onboard slot path
607           MACAddressPolicy=persistent
608
609       Example 2. /etc/systemd/network/10-dmz.link
610
611       This example assigns the fixed name "dmz0" to the interface with the
612       MAC address 00:a0:de:63:7a:e6:
613
614           [Match]
615           MACAddress=00:a0:de:63:7a:e6
616
617           [Link]
618           Name=dmz0
619
620       NamePolicy= is not set, so Name= takes effect. We use the "10-" prefix
621       to order this file early in the list. Note that it needs to be before
622       "99-link", i.e. it needs a numerical prefix, to have any effect at all.
623
624       Example 3. Debugging NamePolicy= assignments
625
626           $ sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/hub0
627           ...
628           Parsed configuration file /usr/lib/systemd/network/99-default.link
629           Parsed configuration file /etc/systemd/network/10-eth0.link
630           ID_NET_DRIVER=cdc_ether
631           Config file /etc/systemd/network/10-eth0.link applies to device hub0
632           link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
633           hub0: Device has name_assign_type=4
634           Using default interface naming scheme 'v240'.
635           hub0: Policies didn't yield a name, using specified Name=hub0.
636           ID_NET_LINK_FILE=/etc/systemd/network/10-eth0.link
637           ID_NET_NAME=hub0
638           ...
639
640       Explicit Name= configuration wins in this case.
641
642           sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/enp0s31f6
643           ...
644           Parsed configuration file /usr/lib/systemd/network/99-default.link
645           Parsed configuration file /etc/systemd/network/10-eth0.link
646           Created link configuration context.
647           ID_NET_DRIVER=e1000e
648           Config file /usr/lib/systemd/network/99-default.link applies to device enp0s31f6
649           link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
650           enp0s31f6: Device has name_assign_type=4
651           Using default interface naming scheme 'v240'.
652           enp0s31f6: Policy *keep*: keeping existing userspace name
653           enp0s31f6: Device has addr_assign_type=0
654           enp0s31f6: MAC on the device already matches policy *persistent*
655           ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
656           ...
657
658       In this case, the interface was already renamed, so the keep policy
659       specified as the first option in 99-default.link means that the
660       existing name is preserved. If keep was removed, or if were in boot
661       before the renaming has happened, we might get the following instead:
662
663           enp0s31f6: Policy *path* yields "enp0s31f6".
664           enp0s31f6: Device has addr_assign_type=0
665           enp0s31f6: MAC on the device already matches policy *persistent*
666           ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
667           ID_NET_NAME=enp0s31f6
668           ...
669
670       Please note that the details of output are subject to change.
671
672       Example 4. /etc/systemd/network/10-internet.link
673
674       This example assigns the fixed name "internet0" to the interface with
675       the device path "pci-0000:00:1a.0-*":
676
677           [Match]
678           Path=pci-0000:00:1a.0-*
679
680           [Link]
681           Name=internet0
682
683       Example 5. /etc/systemd/network/25-wireless.link
684
685       Here's an overly complex example that shows the use of a large number
686       of [Match] and [Link] settings.
687
688           [Match]
689           MACAddress=12:34:56:78:9a:bc
690           Driver=brcmsmac
691           Path=pci-0000:02:00.0-*
692           Type=wlan
693           Virtualization=no
694           Host=my-laptop
695           Architecture=x86-64
696
697           [Link]
698           Name=wireless0
699           MTUBytes=1450
700           BitsPerSecond=10M
701           WakeOnLan=magic
702           MACAddress=cb:a9:87:65:43:21
703

SEE ALSO

705       systemd-udevd.service(8), udevadm(8), systemd.netdev(5),
706       systemd.network(5)
707
708
709
710systemd 250                                                    SYSTEMD.LINK(5)
Impressum