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