]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd.link.xml
sysusers: add support for a --image= switch
[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
d4de2b2a 29 <para>A plain ini-style text file that encodes configuration for matching network devices, used by
55cf7779 30 <citerefentry><refentrytitle>systemd-udevd</refentrytitle><manvolnum>8</manvolnum></citerefentry> and in
d4de2b2a 31 particular its <command>net_setup_link</command> builtin. See
675fa6ea 32 <citerefentry><refentrytitle>systemd.syntax</refentrytitle><manvolnum>7</manvolnum></citerefentry> for a
d4de2b2a 33 general description of the syntax.</para>
1ff28eae 34
798d3a52 35 <para>The link files are read from the files located in the system
12b42c76 36 network directory <filename>/usr/lib/systemd/network</filename>,
798d3a52
ZJS
37 the volatile runtime network directory
38 <filename>/run/systemd/network</filename>, and the local
39 administration network directory
12b42c76 40 <filename>/etc/systemd/network</filename>. Link files must have
798d3a52
ZJS
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
12b42c76 47 name in <filename>/usr/lib</filename>. This can be used to
57e27ec0
ZJS
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
a8eaaee7 50 same name pointing to <filename>/dev/null</filename> disables the
57e27ec0 51 configuration file entirely (it is "masked").</para>
1ff28eae 52
d7dce7b6
ZJS
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>
798d3a52 61 </refsect1>
102bd40e 62
798d3a52
ZJS
63 <refsect1>
64 <title>[Match] Section Options</title>
1ff28eae 65
84ea567e 66 <para>A link file is said to match a device if all matches specified by the
bdac5608
ZJS
67 [Match] section are satisfied. When a link file does not contain valid settings
68 in [Match] section, then the file will match all devices and
84ea567e
YW
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>
1ff28eae 73
798d3a52 74 <variablelist class='network-directives'>
d9b20454
ZJS
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'>
798d3a52
ZJS
82 <term><varname>MACAddress=</varname></term>
83 <listitem>
9310bf4b
YW
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>
798d3a52
ZJS
90 </listitem>
91 </varlistentry>
d9b20454
ZJS
92
93 <varlistentry id='permanent-mac-address'>
4bb7cc82
YW
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>
d9b20454
ZJS
104
105 <varlistentry id='path'>
798d3a52
ZJS
106 <term><varname>Path=</varname></term>
107 <listitem>
5256e00e
TG
108 <para>A whitespace-separated list of shell-style globs matching
109 the persistent path, as exposed by the udev property
d7dce7b6 110 <varname>ID_PATH</varname>.</para>
798d3a52
ZJS
111 </listitem>
112 </varlistentry>
d9b20454
ZJS
113
114 <varlistentry id='driver'>
798d3a52
ZJS
115 <term><varname>Driver=</varname></term>
116 <listitem>
d7dce7b6 117 <para>A whitespace-separated list of shell-style globs matching the driver currently bound to the
d9b20454
ZJS
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>
798d3a52
ZJS
121 </listitem>
122 </varlistentry>
d9b20454
ZJS
123
124 <varlistentry id='type'>
798d3a52
ZJS
125 <term><varname>Type=</varname></term>
126 <listitem>
ef62949a
YW
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>
798d3a52
ZJS
130 </listitem>
131 </varlistentry>
d9b20454
ZJS
132
133 <varlistentry id='property'>
44005bfb
YW
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>
d9b20454 148
798d3a52 149 <varlistentry>
d9b20454
ZJS
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'>
798d3a52
ZJS
160 <term><varname>Host=</varname></term>
161 <listitem>
d689bbca 162 <para>Matches against the hostname or machine ID of the host. See <varname>ConditionHost=</varname> in
798d3a52 163 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
d689bbca
YW
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>
798d3a52
ZJS
167 </listitem>
168 </varlistentry>
d9b20454
ZJS
169
170 <varlistentry id='virtualization'>
798d3a52
ZJS
171 <term><varname>Virtualization=</varname></term>
172 <listitem>
d689bbca
YW
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
798d3a52 175 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
d689bbca
YW
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>
798d3a52
ZJS
179 </listitem>
180 </varlistentry>
d9b20454
ZJS
181
182 <varlistentry id='kernel-command-line'>
798d3a52
ZJS
183 <term><varname>KernelCommandLine=</varname></term>
184 <listitem>
d689bbca 185 <para>Checks whether a specific kernel command line option is set. See
d7dce7b6 186 <varname>ConditionKernelCommandLine=</varname> in
798d3a52 187 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
d689bbca
YW
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>
d9b20454
ZJS
193
194 <varlistentry id='kernel-version'>
d689bbca
YW
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>
798d3a52
ZJS
203 </listitem>
204 </varlistentry>
d9b20454
ZJS
205
206 <varlistentry id='architecture'>
798d3a52
ZJS
207 <term><varname>Architecture=</varname></term>
208 <listitem>
d689bbca
YW
209 <para>Checks whether the system is running on a specific architecture. See
210 <varname>ConditionArchitecture=</varname> in
798d3a52 211 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
d689bbca
YW
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>
798d3a52
ZJS
215 </listitem>
216 </varlistentry>
217 </variablelist>
1ff28eae 218
798d3a52 219 </refsect1>
102bd40e 220
798d3a52
ZJS
221 <refsect1>
222 <title>[Link] Section Options</title>
102bd40e 223
d7dce7b6 224 <para>The [Link] section accepts the following
798d3a52 225 keys:</para>
1ff28eae 226
798d3a52
ZJS
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>
d7dce7b6 237 <para>The <varname>ifalias</varname> interface property is set to this value.</para>
798d3a52
ZJS
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>
1ff28eae 246
798d3a52
ZJS
247 <variablelist>
248 <varlistentry>
d7dce7b6 249 <term><option>persistent</option></term>
798d3a52
ZJS
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
1c25683e 256 which is otherwise random. This feature depends on ID_NET_NAME_*
a8eaaee7 257 properties to exist for the link. On hardware where these
b938cb90 258 properties are not set, the generation of a persistent MAC address
1c25683e 259 will fail.</para>
798d3a52
ZJS
260 </listitem>
261 </varlistentry>
262 <varlistentry>
d7dce7b6 263 <term><option>random</option></term>
798d3a52
ZJS
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
b938cb90 268 boot. Either way, the random address will have the
2e229e0c
TG
269 <literal>unicast</literal> and
270 <literal>locally administered</literal> bits set.</para>
798d3a52
ZJS
271 </listitem>
272 </varlistentry>
66d3752e 273 <varlistentry>
d7dce7b6 274 <term><option>none</option></term>
66d3752e
JK
275 <listitem>
276 <para>Keeps the MAC address assigned by the kernel.</para>
277 </listitem>
278 </varlistentry>
798d3a52
ZJS
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
d7dce7b6 286 <varname>MACAddressPolicy=</varname>
798d3a52
ZJS
287 is specified.</para>
288 </listitem>
289 </varlistentry>
290 <varlistentry>
291 <term><varname>NamePolicy=</varname></term>
292 <listitem>
3907446f 293 <para>An ordered, space-separated list of policies by which the interface name should be set.
d7dce7b6 294 <varname>NamePolicy=</varname> may be disabled by specifying <option>net.ifnames=0</option> on the
58576937 295 kernel command line. Each of the policies may fail, and the first successful one is used. The name
d7dce7b6 296 is not set directly, but is exported to udev as the property <option>ID_NET_NAME</option>, which
58576937
ZJS
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:
3907446f 300 </para>
1ff28eae 301
798d3a52
ZJS
302 <variablelist>
303 <varlistentry>
d7dce7b6 304 <term><option>kernel</option></term>
798d3a52
ZJS
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>
d7dce7b6 312 <term><option>database</option></term>
798d3a52
ZJS
313 <listitem>
314 <para>The name is set based on entries in the udev's
315 Hardware Database with the key
d7dce7b6 316 <varname>ID_NET_NAME_FROM_DATABASE</varname>.
798d3a52
ZJS
317 </para>
318 </listitem>
319 </varlistentry>
320 <varlistentry>
d7dce7b6 321 <term><option>onboard</option></term>
798d3a52
ZJS
322 <listitem>
323 <para>The name is set based on information given by
324 the firmware for on-board devices, as exported by the
d7dce7b6 325 udev property <varname>ID_NET_NAME_ONBOARD</varname>.
0b1e5b6e 326 See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
798d3a52
ZJS
327 </para>
328 </listitem>
329 </varlistentry>
330 <varlistentry>
d7dce7b6 331 <term><option>slot</option></term>
798d3a52
ZJS
332 <listitem>
333 <para>The name is set based on information given by
334 the firmware for hot-plug devices, as exported by the
d7dce7b6 335 udev property <varname>ID_NET_NAME_SLOT</varname>.
0b1e5b6e 336 See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
798d3a52
ZJS
337 </para>
338 </listitem>
339 </varlistentry>
340 <varlistentry>
d7dce7b6 341 <term><option>path</option></term>
798d3a52
ZJS
342 <listitem>
343 <para>The name is set based on the device's physical
344 location, as exported by the udev property
0b1e5b6e
ZJS
345 <varname>ID_NET_NAME_PATH</varname>.
346 See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
347 </para>
798d3a52
ZJS
348 </listitem>
349 </varlistentry>
350 <varlistentry>
d7dce7b6 351 <term><option>mac</option></term>
798d3a52
ZJS
352 <listitem>
353 <para>The name is set based on the device's persistent
354 MAC address, as exported by the udev property
0b1e5b6e
ZJS
355 <varname>ID_NET_NAME_MAC</varname>.
356 See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
357 </para>
798d3a52
ZJS
358 </listitem>
359 </varlistentry>
3907446f 360 <varlistentry>
d7dce7b6 361 <term><option>keep</option></term>
3907446f
ZJS
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>
798d3a52
ZJS
365 </listitem>
366 </varlistentry>
367 </variablelist>
368 </listitem>
369 </varlistentry>
370 <varlistentry>
371 <term><varname>Name=</varname></term>
372 <listitem>
58576937
ZJS
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>
1b934761
ZJS
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>
798d3a52
ZJS
387 </listitem>
388 </varlistentry>
ef1d2c07
YW
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>
a5053a15
YW
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
bb181dd4
YW
405 have no effect. If the kernel does not support the alternative names, then this setting will
406 be ignored.</para>
a5053a15
YW
407 </listitem>
408 </varlistentry>
798d3a52
ZJS
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>
d7dce7b6
ZJS
428 <para>The duplex mode to set for the device. The accepted values are <option>half</option> and
429 <option>full</option>.</para>
798d3a52
ZJS
430 </listitem>
431 </varlistentry>
a39f92d3
SS
432 <varlistentry>
433 <term><varname>AutoNegotiation=</varname></term>
434 <listitem>
9b6ffef3 435 <para>Takes a boolean. If set to yes, automatic negotiation of transmission parameters is enabled.
a39f92d3
SS
436 Autonegotiation is a procedure by which two connected ethernet devices choose
437 common transmission parameters, such as speed, duplex mode, and flow control.
9b6ffef3 438 When unset, the kernel's default will be used.</para>
a39f92d3 439
a0e1ad10 440 <para>Note that if autonegotiation is enabled, speed and duplex settings are
11fcfc53 441 read-only. If autonegotiation is disabled, speed and duplex settings are writable
a39f92d3
SS
442 if the driver supports multiple link modes.</para>
443 </listitem>
444 </varlistentry>
798d3a52
ZJS
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>
1ff28eae 450
798d3a52
ZJS
451 <variablelist>
452 <varlistentry>
d7dce7b6 453 <term><option>phy</option></term>
798d3a52
ZJS
454 <listitem>
455 <para>Wake on PHY activity.</para>
456 </listitem>
457 </varlistentry>
617da14c 458 <varlistentry>
d7dce7b6 459 <term><option>unicast</option></term>
617da14c
SS
460 <listitem>
461 <para>Wake on unicast messages.</para>
462 </listitem>
463 </varlistentry>
464 <varlistentry>
d7dce7b6 465 <term><option>multicast</option></term>
617da14c
SS
466 <listitem>
467 <para>Wake on multicast messages.</para>
468 </listitem>
469 </varlistentry>
470 <varlistentry>
d7dce7b6 471 <term><option>broadcast</option></term>
617da14c
SS
472 <listitem>
473 <para>Wake on broadcast messages.</para>
474 </listitem>
475 </varlistentry>
476 <varlistentry>
d7dce7b6 477 <term><option>arp</option></term>
617da14c
SS
478 <listitem>
479 <para>Wake on ARP.</para>
480 </listitem>
481 </varlistentry>
798d3a52 482 <varlistentry>
d7dce7b6 483 <term><option>magic</option></term>
798d3a52
ZJS
484 <listitem>
485 <para>Wake on receipt of a magic packet.
486 </para>
487 </listitem>
488 </varlistentry>
617da14c 489 <varlistentry>
d7dce7b6 490 <term><option>secureon</option></term>
617da14c
SS
491 <listitem>
492 <para>Enable secureon(tm) password for MagicPacket(tm).
493 </para>
494 </listitem>
495 </varlistentry>
798d3a52 496 <varlistentry>
d7dce7b6 497 <term><option>off</option></term>
798d3a52
ZJS
498 <listitem>
499 <para>Never wake.</para>
500 </listitem>
501 </varlistentry>
502 </variablelist>
c605bd00 503
d7dce7b6 504 <para>Defaults to <option>off</option>.</para>
798d3a52
ZJS
505 </listitem>
506 </varlistentry>
593022fa
SS
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>
d7dce7b6 515 <term><option>tp</option></term>
593022fa
SS
516 <listitem>
517 <para>An Ethernet interface using Twisted-Pair cable as the medium.</para>
518 </listitem>
519 </varlistentry>
520 <varlistentry>
d7dce7b6 521 <term><option>aui</option></term>
593022fa
SS
522 <listitem>
523 <para>Attachment Unit Interface (AUI). Normally used with hubs.
524 </para>
525 </listitem>
526 </varlistentry>
527 <varlistentry>
d7dce7b6 528 <term><option>bnc</option></term>
593022fa
SS
529 <listitem>
530 <para>An Ethernet interface using BNC connectors and co-axial cable.</para>
531 </listitem>
532 </varlistentry>
533 <varlistentry>
d7dce7b6 534 <term><option>mii</option></term>
593022fa
SS
535 <listitem>
536 <para>An Ethernet interface using a Media Independent Interface (MII).</para>
537 </listitem>
538 </varlistentry>
539 <varlistentry>
d7dce7b6 540 <term><option>fibre</option></term>
593022fa
SS
541 <listitem>
542 <para>An Ethernet interface using Optical Fibre as the medium.</para>
543 </listitem>
544 </varlistentry>
545 </variablelist>
546 </listitem>
547 </varlistentry>
6cf0a204
SS
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.
a0e1ad10 552 This implies <literal>AutoNegotiation=yes</literal>. The supported values are:
6cf0a204
SS
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>
d7dce7b6 567 <row><entry><option>10baset-half</option></entry>
6cf0a204
SS
568 <entry>10</entry><entry>half</entry></row>
569
d7dce7b6 570 <row><entry><option>10baset-full</option></entry>
6cf0a204
SS
571 <entry>10</entry><entry>full</entry></row>
572
d7dce7b6 573 <row><entry><option>100baset-half</option></entry>
6cf0a204
SS
574 <entry>100</entry><entry>half</entry></row>
575
d7dce7b6 576 <row><entry><option>100baset-full</option></entry>
6cf0a204
SS
577 <entry>100</entry><entry>full</entry></row>
578
d7dce7b6 579 <row><entry><option>1000baset-half</option></entry>
6cf0a204
SS
580 <entry>1000</entry><entry>half</entry></row>
581
d7dce7b6 582 <row><entry><option>1000baset-full</option></entry>
6cf0a204
SS
583 <entry>1000</entry><entry>full</entry></row>
584
d7dce7b6 585 <row><entry><option>10000baset-full</option></entry>
6cf0a204
SS
586 <entry>10000</entry><entry>full</entry></row>
587
d7dce7b6 588 <row><entry><option>2500basex-full</option></entry>
6cf0a204
SS
589 <entry>2500</entry><entry>full</entry></row>
590
d7dce7b6 591 <row><entry><option>1000basekx-full</option></entry>
6cf0a204
SS
592 <entry>1000</entry><entry>full</entry></row>
593
d7dce7b6 594 <row><entry><option>10000basekx4-full</option></entry>
6cf0a204
SS
595 <entry>10000</entry><entry>full</entry></row>
596
d7dce7b6 597 <row><entry><option>10000basekr-full</option></entry>
6cf0a204
SS
598 <entry>10000</entry><entry>full</entry></row>
599
d7dce7b6 600 <row><entry><option>10000baser-fec</option></entry>
6cf0a204
SS
601 <entry>10000</entry><entry>full</entry></row>
602
d7dce7b6 603 <row><entry><option>20000basemld2-full</option></entry>
6cf0a204
SS
604 <entry>20000</entry><entry>full</entry></row>
605
d7dce7b6 606 <row><entry><option>20000basekr2-full</option></entry>
6cf0a204
SS
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>
bf2334c0
YW
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>
50725d10
SS
632 <varlistentry>
633 <term><varname>TCPSegmentationOffload=</varname></term>
634 <listitem>
9b6ffef3 635 <para>Takes a boolean. If set to true, the TCP Segmentation Offload (TSO) is enabled.
025314d9 636 When unset, the kernel's default will be used.</para>
50725d10 637 </listitem>
ffa69a04
SS
638 </varlistentry>
639 <varlistentry>
640 <term><varname>TCP6SegmentationOffload=</varname></term>
641 <listitem>
9b6ffef3 642 <para>Takes a boolean. If set to true, the TCP6 Segmentation Offload (tx-tcp6-segmentation) is enabled.
025314d9 643 When unset, the kernel's default will be used.</para>
ffa69a04 644 </listitem>
50725d10
SS
645 </varlistentry>
646 <varlistentry>
647 <term><varname>GenericSegmentationOffload=</varname></term>
648 <listitem>
9b6ffef3 649 <para>Takes a boolean. If set to true, the Generic Segmentation Offload (GSO) is enabled.
025314d9 650 When unset, the kernel's default will be used.</para>
50725d10
SS
651 </listitem>
652 </varlistentry>
bf2334c0 653 <varlistentry>
f7ea90fb
SS
654 <term><varname>GenericReceiveOffload=</varname></term>
655 <listitem>
9b6ffef3 656 <para>Takes a boolean. If set to true, the Generic Receive Offload (GRO) is enabled.
025314d9 657 When unset, the kernel's default will be used.</para>
f7ea90fb
SS
658 </listitem>
659 </varlistentry>
660 <varlistentry>
661 <term><varname>LargeReceiveOffload=</varname></term>
662 <listitem>
9b6ffef3 663 <para>Takes a boolean. If set to true, the Large Receive Offload (LRO) is enabled.
025314d9 664 When unset, the kernel's default will be used.</para>
f7ea90fb
SS
665 </listitem>
666 </varlistentry>
5f945202
SS
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>
224ded67
SS
691 <varlistentry>
692 <term><varname>RxBufferSize=</varname></term>
693 <listitem>
80af9bda 694 <para>Takes an integer. Specifies the maximum number of pending packets in the NIC receive buffer.
695 When unset, the kernel's default will be used.</para>
224ded67
SS
696 </listitem>
697 </varlistentry>
e81f5fc4 698 <varlistentry>
699 <term><varname>RxMiniBufferSize=</varname></term>
700 <listitem>
701 <para>Takes an integer. Specifies the maximum number of pending packets in the NIC mini receive buffer.
702 When unset, the kernel's default will be used.</para>
703 </listitem>
704 </varlistentry>
705 <varlistentry>
706 <term><varname>RxJumboBufferSize=</varname></term>
707 <listitem>
708 <para>Takes an integer. Specifies the maximum number of pending packets in the NIC jumbo receive buffer.
709 When unset, the kernel's default will be used.</para>
710 </listitem>
711 </varlistentry>
224ded67
SS
712 <varlistentry>
713 <term><varname>TxBufferSize=</varname></term>
714 <listitem>
80af9bda 715 <para>Takes an integer. Specifies the maximum number of pending packets in the NIC transmit buffer.
716 When unset, the kernel's default will be used.</para>
224ded67
SS
717 </listitem>
718 </varlistentry>
a34811e4
YW
719 <varlistentry>
720 <term><varname>RxFlowControl=</varname></term>
721 <listitem>
722 <para>Takes a boolean. When set, enables the receive flow control, also known as the ethernet
723 receive PAUSE message (generate and send ethernet PAUSE frames). When unset, the kernel's
724 default will be used.</para>
725 </listitem>
726 </varlistentry>
727 <varlistentry>
728 <term><varname>TxFlowControl=</varname></term>
729 <listitem>
730 <para>Takes a boolean. When set, enables the transmit flow control, also known as the ethernet
731 transmit PAUSE message (respond to received ethernet PAUSE frames). When unset, the kernel's
732 default will be used.</para>
733 </listitem>
734 </varlistentry>
735 <varlistentry>
736 <term><varname>AutoNegotiationFlowControl=</varname></term>
737 <listitem>
738 <para>Takes a boolean. When set, the auto negotiation enables the interface to exchange state
739 advertisements with the connected peer so that the two devices can agree on the ethernet
740 PAUSE configuration. When unset, the kernel's default will be used.</para>
741 </listitem>
742 </varlistentry>
224ded67 743
798d3a52
ZJS
744 </variablelist>
745 </refsect1>
1ff28eae 746
798d3a52 747 <refsect1>
b97e7fab
LP
748 <title>Examples</title>
749
750 <example>
751 <title>/usr/lib/systemd/network/99-default.link</title>
752
753 <para>The link file <filename>99-default.link</filename> that is
754 shipped with systemd defines the default naming policy for
755 links.</para>
756
757 <programlisting>[Link]
758NamePolicy=kernel database onboard slot path
759MACAddressPolicy=persistent</programlisting>
760 </example>
761
762 <example>
763 <title>/etc/systemd/network/10-dmz.link</title>
764
58576937 765 <para>This example assigns the fixed name <literal>dmz0</literal> to the interface with the MAC address
b97e7fab
LP
766 00:a0:de:63:7a:e6:</para>
767
768 <programlisting>[Match]
769MACAddress=00:a0:de:63:7a:e6
770
771[Link]
772Name=dmz0</programlisting>
58576937 773
7a447d21 774 <para><varname>NamePolicy=</varname> is not set, so <varname>Name=</varname> takes effect. We use the
a19b9a38 775 <literal>10-</literal> prefix to order this file early in the list. Note that it needs to be before
7a447d21
ZJS
776 <literal>99-link</literal>, i.e. it needs a numerical prefix, to have any effect at all.</para>
777 </example>
778
779 <example>
780 <title>Debugging <varname>NamePolicy=</varname> assignments</title>
781
782 <programlisting>$ sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/hub0
783
784Parsed configuration file /usr/lib/systemd/network/99-default.link
785Parsed configuration file /etc/systemd/network/10-eth0.link
786ID_NET_DRIVER=cdc_ether
787Config file /etc/systemd/network/10-eth0.link applies to device hub0
788link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
789hub0: Device has name_assign_type=4
790Using default interface naming scheme 'v240'.
791hub0: Policies didn't yield a name, using specified Name=hub0.
792ID_NET_LINK_FILE=/etc/systemd/network/10-eth0.link
793ID_NET_NAME=hub0
794…</programlisting>
795
796 <para>Explicit <varname>Name=</varname> configuration wins in this case.</para>
797
798 <programlisting>sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/enp0s31f6
799
800Parsed configuration file /usr/lib/systemd/network/99-default.link
801Parsed configuration file /etc/systemd/network/10-eth0.link
802Created link configuration context.
803ID_NET_DRIVER=e1000e
804Config file /usr/lib/systemd/network/99-default.link applies to device enp0s31f6
805link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
806enp0s31f6: Device has name_assign_type=4
807Using default interface naming scheme 'v240'.
808enp0s31f6: Policy *keep*: keeping existing userspace name
809enp0s31f6: Device has addr_assign_type=0
810enp0s31f6: MAC on the device already matches policy *persistent*
811ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
812
813</programlisting>
814
815 <para>In this case, the interface was already renamed, so the <option>keep</option> policy specified as
b0343f8c 816 the first option in <filename index="false">99-default.link</filename> means that the existing name is
7a447d21
ZJS
817 preserved. If <option>keep</option> was removed, or if were in boot before the renaming has happened,
818 we might get the following instead:</para>
819
820 <programlisting>enp0s31f6: Policy *path* yields "enp0s31f6".
821enp0s31f6: Device has addr_assign_type=0
822enp0s31f6: MAC on the device already matches policy *persistent*
823ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
824ID_NET_NAME=enp0s31f6
825
826</programlisting>
827
828 <para>Please note that the details of output are subject to change.</para>
b97e7fab
LP
829 </example>
830
831 <example>
832 <title>/etc/systemd/network/10-internet.link</title>
833
834 <para>This example assigns the fixed name
835 <literal>internet0</literal> to the interface with the device
836 path <literal>pci-0000:00:1a.0-*</literal>:</para>
837
838 <programlisting>[Match]
839Path=pci-0000:00:1a.0-*
840
841[Link]
842Name=internet0</programlisting>
843 </example>
844
798d3a52 845 <example>
6c1695be 846 <title>/etc/systemd/network/25-wireless.link</title>
1ff28eae 847
b97e7fab
LP
848 <para>Here's an overly complex example that shows the use of a large number of [Match] and [Link] settings.</para>
849
798d3a52 850 <programlisting>[Match]
7abaad1a 851MACAddress=12:34:56:78:9a:bc
852Driver=brcmsmac
853Path=pci-0000:02:00.0-*
854Type=wlan
855Virtualization=no
856Host=my-laptop
857Architecture=x86-64
1ff28eae 858
7abaad1a 859[Link]
860Name=wireless0
861MTUBytes=1450
862BitsPerSecond=10M
863WakeOnLan=magic
864MACAddress=cb:a9:87:65:43:21</programlisting>
798d3a52
ZJS
865 </example>
866 </refsect1>
1ff28eae 867
798d3a52
ZJS
868 <refsect1>
869 <title>See Also</title>
870 <para>
871 <citerefentry>
872 <refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum>
873 </citerefentry>,
874 <citerefentry>
875 <refentrytitle>udevadm</refentrytitle><manvolnum>8</manvolnum>
876 </citerefentry>,
877 <citerefentry>
878 <refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum>
879 </citerefentry>,
880 <citerefentry>
881 <refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum>
882 </citerefentry>
883 </para>
884 </refsect1>
1ff28eae
TG
885
886</refentry>