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