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