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