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