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