]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd.link.xml
Merge pull request #19700 from keszybz/check-os-release-fixups
[thirdparty/systemd.git] / man / systemd.link.xml
1 <?xml version='1.0'?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
5
6 <refentry id="systemd.link">
7 <refentryinfo>
8 <title>systemd.link</title>
9 <productname>systemd</productname>
10 </refentryinfo>
11
12 <refmeta>
13 <refentrytitle>systemd.link</refentrytitle>
14 <manvolnum>5</manvolnum>
15 </refmeta>
16
17 <refnamediv>
18 <refname>systemd.link</refname>
19 <refpurpose>Network device configuration</refpurpose>
20 </refnamediv>
21
22 <refsynopsisdiv>
23 <para><filename><replaceable>link</replaceable>.link</filename></para>
24 </refsynopsisdiv>
25
26 <refsect1>
27 <title>Description</title>
28
29 <para>A plain ini-style text file that encodes configuration for matching network devices, used by
30 <citerefentry><refentrytitle>systemd-udevd</refentrytitle><manvolnum>8</manvolnum></citerefentry> and in
31 particular its <command>net_setup_link</command> builtin. See
32 <citerefentry><refentrytitle>systemd.syntax</refentrytitle><manvolnum>7</manvolnum></citerefentry> for a
33 general description of the syntax.</para>
34
35 <para>The link files are read from the files located in the system network directory
36 <filename>/usr/lib/systemd/network</filename>, the volatile runtime network directory
37 <filename>/run/systemd/network</filename>, and the local administration network directory
38 <filename>/etc/systemd/network</filename>. Link files must have the extension
39 <filename>.link</filename>; other extensions are ignored. All link files are collectively sorted
40 and processed in lexical order, regardless of the directories in which they live. However, files
41 with identical filenames replace each other. Files in <filename>/etc/</filename> have the highest
42 priority, files in <filename>/run/</filename> take precedence over files with the same name in
43 <filename>/usr/lib/</filename>. This can be used to override a system-supplied link file with a
44 local file if needed. As a special case, an empty file (file size 0) or symlink with the same name
45 pointing to <filename>/dev/null</filename> disables the configuration file entirely (it is
46 "masked").</para>
47
48 <para>Along with the link file <filename>foo.link</filename>, a "drop-in" directory
49 <filename>foo.link.d/</filename> may exist. All files with the suffix <literal>.conf</literal>
50 from this directory will be merged in the alphanumeric order and parsed after the main file itself
51 has been parsed. This is useful to alter or add configuration settings, without having to modify
52 the main configuration file. Each drop-in file must have appropriate section headers.</para>
53
54 <para>In addition to <filename>/etc/systemd/network</filename>, drop-in <literal>.d</literal>
55 directories can be placed in <filename>/usr/lib/systemd/network</filename> or
56 <filename>/run/systemd/network</filename> directories. Drop-in files in <filename>/etc/</filename>
57 take precedence over those in <filename>/run/</filename> which in turn take precedence over those
58 in <filename>/usr/lib/</filename>. Drop-in files under any of these directories take precedence
59 over the main link file wherever located.</para>
60
61 <para>The link file contains a [Match] section, which determines if a given link file may be applied to a
62 given device, as well as a [Link] section specifying how the device should be configured. The first (in
63 lexical order) of the link files that matches a given device is applied. Note that a default file
64 <filename>99-default.link</filename> is shipped by the system. Any user-supplied
65 <filename>.link</filename> should hence have a lexically earlier name to be considered at all.</para>
66
67 <para>See <citerefentry><refentrytitle>udevadm</refentrytitle><manvolnum>8</manvolnum></citerefentry> for
68 diagnosing problems with <filename>.link</filename> files.</para>
69 </refsect1>
70
71 <refsect1>
72 <title>[Match] Section Options</title>
73
74 <para>A link file is said to match a device if all matches specified by the
75 [Match] section are satisfied. When a link file does not contain valid settings
76 in [Match] section, then the file will match all devices and
77 <command>systemd-udevd</command> warns about that. Hint: to avoid the warning and to make it clear
78 that all interfaces shall be matched, add the following:
79 <programlisting>OriginalName=*</programlisting>
80 The following keys are accepted:</para>
81
82 <variablelist class='network-directives'>
83 <!-- This list is reused in systemd.network(3), hence maintain a specific order:
84 1. device matches shared between the two lists
85 2. non-shared settings
86 3. host matches shared between the two lists
87 -->
88
89 <varlistentry id='mac-address'>
90 <term><varname>MACAddress=</varname></term>
91 <listitem>
92 <para>A whitespace-separated list of hardware addresses. Use full colon-, hyphen- or dot-delimited hexadecimal. See the example below.
93 This option may appear more than once, in which case the lists are merged. If the empty string is assigned to this option, the list
94 of hardware addresses defined prior to this is reset.</para>
95
96 <para>Example:
97 <programlisting>MACAddress=01:23:45:67:89:ab 00-11-22-33-44-55 AABB.CCDD.EEFF</programlisting></para>
98 </listitem>
99 </varlistentry>
100
101 <varlistentry id='permanent-mac-address'>
102 <term><varname>PermanentMACAddress=</varname></term>
103 <listitem>
104 <para>A whitespace-separated list of hardware's permanent addresses. While
105 <varname>MACAddress=</varname> matches the device's current MAC address, this matches the
106 device's permanent MAC address, which may be different from the current one. Use full
107 colon-, hyphen- or dot-delimited hexadecimal. This option may appear more than once, in
108 which case the lists are merged. If the empty string is assigned to this option, the list
109 of hardware addresses defined prior to this is reset.</para>
110 </listitem>
111 </varlistentry>
112
113 <varlistentry id='path'>
114 <term><varname>Path=</varname></term>
115 <listitem>
116 <para>A whitespace-separated list of shell-style globs matching
117 the persistent path, as exposed by the udev property
118 <varname>ID_PATH</varname>.</para>
119 </listitem>
120 </varlistentry>
121
122 <varlistentry id='driver'>
123 <term><varname>Driver=</varname></term>
124 <listitem>
125 <para>A whitespace-separated list of shell-style globs matching the driver currently bound to the
126 device, as exposed by the udev property <varname>ID_NET_DRIVER</varname> of its parent device, or
127 if that is not set, the driver as exposed by <command>ethtool -i</command> of the device itself.
128 If the list is prefixed with a "!", the test is inverted.</para>
129 </listitem>
130 </varlistentry>
131
132 <varlistentry id='type'>
133 <term><varname>Type=</varname></term>
134 <listitem>
135 <para>A whitespace-separated list of shell-style globs matching the device type, as exposed by
136 <command>networkctl list</command>. If the list is prefixed with a "!", the test is inverted.
137 Some valid values are <literal>ether</literal>, <literal>loopback</literal>, <literal>wlan</literal>, <literal>wwan</literal>.
138 Valid types are named either from the udev <literal>DEVTYPE</literal> attribute, or
139 <literal>ARPHRD_</literal> macros in <filename>linux/if_arp.h</filename>, so this is not comprehensive.
140 </para>
141 </listitem>
142 </varlistentry>
143
144 <varlistentry id='property'>
145 <term><varname>Property=</varname></term>
146 <listitem>
147 <para>A whitespace-separated list of udev property name with its value after a equal
148 (<literal>=</literal>). If multiple properties are specified, the test results are ANDed.
149 If the list is prefixed with a "!", the test is inverted. If a value contains white
150 spaces, then please quote whole key and value pair. If a value contains quotation, then
151 please escape the quotation with <literal>\</literal>.</para>
152
153 <para>Example: if a .link file has the following:
154 <programlisting>Property=ID_MODEL_ID=9999 "ID_VENDOR_FROM_DATABASE=vendor name" "KEY=with \"quotation\""</programlisting>
155 then, the .link file matches only when an interface has all the above three properties.
156 </para>
157 </listitem>
158 </varlistentry>
159
160 <varlistentry>
161 <term><varname>OriginalName=</varname></term>
162 <listitem>
163 <para>A whitespace-separated list of shell-style globs matching the device name, as exposed by the
164 udev property "INTERFACE". This cannot be used to match on names that have already been changed
165 from userspace. Caution is advised when matching on kernel-assigned names, as they are known to be
166 unstable between reboots.</para>
167 </listitem>
168 </varlistentry>
169
170 <varlistentry id='host'>
171 <term><varname>Host=</varname></term>
172 <listitem>
173 <para>Matches against the hostname or machine ID of the host. See <varname>ConditionHost=</varname> in
174 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
175 for details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated.
176 If an empty string is assigned, then previously assigned value is cleared.
177 </para>
178 </listitem>
179 </varlistentry>
180
181 <varlistentry id='virtualization'>
182 <term><varname>Virtualization=</varname></term>
183 <listitem>
184 <para>Checks whether the system is executed in a virtualized environment and optionally test
185 whether it is a specific implementation. See <varname>ConditionVirtualization=</varname> in
186 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
187 for details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated.
188 If an empty string is assigned, then previously assigned value is cleared.
189 </para>
190 </listitem>
191 </varlistentry>
192
193 <varlistentry id='kernel-command-line'>
194 <term><varname>KernelCommandLine=</varname></term>
195 <listitem>
196 <para>Checks whether a specific kernel command line option is set. See
197 <varname>ConditionKernelCommandLine=</varname> in
198 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
199 for details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated.
200 If an empty string is assigned, then previously assigned value is cleared.
201 </para>
202 </listitem>
203 </varlistentry>
204
205 <varlistentry id='kernel-version'>
206 <term><varname>KernelVersion=</varname></term>
207 <listitem>
208 <para>Checks whether the kernel version (as reported by <command>uname -r</command>) matches a certain
209 expression. See <varname>ConditionKernelVersion=</varname> in
210 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
211 details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated.
212 If an empty string is assigned, then previously assigned value is cleared.
213 </para>
214 </listitem>
215 </varlistentry>
216
217 <varlistentry id='architecture'>
218 <term><varname>Architecture=</varname></term>
219 <listitem>
220 <para>Checks whether the system is running on a specific architecture. See
221 <varname>ConditionArchitecture=</varname> in
222 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
223 for details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated.
224 If an empty string is assigned, then previously assigned value is cleared.
225 </para>
226 </listitem>
227 </varlistentry>
228
229 <varlistentry id='firmware'>
230 <term><varname>Firmware=</varname></term>
231 <listitem>
232 <para>Checks whether the system is running on a machine with the specified firmware. See
233 <varname>ConditionFirmware=</varname> in
234 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
235 for details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated.
236 If an empty string is assigned, then previously assigned value is cleared.
237 </para>
238 </listitem>
239 </varlistentry>
240 </variablelist>
241
242 </refsect1>
243
244 <refsect1>
245 <title>[Link] Section Options</title>
246
247 <para>The [Link] section accepts the following
248 keys:</para>
249
250 <variablelist class='network-directives'>
251 <varlistentry>
252 <term><varname>Description=</varname></term>
253 <listitem>
254 <para>A description of the device.</para>
255 </listitem>
256 </varlistentry>
257 <varlistentry>
258 <term><varname>Alias=</varname></term>
259 <listitem>
260 <para>The <varname>ifalias</varname> interface property is set to this value.</para>
261 </listitem>
262 </varlistentry>
263 <varlistentry>
264 <term><varname>MACAddressPolicy=</varname></term>
265 <listitem>
266 <para>The policy by which the MAC address should be set. The
267 available policies are:
268 </para>
269
270 <variablelist>
271 <varlistentry>
272 <term><option>persistent</option></term>
273 <listitem>
274 <para>If the hardware has a persistent MAC address, as
275 most hardware should, and if it is used by the kernel,
276 nothing is done. Otherwise, a new MAC address is
277 generated which is guaranteed to be the same on every
278 boot for the given machine and the given device, but
279 which is otherwise random. This feature depends on ID_NET_NAME_*
280 properties to exist for the link. On hardware where these
281 properties are not set, the generation of a persistent MAC address
282 will fail.</para>
283 </listitem>
284 </varlistentry>
285 <varlistentry>
286 <term><option>random</option></term>
287 <listitem>
288 <para>If the kernel is using a random MAC address,
289 nothing is done. Otherwise, a new address is randomly
290 generated each time the device appears, typically at
291 boot. Either way, the random address will have the
292 <literal>unicast</literal> and
293 <literal>locally administered</literal> bits set.</para>
294 </listitem>
295 </varlistentry>
296 <varlistentry>
297 <term><option>none</option></term>
298 <listitem>
299 <para>Keeps the MAC address assigned by the kernel. Or use the MAC address specified in
300 <varname>MACAddress=</varname>.</para>
301 </listitem>
302 </varlistentry>
303 </variablelist>
304
305 <para>An empty string assignment is equivalent to setting <literal>none</literal>.</para>
306 </listitem>
307 </varlistentry>
308 <varlistentry>
309 <term><varname>MACAddress=</varname></term>
310 <listitem>
311 <para>The interface MAC address to use. For this setting to take effect,
312 <varname>MACAddressPolicy=</varname> must either be unset, empty, or <literal>none</literal>.
313 </para>
314 </listitem>
315 </varlistentry>
316 <varlistentry>
317 <term><varname>NamePolicy=</varname></term>
318 <listitem>
319 <para>An ordered, space-separated list of policies by which the interface name should be set.
320 <varname>NamePolicy=</varname> may be disabled by specifying <option>net.ifnames=0</option> on the
321 kernel command line. Each of the policies may fail, and the first successful one is used. The name
322 is not set directly, but is exported to udev as the property <option>ID_NET_NAME</option>, which
323 is, by default, used by a
324 <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
325 rule to set <varname>NAME</varname>. The available policies are:
326 </para>
327
328 <variablelist>
329 <varlistentry>
330 <term><option>kernel</option></term>
331 <listitem>
332 <para>If the kernel claims that the name it has set
333 for a device is predictable, then no renaming is
334 performed.</para>
335 </listitem>
336 </varlistentry>
337 <varlistentry>
338 <term><option>database</option></term>
339 <listitem>
340 <para>The name is set based on entries in the udev's
341 Hardware Database with the key
342 <varname>ID_NET_NAME_FROM_DATABASE</varname>.
343 </para>
344 </listitem>
345 </varlistentry>
346 <varlistentry>
347 <term><option>onboard</option></term>
348 <listitem>
349 <para>The name is set based on information given by
350 the firmware for on-board devices, as exported by the
351 udev property <varname>ID_NET_NAME_ONBOARD</varname>.
352 See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
353 </para>
354 </listitem>
355 </varlistentry>
356 <varlistentry>
357 <term><option>slot</option></term>
358 <listitem>
359 <para>The name is set based on information given by
360 the firmware for hot-plug devices, as exported by the
361 udev property <varname>ID_NET_NAME_SLOT</varname>.
362 See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
363 </para>
364 </listitem>
365 </varlistentry>
366 <varlistentry>
367 <term><option>path</option></term>
368 <listitem>
369 <para>The name is set based on the device's physical
370 location, as exported by the udev property
371 <varname>ID_NET_NAME_PATH</varname>.
372 See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
373 </para>
374 </listitem>
375 </varlistentry>
376 <varlistentry>
377 <term><option>mac</option></term>
378 <listitem>
379 <para>The name is set based on the device's persistent
380 MAC address, as exported by the udev property
381 <varname>ID_NET_NAME_MAC</varname>.
382 See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
383 </para>
384 </listitem>
385 </varlistentry>
386 <varlistentry>
387 <term><option>keep</option></term>
388 <listitem>
389 <para>If the device already had a name given by userspace (as part of creation of the device
390 or a rename), keep it.</para>
391 </listitem>
392 </varlistentry>
393 </variablelist>
394 </listitem>
395 </varlistentry>
396 <varlistentry>
397 <term><varname>Name=</varname></term>
398 <listitem>
399 <para>The interface name to use. This option has lower precedence than
400 <varname>NamePolicy=</varname>, so for this setting to take effect, <varname>NamePolicy=</varname>
401 must either be unset, empty, disabled, or all policies configured there must fail. Also see the
402 example below with <literal>Name=dmz0</literal>.</para>
403
404 <para>Note that specifying a name that the kernel might use for another
405 interface (for example <literal>eth0</literal>) is dangerous because the
406 name assignment done by udev will race with the assignment done by the
407 kernel, and only one interface may use the name. Depending on the order of
408 operations, either udev or the kernel will win, making the naming
409 unpredictable. It is best to use some different prefix, for example
410 <literal>internal0</literal>/<literal>external0</literal> or
411 <literal>lan0</literal>/<literal>lan1</literal>/<literal>lan3</literal>.
412 </para>
413 </listitem>
414 </varlistentry>
415 <varlistentry>
416 <term><varname>AlternativeNamesPolicy=</varname></term>
417 <listitem>
418 <para>A space-separated list of policies by which the interface's alternative names
419 should be set. Each of the policies may fail, and all successful policies are used. The
420 available policies are <literal>database</literal>, <literal>onboard</literal>,
421 <literal>slot</literal>, <literal>path</literal>, and <literal>mac</literal>. If the
422 kernel does not support the alternative names, then this setting will be ignored.
423 </para>
424 </listitem>
425 </varlistentry>
426 <varlistentry>
427 <term><varname>AlternativeName=</varname></term>
428 <listitem>
429 <para>The alternative interface name to use. This option can be specified multiple times.
430 If the empty string is assigned to this option, the list is reset, and all prior assignments
431 have no effect. If the kernel does not support the alternative names, then this setting will
432 be ignored.</para>
433 </listitem>
434 </varlistentry>
435 <varlistentry>
436 <term><varname>TransmitQueues=</varname></term>
437 <listitem>
438 <para>Specifies the device's number of transmit queues. An integer in the range 14096.
439 When unset, the kernel's default will be used.</para>
440 </listitem>
441 </varlistentry>
442 <varlistentry>
443 <term><varname>ReceiveQueues=</varname></term>
444 <listitem>
445 <para>Specifies the device's number of receive queues. An integer in the range 14096.
446 When unset, the kernel's default will be used.</para>
447 </listitem>
448 </varlistentry>
449 <varlistentry>
450 <term><varname>TransmitQueueLength=</varname></term>
451 <listitem>
452 <para>Specifies the transmit queue length of the device in number of packets. An unsigned integer
453 in the range 04294967294. When unset, the kernel's default will be used.</para>
454 </listitem>
455 </varlistentry>
456 <varlistentry>
457 <term><varname>MTUBytes=</varname></term>
458 <listitem>
459 <para>The maximum transmission unit in bytes to set for the
460 device. The usual suffixes K, M, G, are supported and are
461 understood to the base of 1024.</para>
462 </listitem>
463 </varlistentry>
464 <varlistentry>
465 <term><varname>BitsPerSecond=</varname></term>
466 <listitem>
467 <para>The speed to set for the device, the value is rounded
468 down to the nearest Mbps. The usual suffixes K, M, G, are
469 supported and are understood to the base of 1000.</para>
470 </listitem>
471 </varlistentry>
472 <varlistentry>
473 <term><varname>Duplex=</varname></term>
474 <listitem>
475 <para>The duplex mode to set for the device. The accepted values are <option>half</option> and
476 <option>full</option>.</para>
477 </listitem>
478 </varlistentry>
479 <varlistentry>
480 <term><varname>AutoNegotiation=</varname></term>
481 <listitem>
482 <para>Takes a boolean. If set to yes, automatic negotiation of transmission parameters is enabled.
483 Autonegotiation is a procedure by which two connected ethernet devices choose
484 common transmission parameters, such as speed, duplex mode, and flow control.
485 When unset, the kernel's default will be used.</para>
486
487 <para>Note that if autonegotiation is enabled, speed and duplex settings are
488 read-only. If autonegotiation is disabled, speed and duplex settings are writable
489 if the driver supports multiple link modes.</para>
490 </listitem>
491 </varlistentry>
492 <varlistentry>
493 <term><varname>WakeOnLan=</varname></term>
494 <listitem>
495 <para>The Wake-on-LAN policy to set for the device. The
496 supported values are:</para>
497
498 <variablelist>
499 <varlistentry>
500 <term><option>phy</option></term>
501 <listitem>
502 <para>Wake on PHY activity.</para>
503 </listitem>
504 </varlistentry>
505 <varlistentry>
506 <term><option>unicast</option></term>
507 <listitem>
508 <para>Wake on unicast messages.</para>
509 </listitem>
510 </varlistentry>
511 <varlistentry>
512 <term><option>multicast</option></term>
513 <listitem>
514 <para>Wake on multicast messages.</para>
515 </listitem>
516 </varlistentry>
517 <varlistentry>
518 <term><option>broadcast</option></term>
519 <listitem>
520 <para>Wake on broadcast messages.</para>
521 </listitem>
522 </varlistentry>
523 <varlistentry>
524 <term><option>arp</option></term>
525 <listitem>
526 <para>Wake on ARP.</para>
527 </listitem>
528 </varlistentry>
529 <varlistentry>
530 <term><option>magic</option></term>
531 <listitem>
532 <para>Wake on receipt of a magic packet.
533 </para>
534 </listitem>
535 </varlistentry>
536 <varlistentry>
537 <term><option>secureon</option></term>
538 <listitem>
539 <para>Enable secureon(tm) password for MagicPacket(tm).
540 </para>
541 </listitem>
542 </varlistentry>
543 <varlistentry>
544 <term><option>off</option></term>
545 <listitem>
546 <para>Never wake.</para>
547 </listitem>
548 </varlistentry>
549 </variablelist>
550
551 <para>Defaults to <option>off</option>.</para>
552 </listitem>
553 </varlistentry>
554 <varlistentry>
555 <term><varname>Port=</varname></term>
556 <listitem>
557 <para>The port option is used to select the device port. The
558 supported values are:</para>
559
560 <variablelist>
561 <varlistentry>
562 <term><option>tp</option></term>
563 <listitem>
564 <para>An Ethernet interface using Twisted-Pair cable as the medium.</para>
565 </listitem>
566 </varlistentry>
567 <varlistentry>
568 <term><option>aui</option></term>
569 <listitem>
570 <para>Attachment Unit Interface (AUI). Normally used with hubs.
571 </para>
572 </listitem>
573 </varlistentry>
574 <varlistentry>
575 <term><option>bnc</option></term>
576 <listitem>
577 <para>An Ethernet interface using BNC connectors and co-axial cable.</para>
578 </listitem>
579 </varlistentry>
580 <varlistentry>
581 <term><option>mii</option></term>
582 <listitem>
583 <para>An Ethernet interface using a Media Independent Interface (MII).</para>
584 </listitem>
585 </varlistentry>
586 <varlistentry>
587 <term><option>fibre</option></term>
588 <listitem>
589 <para>An Ethernet interface using Optical Fibre as the medium.</para>
590 </listitem>
591 </varlistentry>
592 </variablelist>
593 </listitem>
594 </varlistentry>
595 <varlistentry>
596 <term><varname>Advertise=</varname></term>
597 <listitem>
598 <para>This sets what speeds and duplex modes of operation are advertised for auto-negotiation.
599 This implies <literal>AutoNegotiation=yes</literal>. The supported values are:
600
601 <table>
602 <title>Supported advertise values</title>
603 <tgroup cols='3'>
604 <colspec colname='Advertise' />
605 <colspec colname='Speed' />
606 <colspec colname='Duplex Mode' />
607
608 <thead><row>
609 <entry>Advertise</entry>
610 <entry>Speed (Mbps)</entry>
611 <entry>Duplex Mode</entry>
612 </row></thead>
613 <tbody>
614 <row><entry><option>10baset-half</option></entry>
615 <entry>10</entry><entry>half</entry></row>
616
617 <row><entry><option>10baset-full</option></entry>
618 <entry>10</entry><entry>full</entry></row>
619
620 <row><entry><option>100baset-half</option></entry>
621 <entry>100</entry><entry>half</entry></row>
622
623 <row><entry><option>100baset-full</option></entry>
624 <entry>100</entry><entry>full</entry></row>
625
626 <row><entry><option>1000baset-half</option></entry>
627 <entry>1000</entry><entry>half</entry></row>
628
629 <row><entry><option>1000baset-full</option></entry>
630 <entry>1000</entry><entry>full</entry></row>
631
632 <row><entry><option>10000baset-full</option></entry>
633 <entry>10000</entry><entry>full</entry></row>
634
635 <row><entry><option>2500basex-full</option></entry>
636 <entry>2500</entry><entry>full</entry></row>
637
638 <row><entry><option>1000basekx-full</option></entry>
639 <entry>1000</entry><entry>full</entry></row>
640
641 <row><entry><option>10000basekx4-full</option></entry>
642 <entry>10000</entry><entry>full</entry></row>
643
644 <row><entry><option>10000basekr-full</option></entry>
645 <entry>10000</entry><entry>full</entry></row>
646
647 <row><entry><option>10000baser-fec</option></entry>
648 <entry>10000</entry><entry>full</entry></row>
649
650 <row><entry><option>20000basemld2-full</option></entry>
651 <entry>20000</entry><entry>full</entry></row>
652
653 <row><entry><option>20000basekr2-full</option></entry>
654 <entry>20000</entry><entry>full</entry></row>
655 </tbody>
656 </tgroup>
657 </table>
658
659 By default this is unset, i.e. all possible modes will be advertised.
660 This option may be specified more than once, in which case all specified speeds and modes are advertised.
661 If the empty string is assigned to this option, the list is reset, and all prior assignments have no effect.
662 </para>
663 </listitem>
664 </varlistentry>
665 <varlistentry>
666 <term><varname>ReceiveChecksumOffload=</varname></term>
667 <listitem>
668 <para>Takes a boolean. If set to true, the hardware offload for checksumming of ingress
669 network packets is enabled. When unset, the kernel's default will be used.</para>
670 </listitem>
671 </varlistentry>
672 <varlistentry>
673 <term><varname>TransmitChecksumOffload=</varname></term>
674 <listitem>
675 <para>Takes a boolean. If set to true, the hardware offload for checksumming of egress
676 network packets is enabled. When unset, the kernel's default will be used.</para>
677 </listitem>
678 </varlistentry>
679 <varlistentry>
680 <term><varname>TCPSegmentationOffload=</varname></term>
681 <listitem>
682 <para>Takes a boolean. If set to true, the TCP Segmentation Offload (TSO) is enabled.
683 When unset, the kernel's default will be used.</para>
684 </listitem>
685 </varlistentry>
686 <varlistentry>
687 <term><varname>TCP6SegmentationOffload=</varname></term>
688 <listitem>
689 <para>Takes a boolean. If set to true, the TCP6 Segmentation Offload (tx-tcp6-segmentation) is enabled.
690 When unset, the kernel's default will be used.</para>
691 </listitem>
692 </varlistentry>
693 <varlistentry>
694 <term><varname>GenericSegmentationOffload=</varname></term>
695 <listitem>
696 <para>Takes a boolean. If set to true, the Generic Segmentation Offload (GSO) is enabled.
697 When unset, the kernel's default will be used.</para>
698 </listitem>
699 </varlistentry>
700 <varlistentry>
701 <term><varname>GenericReceiveOffload=</varname></term>
702 <listitem>
703 <para>Takes a boolean. If set to true, the Generic Receive Offload (GRO) is enabled.
704 When unset, the kernel's default will be used.</para>
705 </listitem>
706 </varlistentry>
707 <varlistentry>
708 <term><varname>LargeReceiveOffload=</varname></term>
709 <listitem>
710 <para>Takes a boolean. If set to true, the Large Receive Offload (LRO) is enabled.
711 When unset, the kernel's default will be used.</para>
712 </listitem>
713 </varlistentry>
714 <varlistentry>
715 <term><varname>RxChannels=</varname></term>
716 <listitem>
717 <para>Sets the number of receive channels (a number between 1 and 4294967295) .</para>
718 </listitem>
719 </varlistentry>
720 <varlistentry>
721 <term><varname>TxChannels=</varname></term>
722 <listitem>
723 <para>Sets the number of transmit channels (a number between 1 and 4294967295).</para>
724 </listitem>
725 </varlistentry>
726 <varlistentry>
727 <term><varname>OtherChannels=</varname></term>
728 <listitem>
729 <para>Sets the number of other channels (a number between 1 and 4294967295).</para>
730 </listitem>
731 </varlistentry>
732 <varlistentry>
733 <term><varname>CombinedChannels=</varname></term>
734 <listitem>
735 <para>Sets the number of combined set channels (a number between 1 and 4294967295).</para>
736 </listitem>
737 </varlistentry>
738 <varlistentry>
739 <term><varname>RxBufferSize=</varname></term>
740 <listitem>
741 <para>Takes an integer. Specifies the maximum number of pending packets in the NIC receive buffer.
742 When unset, the kernel's default will be used.</para>
743 </listitem>
744 </varlistentry>
745 <varlistentry>
746 <term><varname>RxMiniBufferSize=</varname></term>
747 <listitem>
748 <para>Takes an integer. Specifies the maximum number of pending packets in the NIC mini receive buffer.
749 When unset, the kernel's default will be used.</para>
750 </listitem>
751 </varlistentry>
752 <varlistentry>
753 <term><varname>RxJumboBufferSize=</varname></term>
754 <listitem>
755 <para>Takes an integer. Specifies the maximum number of pending packets in the NIC jumbo receive buffer.
756 When unset, the kernel's default will be used.</para>
757 </listitem>
758 </varlistentry>
759 <varlistentry>
760 <term><varname>TxBufferSize=</varname></term>
761 <listitem>
762 <para>Takes an integer. Specifies the maximum number of pending packets in the NIC transmit buffer.
763 When unset, the kernel's default will be used.</para>
764 </listitem>
765 </varlistentry>
766 <varlistentry>
767 <term><varname>RxFlowControl=</varname></term>
768 <listitem>
769 <para>Takes a boolean. When set, enables the receive flow control, also known as the ethernet
770 receive PAUSE message (generate and send ethernet PAUSE frames). When unset, the kernel's
771 default will be used.</para>
772 </listitem>
773 </varlistentry>
774 <varlistentry>
775 <term><varname>TxFlowControl=</varname></term>
776 <listitem>
777 <para>Takes a boolean. When set, enables the transmit flow control, also known as the ethernet
778 transmit PAUSE message (respond to received ethernet PAUSE frames). When unset, the kernel's
779 default will be used.</para>
780 </listitem>
781 </varlistentry>
782 <varlistentry>
783 <term><varname>AutoNegotiationFlowControl=</varname></term>
784 <listitem>
785 <para>Takes a boolean. When set, the auto negotiation enables the interface to exchange state
786 advertisements with the connected peer so that the two devices can agree on the ethernet
787 PAUSE configuration. When unset, the kernel's default will be used.</para>
788 </listitem>
789 </varlistentry>
790 <varlistentry>
791 <term><varname>GenericSegmentOffloadMaxBytes=</varname></term>
792 <listitem>
793 <para>Specifies the maximum size of a Generic Segment Offload (GSO) packet the
794 device should accept. The usual suffixes K, M, G, are supported and are
795 understood to the base of 1024. An unsigned integer in the range 165536.
796 Defaults to unset.</para>
797 </listitem>
798 </varlistentry>
799 <varlistentry>
800 <term><varname>GenericSegmentOffloadMaxSegments=</varname></term>
801 <listitem>
802 <para>Specifies the maximum number of a Generic Segment Offload (GSO) segments the device should
803 accept. An unsigned integer in the range 165535. Defaults to unset.</para>
804 </listitem>
805 </varlistentry>
806
807 </variablelist>
808 </refsect1>
809
810 <refsect1>
811 <title>Examples</title>
812
813 <example>
814 <title>/usr/lib/systemd/network/99-default.link</title>
815
816 <para>The link file <filename>99-default.link</filename> that is
817 shipped with systemd defines the default naming policy for
818 links.</para>
819
820 <programlisting>[Link]
821 NamePolicy=kernel database onboard slot path
822 MACAddressPolicy=persistent</programlisting>
823 </example>
824
825 <example>
826 <title>/etc/systemd/network/10-dmz.link</title>
827
828 <para>This example assigns the fixed name <literal>dmz0</literal> to the interface with the MAC address
829 00:a0:de:63:7a:e6:</para>
830
831 <programlisting>[Match]
832 MACAddress=00:a0:de:63:7a:e6
833
834 [Link]
835 Name=dmz0</programlisting>
836
837 <para><varname>NamePolicy=</varname> is not set, so <varname>Name=</varname> takes effect. We use the
838 <literal>10-</literal> prefix to order this file early in the list. Note that it needs to be before
839 <literal>99-link</literal>, i.e. it needs a numerical prefix, to have any effect at all.</para>
840 </example>
841
842 <example>
843 <title>Debugging <varname>NamePolicy=</varname> assignments</title>
844
845 <programlisting>$ sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/hub0
846
847 Parsed configuration file /usr/lib/systemd/network/99-default.link
848 Parsed configuration file /etc/systemd/network/10-eth0.link
849 ID_NET_DRIVER=cdc_ether
850 Config file /etc/systemd/network/10-eth0.link applies to device hub0
851 link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
852 hub0: Device has name_assign_type=4
853 Using default interface naming scheme 'v240'.
854 hub0: Policies didn't yield a name, using specified Name=hub0.
855 ID_NET_LINK_FILE=/etc/systemd/network/10-eth0.link
856 ID_NET_NAME=hub0
857</programlisting>
858
859 <para>Explicit <varname>Name=</varname> configuration wins in this case.</para>
860
861 <programlisting>sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/enp0s31f6
862
863 Parsed configuration file /usr/lib/systemd/network/99-default.link
864 Parsed configuration file /etc/systemd/network/10-eth0.link
865 Created link configuration context.
866 ID_NET_DRIVER=e1000e
867 Config file /usr/lib/systemd/network/99-default.link applies to device enp0s31f6
868 link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
869 enp0s31f6: Device has name_assign_type=4
870 Using default interface naming scheme 'v240'.
871 enp0s31f6: Policy *keep*: keeping existing userspace name
872 enp0s31f6: Device has addr_assign_type=0
873 enp0s31f6: MAC on the device already matches policy *persistent*
874 ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
875
876 </programlisting>
877
878 <para>In this case, the interface was already renamed, so the <option>keep</option> policy specified as
879 the first option in <filename index="false">99-default.link</filename> means that the existing name is
880 preserved. If <option>keep</option> was removed, or if were in boot before the renaming has happened,
881 we might get the following instead:</para>
882
883 <programlisting>enp0s31f6: Policy *path* yields "enp0s31f6".
884 enp0s31f6: Device has addr_assign_type=0
885 enp0s31f6: MAC on the device already matches policy *persistent*
886 ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
887 ID_NET_NAME=enp0s31f6
888
889 </programlisting>
890
891 <para>Please note that the details of output are subject to change.</para>
892 </example>
893
894 <example>
895 <title>/etc/systemd/network/10-internet.link</title>
896
897 <para>This example assigns the fixed name
898 <literal>internet0</literal> to the interface with the device
899 path <literal>pci-0000:00:1a.0-*</literal>:</para>
900
901 <programlisting>[Match]
902 Path=pci-0000:00:1a.0-*
903
904 [Link]
905 Name=internet0</programlisting>
906 </example>
907
908 <example>
909 <title>/etc/systemd/network/25-wireless.link</title>
910
911 <para>Here's an overly complex example that shows the use of a large number of [Match] and [Link] settings.</para>
912
913 <programlisting>[Match]
914 MACAddress=12:34:56:78:9a:bc
915 Driver=brcmsmac
916 Path=pci-0000:02:00.0-*
917 Type=wlan
918 Virtualization=no
919 Host=my-laptop
920 Architecture=x86-64
921
922 [Link]
923 Name=wireless0
924 MTUBytes=1450
925 BitsPerSecond=10M
926 WakeOnLan=magic
927 MACAddress=cb:a9:87:65:43:21</programlisting>
928 </example>
929 </refsect1>
930
931 <refsect1>
932 <title>See Also</title>
933 <para>
934 <citerefentry>
935 <refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum>
936 </citerefentry>,
937 <citerefentry>
938 <refentrytitle>udevadm</refentrytitle><manvolnum>8</manvolnum>
939 </citerefentry>,
940 <citerefentry>
941 <refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum>
942 </citerefentry>,
943 <citerefentry>
944 <refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum>
945 </citerefentry>
946 </para>
947 </refsect1>
948
949 </refentry>