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