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