]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd.link.xml
Merge pull request #18007 from fw-strlen/ipv6_masq_and_dnat
[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">
db9ecf05 4<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
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
3b121157
ZJS
45 in <filename>/etc/</filename> have the highest priority, files in
46 <filename>/run/</filename> take precedence over files with the same
47 name in <filename>/usr/lib/</filename>. This can be used to
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 275 <listitem>
6ca4a070
YW
276 <para>Keeps the MAC address assigned by the kernel. Or use the MAC address specified in
277 <varname>MACAddress=</varname>.</para>
66d3752e
JK
278 </listitem>
279 </varlistentry>
798d3a52 280 </variablelist>
6ca4a070
YW
281
282 <para>An empty string assignment is equivalent to setting <literal>none</literal>.</para>
798d3a52
ZJS
283 </listitem>
284 </varlistentry>
285 <varlistentry>
286 <term><varname>MACAddress=</varname></term>
287 <listitem>
6ca4a070
YW
288 <para>The interface MAC address to use. For this setting to take effect,
289 <varname>MACAddressPolicy=</varname> must either be unset, empty, or <literal>none</literal>.
290 </para>
798d3a52
ZJS
291 </listitem>
292 </varlistentry>
293 <varlistentry>
294 <term><varname>NamePolicy=</varname></term>
295 <listitem>
3907446f 296 <para>An ordered, space-separated list of policies by which the interface name should be set.
d7dce7b6 297 <varname>NamePolicy=</varname> may be disabled by specifying <option>net.ifnames=0</option> on the
58576937 298 kernel command line. Each of the policies may fail, and the first successful one is used. The name
d7dce7b6 299 is not set directly, but is exported to udev as the property <option>ID_NET_NAME</option>, which
58576937
ZJS
300 is, by default, used by a
301 <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
302 rule to set <varname>NAME</varname>. The available policies are:
3907446f 303 </para>
1ff28eae 304
798d3a52
ZJS
305 <variablelist>
306 <varlistentry>
d7dce7b6 307 <term><option>kernel</option></term>
798d3a52
ZJS
308 <listitem>
309 <para>If the kernel claims that the name it has set
310 for a device is predictable, then no renaming is
311 performed.</para>
312 </listitem>
313 </varlistentry>
314 <varlistentry>
d7dce7b6 315 <term><option>database</option></term>
798d3a52
ZJS
316 <listitem>
317 <para>The name is set based on entries in the udev's
318 Hardware Database with the key
d7dce7b6 319 <varname>ID_NET_NAME_FROM_DATABASE</varname>.
798d3a52
ZJS
320 </para>
321 </listitem>
322 </varlistentry>
323 <varlistentry>
d7dce7b6 324 <term><option>onboard</option></term>
798d3a52
ZJS
325 <listitem>
326 <para>The name is set based on information given by
327 the firmware for on-board devices, as exported by the
d7dce7b6 328 udev property <varname>ID_NET_NAME_ONBOARD</varname>.
0b1e5b6e 329 See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
798d3a52
ZJS
330 </para>
331 </listitem>
332 </varlistentry>
333 <varlistentry>
d7dce7b6 334 <term><option>slot</option></term>
798d3a52
ZJS
335 <listitem>
336 <para>The name is set based on information given by
337 the firmware for hot-plug devices, as exported by the
d7dce7b6 338 udev property <varname>ID_NET_NAME_SLOT</varname>.
0b1e5b6e 339 See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
798d3a52
ZJS
340 </para>
341 </listitem>
342 </varlistentry>
343 <varlistentry>
d7dce7b6 344 <term><option>path</option></term>
798d3a52
ZJS
345 <listitem>
346 <para>The name is set based on the device's physical
347 location, as exported by the udev property
0b1e5b6e
ZJS
348 <varname>ID_NET_NAME_PATH</varname>.
349 See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
350 </para>
798d3a52
ZJS
351 </listitem>
352 </varlistentry>
353 <varlistentry>
d7dce7b6 354 <term><option>mac</option></term>
798d3a52
ZJS
355 <listitem>
356 <para>The name is set based on the device's persistent
357 MAC address, as exported by the udev property
0b1e5b6e
ZJS
358 <varname>ID_NET_NAME_MAC</varname>.
359 See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
360 </para>
798d3a52
ZJS
361 </listitem>
362 </varlistentry>
3907446f 363 <varlistentry>
d7dce7b6 364 <term><option>keep</option></term>
3907446f
ZJS
365 <listitem>
366 <para>If the device already had a name given by userspace (as part of creation of the device
367 or a rename), keep it.</para>
798d3a52
ZJS
368 </listitem>
369 </varlistentry>
370 </variablelist>
371 </listitem>
372 </varlistentry>
373 <varlistentry>
374 <term><varname>Name=</varname></term>
375 <listitem>
58576937
ZJS
376 <para>The interface name to use. This option has lower precedence than
377 <varname>NamePolicy=</varname>, so for this setting to take effect, <varname>NamePolicy=</varname>
378 must either be unset, empty, disabled, or all policies configured there must fail. Also see the
379 example below with <literal>Name=dmz0</literal>.</para>
1b934761
ZJS
380
381 <para>Note that specifying a name that the kernel might use for another
382 interface (for example <literal>eth0</literal>) is dangerous because the
383 name assignment done by udev will race with the assignment done by the
384 kernel, and only one interface may use the name. Depending on the order of
385 operations, either udev or the kernel will win, making the naming
386 unpredictable. It is best to use some different prefix, for example
387 <literal>internal0</literal>/<literal>external0</literal> or
388 <literal>lan0</literal>/<literal>lan1</literal>/<literal>lan3</literal>.
389 </para>
798d3a52
ZJS
390 </listitem>
391 </varlistentry>
ef1d2c07
YW
392 <varlistentry>
393 <term><varname>AlternativeNamesPolicy=</varname></term>
394 <listitem>
395 <para>A space-separated list of policies by which the interface's alternative names
396 should be set. Each of the policies may fail, and all successful policies are used. The
397 available policies are <literal>database</literal>, <literal>onboard</literal>,
398 <literal>slot</literal>, <literal>path</literal>, and <literal>mac</literal>. If the
399 kernel does not support the alternative names, then this setting will be ignored.
400 </para>
401 </listitem>
402 </varlistentry>
a5053a15
YW
403 <varlistentry>
404 <term><varname>AlternativeName=</varname></term>
405 <listitem>
406 <para>The alternative interface name to use. This option can be specified multiple times.
407 If the empty string is assigned to this option, the list is reset, and all prior assignments
bb181dd4
YW
408 have no effect. If the kernel does not support the alternative names, then this setting will
409 be ignored.</para>
a5053a15
YW
410 </listitem>
411 </varlistentry>
face9fcc
YW
412 <varlistentry>
413 <term><varname>TransmitQueues=</varname></term>
414 <listitem>
415 <para>Specifies the device's number of transmit queues. An integer in the range 1…4096.
416 When unset, the kernel's default will be used.</para>
417 </listitem>
418 </varlistentry>
419 <varlistentry>
420 <term><varname>ReceiveQueues=</varname></term>
421 <listitem>
422 <para>Specifies the device's number of receive queues. An integer in the range 1…4096.
423 When unset, the kernel's default will be used.</para>
424 </listitem>
425 </varlistentry>
ef4a91a7 426 <varlistentry>
1f8dc96c 427 <term><varname>TransmitQueueLength=</varname></term>
ef4a91a7
428 <listitem>
429 <para>Specifies the transmit queue length of the device in number of packets. An unsigned integer
1d3a473b 430 in the range 0…4294967294. When unset, the kernel's default will be used.</para>
ef4a91a7
431 </listitem>
432 </varlistentry>
798d3a52
ZJS
433 <varlistentry>
434 <term><varname>MTUBytes=</varname></term>
435 <listitem>
436 <para>The maximum transmission unit in bytes to set for the
437 device. The usual suffixes K, M, G, are supported and are
438 understood to the base of 1024.</para>
439 </listitem>
440 </varlistentry>
441 <varlistentry>
442 <term><varname>BitsPerSecond=</varname></term>
443 <listitem>
444 <para>The speed to set for the device, the value is rounded
445 down to the nearest Mbps. The usual suffixes K, M, G, are
446 supported and are understood to the base of 1000.</para>
447 </listitem>
448 </varlistentry>
449 <varlistentry>
450 <term><varname>Duplex=</varname></term>
451 <listitem>
d7dce7b6
ZJS
452 <para>The duplex mode to set for the device. The accepted values are <option>half</option> and
453 <option>full</option>.</para>
798d3a52
ZJS
454 </listitem>
455 </varlistentry>
a39f92d3
SS
456 <varlistentry>
457 <term><varname>AutoNegotiation=</varname></term>
458 <listitem>
9b6ffef3 459 <para>Takes a boolean. If set to yes, automatic negotiation of transmission parameters is enabled.
a39f92d3
SS
460 Autonegotiation is a procedure by which two connected ethernet devices choose
461 common transmission parameters, such as speed, duplex mode, and flow control.
9b6ffef3 462 When unset, the kernel's default will be used.</para>
a39f92d3 463
a0e1ad10 464 <para>Note that if autonegotiation is enabled, speed and duplex settings are
11fcfc53 465 read-only. If autonegotiation is disabled, speed and duplex settings are writable
a39f92d3
SS
466 if the driver supports multiple link modes.</para>
467 </listitem>
468 </varlistentry>
798d3a52
ZJS
469 <varlistentry>
470 <term><varname>WakeOnLan=</varname></term>
471 <listitem>
472 <para>The Wake-on-LAN policy to set for the device. The
473 supported values are:</para>
1ff28eae 474
798d3a52
ZJS
475 <variablelist>
476 <varlistentry>
d7dce7b6 477 <term><option>phy</option></term>
798d3a52
ZJS
478 <listitem>
479 <para>Wake on PHY activity.</para>
480 </listitem>
481 </varlistentry>
617da14c 482 <varlistentry>
d7dce7b6 483 <term><option>unicast</option></term>
617da14c
SS
484 <listitem>
485 <para>Wake on unicast messages.</para>
486 </listitem>
487 </varlistentry>
488 <varlistentry>
d7dce7b6 489 <term><option>multicast</option></term>
617da14c
SS
490 <listitem>
491 <para>Wake on multicast messages.</para>
492 </listitem>
493 </varlistentry>
494 <varlistentry>
d7dce7b6 495 <term><option>broadcast</option></term>
617da14c
SS
496 <listitem>
497 <para>Wake on broadcast messages.</para>
498 </listitem>
499 </varlistentry>
500 <varlistentry>
d7dce7b6 501 <term><option>arp</option></term>
617da14c
SS
502 <listitem>
503 <para>Wake on ARP.</para>
504 </listitem>
505 </varlistentry>
798d3a52 506 <varlistentry>
d7dce7b6 507 <term><option>magic</option></term>
798d3a52
ZJS
508 <listitem>
509 <para>Wake on receipt of a magic packet.
510 </para>
511 </listitem>
512 </varlistentry>
617da14c 513 <varlistentry>
d7dce7b6 514 <term><option>secureon</option></term>
617da14c
SS
515 <listitem>
516 <para>Enable secureon(tm) password for MagicPacket(tm).
517 </para>
518 </listitem>
519 </varlistentry>
798d3a52 520 <varlistentry>
d7dce7b6 521 <term><option>off</option></term>
798d3a52
ZJS
522 <listitem>
523 <para>Never wake.</para>
524 </listitem>
525 </varlistentry>
526 </variablelist>
c605bd00 527
d7dce7b6 528 <para>Defaults to <option>off</option>.</para>
798d3a52
ZJS
529 </listitem>
530 </varlistentry>
593022fa
SS
531 <varlistentry>
532 <term><varname>Port=</varname></term>
533 <listitem>
534 <para>The port option is used to select the device port. The
535 supported values are:</para>
536
537 <variablelist>
538 <varlistentry>
d7dce7b6 539 <term><option>tp</option></term>
593022fa
SS
540 <listitem>
541 <para>An Ethernet interface using Twisted-Pair cable as the medium.</para>
542 </listitem>
543 </varlistentry>
544 <varlistentry>
d7dce7b6 545 <term><option>aui</option></term>
593022fa
SS
546 <listitem>
547 <para>Attachment Unit Interface (AUI). Normally used with hubs.
548 </para>
549 </listitem>
550 </varlistentry>
551 <varlistentry>
d7dce7b6 552 <term><option>bnc</option></term>
593022fa
SS
553 <listitem>
554 <para>An Ethernet interface using BNC connectors and co-axial cable.</para>
555 </listitem>
556 </varlistentry>
557 <varlistentry>
d7dce7b6 558 <term><option>mii</option></term>
593022fa
SS
559 <listitem>
560 <para>An Ethernet interface using a Media Independent Interface (MII).</para>
561 </listitem>
562 </varlistentry>
563 <varlistentry>
d7dce7b6 564 <term><option>fibre</option></term>
593022fa
SS
565 <listitem>
566 <para>An Ethernet interface using Optical Fibre as the medium.</para>
567 </listitem>
568 </varlistentry>
569 </variablelist>
570 </listitem>
571 </varlistentry>
6cf0a204
SS
572 <varlistentry>
573 <term><varname>Advertise=</varname></term>
574 <listitem>
575 <para>This sets what speeds and duplex modes of operation are advertised for auto-negotiation.
a0e1ad10 576 This implies <literal>AutoNegotiation=yes</literal>. The supported values are:
6cf0a204
SS
577
578 <table>
579 <title>Supported advertise values</title>
580 <tgroup cols='3'>
581 <colspec colname='Advertise' />
582 <colspec colname='Speed' />
583 <colspec colname='Duplex Mode' />
584
585 <thead><row>
586 <entry>Advertise</entry>
587 <entry>Speed (Mbps)</entry>
588 <entry>Duplex Mode</entry>
589 </row></thead>
590 <tbody>
d7dce7b6 591 <row><entry><option>10baset-half</option></entry>
6cf0a204
SS
592 <entry>10</entry><entry>half</entry></row>
593
d7dce7b6 594 <row><entry><option>10baset-full</option></entry>
6cf0a204
SS
595 <entry>10</entry><entry>full</entry></row>
596
d7dce7b6 597 <row><entry><option>100baset-half</option></entry>
6cf0a204
SS
598 <entry>100</entry><entry>half</entry></row>
599
d7dce7b6 600 <row><entry><option>100baset-full</option></entry>
6cf0a204
SS
601 <entry>100</entry><entry>full</entry></row>
602
d7dce7b6 603 <row><entry><option>1000baset-half</option></entry>
6cf0a204
SS
604 <entry>1000</entry><entry>half</entry></row>
605
d7dce7b6 606 <row><entry><option>1000baset-full</option></entry>
6cf0a204
SS
607 <entry>1000</entry><entry>full</entry></row>
608
d7dce7b6 609 <row><entry><option>10000baset-full</option></entry>
6cf0a204
SS
610 <entry>10000</entry><entry>full</entry></row>
611
d7dce7b6 612 <row><entry><option>2500basex-full</option></entry>
6cf0a204
SS
613 <entry>2500</entry><entry>full</entry></row>
614
d7dce7b6 615 <row><entry><option>1000basekx-full</option></entry>
6cf0a204
SS
616 <entry>1000</entry><entry>full</entry></row>
617
d7dce7b6 618 <row><entry><option>10000basekx4-full</option></entry>
6cf0a204
SS
619 <entry>10000</entry><entry>full</entry></row>
620
d7dce7b6 621 <row><entry><option>10000basekr-full</option></entry>
6cf0a204
SS
622 <entry>10000</entry><entry>full</entry></row>
623
d7dce7b6 624 <row><entry><option>10000baser-fec</option></entry>
6cf0a204
SS
625 <entry>10000</entry><entry>full</entry></row>
626
d7dce7b6 627 <row><entry><option>20000basemld2-full</option></entry>
6cf0a204
SS
628 <entry>20000</entry><entry>full</entry></row>
629
d7dce7b6 630 <row><entry><option>20000basekr2-full</option></entry>
6cf0a204
SS
631 <entry>20000</entry><entry>full</entry></row>
632 </tbody>
633 </tgroup>
634 </table>
635
636 By default this is unset, i.e. all possible modes will be advertised.
637 This option may be specified more than once, in which case all specified speeds and modes are advertised.
638 If the empty string is assigned to this option, the list is reset, and all prior assignments have no effect.
639 </para>
640 </listitem>
641 </varlistentry>
bf2334c0
YW
642 <varlistentry>
643 <term><varname>ReceiveChecksumOffload=</varname></term>
644 <listitem>
645 <para>Takes a boolean. If set to true, the hardware offload for checksumming of ingress
646 network packets is enabled. When unset, the kernel's default will be used.</para>
647 </listitem>
648 </varlistentry>
649 <varlistentry>
650 <term><varname>TransmitChecksumOffload=</varname></term>
651 <listitem>
652 <para>Takes a boolean. If set to true, the hardware offload for checksumming of egress
653 network packets is enabled. When unset, the kernel's default will be used.</para>
654 </listitem>
655 </varlistentry>
50725d10
SS
656 <varlistentry>
657 <term><varname>TCPSegmentationOffload=</varname></term>
658 <listitem>
9b6ffef3 659 <para>Takes a boolean. If set to true, the TCP Segmentation Offload (TSO) is enabled.
025314d9 660 When unset, the kernel's default will be used.</para>
50725d10 661 </listitem>
ffa69a04
SS
662 </varlistentry>
663 <varlistentry>
664 <term><varname>TCP6SegmentationOffload=</varname></term>
665 <listitem>
9b6ffef3 666 <para>Takes a boolean. If set to true, the TCP6 Segmentation Offload (tx-tcp6-segmentation) is enabled.
025314d9 667 When unset, the kernel's default will be used.</para>
ffa69a04 668 </listitem>
50725d10
SS
669 </varlistentry>
670 <varlistentry>
671 <term><varname>GenericSegmentationOffload=</varname></term>
672 <listitem>
9b6ffef3 673 <para>Takes a boolean. If set to true, the Generic Segmentation Offload (GSO) is enabled.
025314d9 674 When unset, the kernel's default will be used.</para>
50725d10
SS
675 </listitem>
676 </varlistentry>
bf2334c0 677 <varlistentry>
f7ea90fb
SS
678 <term><varname>GenericReceiveOffload=</varname></term>
679 <listitem>
9b6ffef3 680 <para>Takes a boolean. If set to true, the Generic Receive Offload (GRO) is enabled.
025314d9 681 When unset, the kernel's default will be used.</para>
f7ea90fb
SS
682 </listitem>
683 </varlistentry>
684 <varlistentry>
685 <term><varname>LargeReceiveOffload=</varname></term>
686 <listitem>
9b6ffef3 687 <para>Takes a boolean. If set to true, the Large Receive Offload (LRO) is enabled.
025314d9 688 When unset, the kernel's default will be used.</para>
f7ea90fb
SS
689 </listitem>
690 </varlistentry>
5f945202
SS
691 <varlistentry>
692 <term><varname>RxChannels=</varname></term>
693 <listitem>
694 <para>Sets the number of receive channels (a number between 1 and 4294967295) .</para>
695 </listitem>
696 </varlistentry>
697 <varlistentry>
698 <term><varname>TxChannels=</varname></term>
699 <listitem>
700 <para>Sets the number of transmit channels (a number between 1 and 4294967295).</para>
701 </listitem>
702 </varlistentry>
703 <varlistentry>
704 <term><varname>OtherChannels=</varname></term>
705 <listitem>
706 <para>Sets the number of other channels (a number between 1 and 4294967295).</para>
707 </listitem>
708 </varlistentry>
709 <varlistentry>
710 <term><varname>CombinedChannels=</varname></term>
711 <listitem>
712 <para>Sets the number of combined set channels (a number between 1 and 4294967295).</para>
713 </listitem>
714 </varlistentry>
224ded67
SS
715 <varlistentry>
716 <term><varname>RxBufferSize=</varname></term>
717 <listitem>
80af9bda 718 <para>Takes an integer. Specifies the maximum number of pending packets in the NIC receive buffer.
719 When unset, the kernel's default will be used.</para>
224ded67
SS
720 </listitem>
721 </varlistentry>
e81f5fc4 722 <varlistentry>
723 <term><varname>RxMiniBufferSize=</varname></term>
724 <listitem>
725 <para>Takes an integer. Specifies the maximum number of pending packets in the NIC mini receive buffer.
726 When unset, the kernel's default will be used.</para>
727 </listitem>
728 </varlistentry>
729 <varlistentry>
730 <term><varname>RxJumboBufferSize=</varname></term>
731 <listitem>
732 <para>Takes an integer. Specifies the maximum number of pending packets in the NIC jumbo receive buffer.
733 When unset, the kernel's default will be used.</para>
734 </listitem>
735 </varlistentry>
224ded67
SS
736 <varlistentry>
737 <term><varname>TxBufferSize=</varname></term>
738 <listitem>
80af9bda 739 <para>Takes an integer. Specifies the maximum number of pending packets in the NIC transmit buffer.
740 When unset, the kernel's default will be used.</para>
224ded67
SS
741 </listitem>
742 </varlistentry>
a34811e4
YW
743 <varlistentry>
744 <term><varname>RxFlowControl=</varname></term>
745 <listitem>
746 <para>Takes a boolean. When set, enables the receive flow control, also known as the ethernet
747 receive PAUSE message (generate and send ethernet PAUSE frames). When unset, the kernel's
748 default will be used.</para>
749 </listitem>
750 </varlistentry>
751 <varlistentry>
752 <term><varname>TxFlowControl=</varname></term>
753 <listitem>
754 <para>Takes a boolean. When set, enables the transmit flow control, also known as the ethernet
755 transmit PAUSE message (respond to received ethernet PAUSE frames). When unset, the kernel's
756 default will be used.</para>
757 </listitem>
758 </varlistentry>
759 <varlistentry>
760 <term><varname>AutoNegotiationFlowControl=</varname></term>
761 <listitem>
762 <para>Takes a boolean. When set, the auto negotiation enables the interface to exchange state
763 advertisements with the connected peer so that the two devices can agree on the ethernet
764 PAUSE configuration. When unset, the kernel's default will be used.</para>
765 </listitem>
766 </varlistentry>
1e270127
SS
767 <varlistentry>
768 <term><varname>GenericSegmentOffloadMaxBytes=</varname></term>
769 <listitem>
770 <para>Specifies the maximum size of a Generic Segment Offload (GSO) packet the
771 device should accept. The usual suffixes K, M, G, are supported and are
1d3a473b 772 understood to the base of 1024. An unsigned integer in the range 1…65536.
1e270127
SS
773 Defaults to unset.</para>
774 </listitem>
775 </varlistentry>
776 <varlistentry>
777 <term><varname>GenericSegmentOffloadMaxSegments=</varname></term>
778 <listitem>
1d3a473b
ZJS
779 <para>Specifies the maximum number of a Generic Segment Offload (GSO) segments the device should
780 accept. An unsigned integer in the range 1…65535. Defaults to unset.</para>
1e270127
SS
781 </listitem>
782 </varlistentry>
224ded67 783
798d3a52
ZJS
784 </variablelist>
785 </refsect1>
1ff28eae 786
798d3a52 787 <refsect1>
b97e7fab
LP
788 <title>Examples</title>
789
790 <example>
791 <title>/usr/lib/systemd/network/99-default.link</title>
792
793 <para>The link file <filename>99-default.link</filename> that is
794 shipped with systemd defines the default naming policy for
795 links.</para>
796
797 <programlisting>[Link]
798NamePolicy=kernel database onboard slot path
799MACAddressPolicy=persistent</programlisting>
800 </example>
801
802 <example>
803 <title>/etc/systemd/network/10-dmz.link</title>
804
58576937 805 <para>This example assigns the fixed name <literal>dmz0</literal> to the interface with the MAC address
b97e7fab
LP
806 00:a0:de:63:7a:e6:</para>
807
808 <programlisting>[Match]
809MACAddress=00:a0:de:63:7a:e6
810
811[Link]
812Name=dmz0</programlisting>
58576937 813
7a447d21 814 <para><varname>NamePolicy=</varname> is not set, so <varname>Name=</varname> takes effect. We use the
a19b9a38 815 <literal>10-</literal> prefix to order this file early in the list. Note that it needs to be before
7a447d21
ZJS
816 <literal>99-link</literal>, i.e. it needs a numerical prefix, to have any effect at all.</para>
817 </example>
818
819 <example>
820 <title>Debugging <varname>NamePolicy=</varname> assignments</title>
821
822 <programlisting>$ sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/hub0
823
824Parsed configuration file /usr/lib/systemd/network/99-default.link
825Parsed configuration file /etc/systemd/network/10-eth0.link
826ID_NET_DRIVER=cdc_ether
827Config file /etc/systemd/network/10-eth0.link applies to device hub0
828link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
829hub0: Device has name_assign_type=4
830Using default interface naming scheme 'v240'.
831hub0: Policies didn't yield a name, using specified Name=hub0.
832ID_NET_LINK_FILE=/etc/systemd/network/10-eth0.link
833ID_NET_NAME=hub0
834…</programlisting>
835
836 <para>Explicit <varname>Name=</varname> configuration wins in this case.</para>
837
838 <programlisting>sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/enp0s31f6
839
840Parsed configuration file /usr/lib/systemd/network/99-default.link
841Parsed configuration file /etc/systemd/network/10-eth0.link
842Created link configuration context.
843ID_NET_DRIVER=e1000e
844Config file /usr/lib/systemd/network/99-default.link applies to device enp0s31f6
845link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
846enp0s31f6: Device has name_assign_type=4
847Using default interface naming scheme 'v240'.
848enp0s31f6: Policy *keep*: keeping existing userspace name
849enp0s31f6: Device has addr_assign_type=0
850enp0s31f6: MAC on the device already matches policy *persistent*
851ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
852
853</programlisting>
854
855 <para>In this case, the interface was already renamed, so the <option>keep</option> policy specified as
b0343f8c 856 the first option in <filename index="false">99-default.link</filename> means that the existing name is
7a447d21
ZJS
857 preserved. If <option>keep</option> was removed, or if were in boot before the renaming has happened,
858 we might get the following instead:</para>
859
860 <programlisting>enp0s31f6: Policy *path* yields "enp0s31f6".
861enp0s31f6: Device has addr_assign_type=0
862enp0s31f6: MAC on the device already matches policy *persistent*
863ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
864ID_NET_NAME=enp0s31f6
865
866</programlisting>
867
868 <para>Please note that the details of output are subject to change.</para>
b97e7fab
LP
869 </example>
870
871 <example>
872 <title>/etc/systemd/network/10-internet.link</title>
873
874 <para>This example assigns the fixed name
875 <literal>internet0</literal> to the interface with the device
876 path <literal>pci-0000:00:1a.0-*</literal>:</para>
877
878 <programlisting>[Match]
879Path=pci-0000:00:1a.0-*
880
881[Link]
882Name=internet0</programlisting>
883 </example>
884
798d3a52 885 <example>
6c1695be 886 <title>/etc/systemd/network/25-wireless.link</title>
1ff28eae 887
b97e7fab
LP
888 <para>Here's an overly complex example that shows the use of a large number of [Match] and [Link] settings.</para>
889
798d3a52 890 <programlisting>[Match]
7abaad1a 891MACAddress=12:34:56:78:9a:bc
892Driver=brcmsmac
893Path=pci-0000:02:00.0-*
894Type=wlan
895Virtualization=no
896Host=my-laptop
897Architecture=x86-64
1ff28eae 898
7abaad1a 899[Link]
900Name=wireless0
901MTUBytes=1450
902BitsPerSecond=10M
903WakeOnLan=magic
904MACAddress=cb:a9:87:65:43:21</programlisting>
798d3a52
ZJS
905 </example>
906 </refsect1>
1ff28eae 907
798d3a52
ZJS
908 <refsect1>
909 <title>See Also</title>
910 <para>
911 <citerefentry>
912 <refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum>
913 </citerefentry>,
914 <citerefentry>
915 <refentrytitle>udevadm</refentrytitle><manvolnum>8</manvolnum>
916 </citerefentry>,
917 <citerefentry>
918 <refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum>
919 </citerefentry>,
920 <citerefentry>
921 <refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum>
922 </citerefentry>
923 </para>
924 </refsect1>
1ff28eae
TG
925
926</refentry>