]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd.link.xml
Merge pull request #21517 from yuwata/network-long-hw-addr
[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>
e6655fbe
YW
50 from this directory will be merged in the alphanumeric order and parsed after the main file itself
51 has been parsed. This is useful to alter or add configuration settings, without having to modify
52 the main configuration file. Each drop-in file must have appropriate section headers.</para>
e406e8a2
YW
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>
52135071
YW
92 <para>A whitespace-separated list of hardware addresses. The acceptable formats are:</para>
93
94 <variablelist>
95 <varlistentry>
96 <term><option>colon-delimited hexadecimal</option></term>
97 <listitem><para>
98 Each field must be one byte.
99 E.g. <literal>12:34:56:78:90:ab</literal> or <literal>AA:BB:CC:DD:EE:FF</literal>.
100 </para></listitem>
101 </varlistentry>
102 <varlistentry>
103 <term><option>hyphen-delimited hexadecimal</option></term>
104 <listitem><para>
105 Each field must be one byte.
106 E.g. <literal>12-34-56-78-90-ab</literal> or <literal>AA-BB-CC-DD-EE-FF</literal>.
107 </para></listitem>
108 </varlistentry>
109 <varlistentry>
110 <term><option>dot-delimited hexadecimal</option></term>
111 <listitem><para>
112 Each field must be two bytes.
113 E.g. <literal>1234.5678.90ab</literal> or <literal>AABB.CCDD.EEFF</literal>.
114 </para></listitem>
115 </varlistentry>
116 <varlistentry>
117 <term><option>IPv4 address format</option></term>
118 <listitem><para>
119 E.g. <literal>127.0.0.1</literal> or <literal>192.168.0.1</literal>.
120 </para></listitem>
121 </varlistentry>
122 <varlistentry>
123 <term><option>IPv6 address format</option></term>
124 <listitem><para>
125 E.g. <literal>2001:0db8:85a3::8a2e:0370:7334</literal> or <literal>::1</literal>.
126 </para></listitem>
127 </varlistentry>
128 </variablelist>
129
130 <para>The total length of each MAC address must be 4 (for IPv4 tunnel), 6 (for Ethernet), 16
131 (for IPv6 tunnel), or 20 (for InfiniBand). This option may appear more than once, in which
132 case the lists are merged. If the empty string is assigned to this option, the list of
133 hardware addresses defined prior to this is reset. Defaults to unset.</para>
798d3a52
ZJS
134 </listitem>
135 </varlistentry>
d9b20454
ZJS
136
137 <varlistentry id='permanent-mac-address'>
4bb7cc82
YW
138 <term><varname>PermanentMACAddress=</varname></term>
139 <listitem>
140 <para>A whitespace-separated list of hardware's permanent addresses. While
141 <varname>MACAddress=</varname> matches the device's current MAC address, this matches the
142 device's permanent MAC address, which may be different from the current one. Use full
52135071
YW
143 colon-, hyphen- or dot-delimited hexadecimal, or IPv4 or IPv6 address format. This option may
144 appear more than once, in which case the lists are merged. If the empty string is assigned to
145 this option, the list of hardware addresses defined prior to this is reset. Defaults to
146 unset.</para>
4bb7cc82
YW
147 </listitem>
148 </varlistentry>
d9b20454
ZJS
149
150 <varlistentry id='path'>
798d3a52
ZJS
151 <term><varname>Path=</varname></term>
152 <listitem>
5256e00e
TG
153 <para>A whitespace-separated list of shell-style globs matching
154 the persistent path, as exposed by the udev property
d7dce7b6 155 <varname>ID_PATH</varname>.</para>
798d3a52
ZJS
156 </listitem>
157 </varlistentry>
d9b20454
ZJS
158
159 <varlistentry id='driver'>
798d3a52
ZJS
160 <term><varname>Driver=</varname></term>
161 <listitem>
d7dce7b6 162 <para>A whitespace-separated list of shell-style globs matching the driver currently bound to the
d9b20454
ZJS
163 device, as exposed by the udev property <varname>ID_NET_DRIVER</varname> of its parent device, or
164 if that is not set, the driver as exposed by <command>ethtool -i</command> of the device itself.
165 If the list is prefixed with a "!", the test is inverted.</para>
798d3a52
ZJS
166 </listitem>
167 </varlistentry>
d9b20454
ZJS
168
169 <varlistentry id='type'>
798d3a52
ZJS
170 <term><varname>Type=</varname></term>
171 <listitem>
ef62949a 172 <para>A whitespace-separated list of shell-style globs matching the device type, as exposed by
2480ca95
LM
173 <command>networkctl list</command>. If the list is prefixed with a "!", the test is inverted.
174 Some valid values are <literal>ether</literal>, <literal>loopback</literal>, <literal>wlan</literal>, <literal>wwan</literal>.
175 Valid types are named either from the udev <literal>DEVTYPE</literal> attribute, or
176 <literal>ARPHRD_</literal> macros in <filename>linux/if_arp.h</filename>, so this is not comprehensive.
ef62949a 177 </para>
798d3a52
ZJS
178 </listitem>
179 </varlistentry>
d9b20454
ZJS
180
181 <varlistentry id='property'>
44005bfb
YW
182 <term><varname>Property=</varname></term>
183 <listitem>
387f6955 184 <para>A whitespace-separated list of udev property names with their values after equals sign
44005bfb
YW
185 (<literal>=</literal>). If multiple properties are specified, the test results are ANDed.
186 If the list is prefixed with a "!", the test is inverted. If a value contains white
187 spaces, then please quote whole key and value pair. If a value contains quotation, then
188 please escape the quotation with <literal>\</literal>.</para>
189
190 <para>Example: if a .link file has the following:
191 <programlisting>Property=ID_MODEL_ID=9999 "ID_VENDOR_FROM_DATABASE=vendor name" "KEY=with \"quotation\""</programlisting>
192 then, the .link file matches only when an interface has all the above three properties.
193 </para>
194 </listitem>
195 </varlistentry>
d9b20454 196
798d3a52 197 <varlistentry>
d9b20454
ZJS
198 <term><varname>OriginalName=</varname></term>
199 <listitem>
200 <para>A whitespace-separated list of shell-style globs matching the device name, as exposed by the
201 udev property "INTERFACE". This cannot be used to match on names that have already been changed
202 from userspace. Caution is advised when matching on kernel-assigned names, as they are known to be
203 unstable between reboots.</para>
204 </listitem>
205 </varlistentry>
206
207 <varlistentry id='host'>
798d3a52
ZJS
208 <term><varname>Host=</varname></term>
209 <listitem>
d689bbca 210 <para>Matches against the hostname or machine ID of the host. See <varname>ConditionHost=</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>
d9b20454
ZJS
217
218 <varlistentry id='virtualization'>
798d3a52
ZJS
219 <term><varname>Virtualization=</varname></term>
220 <listitem>
d689bbca
YW
221 <para>Checks whether the system is executed in a virtualized environment and optionally test
222 whether it is a specific implementation. See <varname>ConditionVirtualization=</varname> in
798d3a52 223 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
d689bbca
YW
224 for details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated.
225 If an empty string is assigned, then previously assigned value is cleared.
226 </para>
798d3a52
ZJS
227 </listitem>
228 </varlistentry>
d9b20454
ZJS
229
230 <varlistentry id='kernel-command-line'>
798d3a52
ZJS
231 <term><varname>KernelCommandLine=</varname></term>
232 <listitem>
d689bbca 233 <para>Checks whether a specific kernel command line option is set. See
d7dce7b6 234 <varname>ConditionKernelCommandLine=</varname> in
798d3a52 235 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
d689bbca
YW
236 for details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated.
237 If an empty string is assigned, then previously assigned value is cleared.
238 </para>
239 </listitem>
240 </varlistentry>
d9b20454
ZJS
241
242 <varlistentry id='kernel-version'>
d689bbca
YW
243 <term><varname>KernelVersion=</varname></term>
244 <listitem>
245 <para>Checks whether the kernel version (as reported by <command>uname -r</command>) matches a certain
246 expression. See <varname>ConditionKernelVersion=</varname> in
247 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
248 details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated.
249 If an empty string is assigned, then previously assigned value is cleared.
250 </para>
798d3a52
ZJS
251 </listitem>
252 </varlistentry>
d9b20454
ZJS
253
254 <varlistentry id='architecture'>
798d3a52
ZJS
255 <term><varname>Architecture=</varname></term>
256 <listitem>
d689bbca
YW
257 <para>Checks whether the system is running on a specific architecture. See
258 <varname>ConditionArchitecture=</varname> in
798d3a52 259 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
d689bbca
YW
260 for details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated.
261 If an empty string is assigned, then previously assigned value is cleared.
262 </para>
798d3a52 263 </listitem>
cbcdcaaa
UKK
264 </varlistentry>
265
266 <varlistentry id='firmware'>
267 <term><varname>Firmware=</varname></term>
268 <listitem>
269 <para>Checks whether the system is running on a machine with the specified firmware. See
270 <varname>ConditionFirmware=</varname> in
271 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
272 for details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated.
273 If an empty string is assigned, then previously assigned value is cleared.
274 </para>
275 </listitem>
798d3a52
ZJS
276 </varlistentry>
277 </variablelist>
1ff28eae 278
798d3a52 279 </refsect1>
102bd40e 280
798d3a52
ZJS
281 <refsect1>
282 <title>[Link] Section Options</title>
102bd40e 283
d7dce7b6 284 <para>The [Link] section accepts the following
798d3a52 285 keys:</para>
1ff28eae 286
798d3a52
ZJS
287 <variablelist class='network-directives'>
288 <varlistentry>
289 <term><varname>Description=</varname></term>
290 <listitem>
291 <para>A description of the device.</para>
292 </listitem>
293 </varlistentry>
294 <varlistentry>
295 <term><varname>Alias=</varname></term>
296 <listitem>
d7dce7b6 297 <para>The <varname>ifalias</varname> interface property is set to this value.</para>
798d3a52
ZJS
298 </listitem>
299 </varlistentry>
300 <varlistentry>
301 <term><varname>MACAddressPolicy=</varname></term>
302 <listitem>
303 <para>The policy by which the MAC address should be set. The
304 available policies are:
305 </para>
1ff28eae 306
798d3a52
ZJS
307 <variablelist>
308 <varlistentry>
d7dce7b6 309 <term><option>persistent</option></term>
798d3a52
ZJS
310 <listitem>
311 <para>If the hardware has a persistent MAC address, as
312 most hardware should, and if it is used by the kernel,
313 nothing is done. Otherwise, a new MAC address is
314 generated which is guaranteed to be the same on every
315 boot for the given machine and the given device, but
1c25683e 316 which is otherwise random. This feature depends on ID_NET_NAME_*
a8eaaee7 317 properties to exist for the link. On hardware where these
b938cb90 318 properties are not set, the generation of a persistent MAC address
1c25683e 319 will fail.</para>
798d3a52
ZJS
320 </listitem>
321 </varlistentry>
322 <varlistentry>
d7dce7b6 323 <term><option>random</option></term>
798d3a52
ZJS
324 <listitem>
325 <para>If the kernel is using a random MAC address,
326 nothing is done. Otherwise, a new address is randomly
327 generated each time the device appears, typically at
b938cb90 328 boot. Either way, the random address will have the
2e229e0c
TG
329 <literal>unicast</literal> and
330 <literal>locally administered</literal> bits set.</para>
798d3a52
ZJS
331 </listitem>
332 </varlistentry>
66d3752e 333 <varlistentry>
d7dce7b6 334 <term><option>none</option></term>
66d3752e 335 <listitem>
6ca4a070
YW
336 <para>Keeps the MAC address assigned by the kernel. Or use the MAC address specified in
337 <varname>MACAddress=</varname>.</para>
66d3752e
JK
338 </listitem>
339 </varlistentry>
798d3a52 340 </variablelist>
6ca4a070
YW
341
342 <para>An empty string assignment is equivalent to setting <literal>none</literal>.</para>
798d3a52
ZJS
343 </listitem>
344 </varlistentry>
345 <varlistentry>
346 <term><varname>MACAddress=</varname></term>
347 <listitem>
6ca4a070
YW
348 <para>The interface MAC address to use. For this setting to take effect,
349 <varname>MACAddressPolicy=</varname> must either be unset, empty, or <literal>none</literal>.
350 </para>
798d3a52
ZJS
351 </listitem>
352 </varlistentry>
353 <varlistentry>
354 <term><varname>NamePolicy=</varname></term>
355 <listitem>
3907446f 356 <para>An ordered, space-separated list of policies by which the interface name should be set.
d7dce7b6 357 <varname>NamePolicy=</varname> may be disabled by specifying <option>net.ifnames=0</option> on the
58576937 358 kernel command line. Each of the policies may fail, and the first successful one is used. The name
d7dce7b6 359 is not set directly, but is exported to udev as the property <option>ID_NET_NAME</option>, which
58576937
ZJS
360 is, by default, used by a
361 <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
362 rule to set <varname>NAME</varname>. The available policies are:
3907446f 363 </para>
1ff28eae 364
798d3a52
ZJS
365 <variablelist>
366 <varlistentry>
d7dce7b6 367 <term><option>kernel</option></term>
798d3a52
ZJS
368 <listitem>
369 <para>If the kernel claims that the name it has set
370 for a device is predictable, then no renaming is
371 performed.</para>
372 </listitem>
373 </varlistentry>
374 <varlistentry>
d7dce7b6 375 <term><option>database</option></term>
798d3a52
ZJS
376 <listitem>
377 <para>The name is set based on entries in the udev's
378 Hardware Database with the key
d7dce7b6 379 <varname>ID_NET_NAME_FROM_DATABASE</varname>.
798d3a52
ZJS
380 </para>
381 </listitem>
382 </varlistentry>
383 <varlistentry>
d7dce7b6 384 <term><option>onboard</option></term>
798d3a52
ZJS
385 <listitem>
386 <para>The name is set based on information given by
387 the firmware for on-board devices, as exported by the
d7dce7b6 388 udev property <varname>ID_NET_NAME_ONBOARD</varname>.
0b1e5b6e 389 See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
798d3a52
ZJS
390 </para>
391 </listitem>
392 </varlistentry>
393 <varlistentry>
d7dce7b6 394 <term><option>slot</option></term>
798d3a52
ZJS
395 <listitem>
396 <para>The name is set based on information given by
397 the firmware for hot-plug devices, as exported by the
d7dce7b6 398 udev property <varname>ID_NET_NAME_SLOT</varname>.
0b1e5b6e 399 See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
798d3a52
ZJS
400 </para>
401 </listitem>
402 </varlistentry>
403 <varlistentry>
d7dce7b6 404 <term><option>path</option></term>
798d3a52
ZJS
405 <listitem>
406 <para>The name is set based on the device's physical
407 location, as exported by the udev property
0b1e5b6e
ZJS
408 <varname>ID_NET_NAME_PATH</varname>.
409 See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
410 </para>
798d3a52
ZJS
411 </listitem>
412 </varlistentry>
413 <varlistentry>
d7dce7b6 414 <term><option>mac</option></term>
798d3a52
ZJS
415 <listitem>
416 <para>The name is set based on the device's persistent
417 MAC address, as exported by the udev property
0b1e5b6e
ZJS
418 <varname>ID_NET_NAME_MAC</varname>.
419 See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
420 </para>
798d3a52
ZJS
421 </listitem>
422 </varlistentry>
3907446f 423 <varlistentry>
d7dce7b6 424 <term><option>keep</option></term>
3907446f
ZJS
425 <listitem>
426 <para>If the device already had a name given by userspace (as part of creation of the device
427 or a rename), keep it.</para>
798d3a52
ZJS
428 </listitem>
429 </varlistentry>
430 </variablelist>
431 </listitem>
432 </varlistentry>
433 <varlistentry>
434 <term><varname>Name=</varname></term>
435 <listitem>
58576937
ZJS
436 <para>The interface name to use. This option has lower precedence than
437 <varname>NamePolicy=</varname>, so for this setting to take effect, <varname>NamePolicy=</varname>
438 must either be unset, empty, disabled, or all policies configured there must fail. Also see the
439 example below with <literal>Name=dmz0</literal>.</para>
1b934761
ZJS
440
441 <para>Note that specifying a name that the kernel might use for another
442 interface (for example <literal>eth0</literal>) is dangerous because the
443 name assignment done by udev will race with the assignment done by the
444 kernel, and only one interface may use the name. Depending on the order of
445 operations, either udev or the kernel will win, making the naming
446 unpredictable. It is best to use some different prefix, for example
447 <literal>internal0</literal>/<literal>external0</literal> or
448 <literal>lan0</literal>/<literal>lan1</literal>/<literal>lan3</literal>.
449 </para>
798d3a52
ZJS
450 </listitem>
451 </varlistentry>
ef1d2c07
YW
452 <varlistentry>
453 <term><varname>AlternativeNamesPolicy=</varname></term>
454 <listitem>
455 <para>A space-separated list of policies by which the interface's alternative names
456 should be set. Each of the policies may fail, and all successful policies are used. The
457 available policies are <literal>database</literal>, <literal>onboard</literal>,
458 <literal>slot</literal>, <literal>path</literal>, and <literal>mac</literal>. If the
459 kernel does not support the alternative names, then this setting will be ignored.
460 </para>
461 </listitem>
462 </varlistentry>
a5053a15
YW
463 <varlistentry>
464 <term><varname>AlternativeName=</varname></term>
465 <listitem>
466 <para>The alternative interface name to use. This option can be specified multiple times.
467 If the empty string is assigned to this option, the list is reset, and all prior assignments
bb181dd4
YW
468 have no effect. If the kernel does not support the alternative names, then this setting will
469 be ignored.</para>
a5053a15
YW
470 </listitem>
471 </varlistentry>
face9fcc
YW
472 <varlistentry>
473 <term><varname>TransmitQueues=</varname></term>
474 <listitem>
475 <para>Specifies the device's number of transmit queues. An integer in the range 1…4096.
476 When unset, the kernel's default will be used.</para>
477 </listitem>
478 </varlistentry>
479 <varlistentry>
480 <term><varname>ReceiveQueues=</varname></term>
481 <listitem>
482 <para>Specifies the device's number of receive queues. An integer in the range 1…4096.
483 When unset, the kernel's default will be used.</para>
484 </listitem>
485 </varlistentry>
ef4a91a7 486 <varlistentry>
1f8dc96c 487 <term><varname>TransmitQueueLength=</varname></term>
ef4a91a7
488 <listitem>
489 <para>Specifies the transmit queue length of the device in number of packets. An unsigned integer
1d3a473b 490 in the range 0…4294967294. When unset, the kernel's default will be used.</para>
ef4a91a7
491 </listitem>
492 </varlistentry>
798d3a52
ZJS
493 <varlistentry>
494 <term><varname>MTUBytes=</varname></term>
495 <listitem>
496 <para>The maximum transmission unit in bytes to set for the
be0d27ee 497 device. The usual suffixes K, M, G are supported and are
798d3a52
ZJS
498 understood to the base of 1024.</para>
499 </listitem>
500 </varlistentry>
501 <varlistentry>
502 <term><varname>BitsPerSecond=</varname></term>
503 <listitem>
504 <para>The speed to set for the device, the value is rounded
be0d27ee 505 down to the nearest Mbps. The usual suffixes K, M, G are
798d3a52
ZJS
506 supported and are understood to the base of 1000.</para>
507 </listitem>
508 </varlistentry>
509 <varlistentry>
510 <term><varname>Duplex=</varname></term>
511 <listitem>
d7dce7b6
ZJS
512 <para>The duplex mode to set for the device. The accepted values are <option>half</option> and
513 <option>full</option>.</para>
798d3a52
ZJS
514 </listitem>
515 </varlistentry>
a39f92d3
SS
516 <varlistentry>
517 <term><varname>AutoNegotiation=</varname></term>
518 <listitem>
9b6ffef3 519 <para>Takes a boolean. If set to yes, automatic negotiation of transmission parameters is enabled.
a39f92d3
SS
520 Autonegotiation is a procedure by which two connected ethernet devices choose
521 common transmission parameters, such as speed, duplex mode, and flow control.
9b6ffef3 522 When unset, the kernel's default will be used.</para>
a39f92d3 523
a0e1ad10 524 <para>Note that if autonegotiation is enabled, speed and duplex settings are
11fcfc53 525 read-only. If autonegotiation is disabled, speed and duplex settings are writable
a39f92d3
SS
526 if the driver supports multiple link modes.</para>
527 </listitem>
528 </varlistentry>
798d3a52
ZJS
529 <varlistentry>
530 <term><varname>WakeOnLan=</varname></term>
531 <listitem>
c50404ae
YW
532 <para>The Wake-on-LAN policy to set for the device. Takes the special value
533 <literal>off</literal> which disables Wake-on-LAN, or space separated list of the following
534 words:</para>
1ff28eae 535
798d3a52
ZJS
536 <variablelist>
537 <varlistentry>
d7dce7b6 538 <term><option>phy</option></term>
798d3a52
ZJS
539 <listitem>
540 <para>Wake on PHY activity.</para>
541 </listitem>
542 </varlistentry>
617da14c 543 <varlistentry>
d7dce7b6 544 <term><option>unicast</option></term>
617da14c
SS
545 <listitem>
546 <para>Wake on unicast messages.</para>
547 </listitem>
548 </varlistentry>
549 <varlistentry>
d7dce7b6 550 <term><option>multicast</option></term>
617da14c
SS
551 <listitem>
552 <para>Wake on multicast messages.</para>
553 </listitem>
554 </varlistentry>
555 <varlistentry>
d7dce7b6 556 <term><option>broadcast</option></term>
617da14c
SS
557 <listitem>
558 <para>Wake on broadcast messages.</para>
559 </listitem>
560 </varlistentry>
561 <varlistentry>
d7dce7b6 562 <term><option>arp</option></term>
617da14c
SS
563 <listitem>
564 <para>Wake on ARP.</para>
565 </listitem>
566 </varlistentry>
798d3a52 567 <varlistentry>
d7dce7b6 568 <term><option>magic</option></term>
798d3a52
ZJS
569 <listitem>
570 <para>Wake on receipt of a magic packet.
571 </para>
572 </listitem>
573 </varlistentry>
617da14c 574 <varlistentry>
d7dce7b6 575 <term><option>secureon</option></term>
617da14c 576 <listitem>
d3867133
YW
577 <para>Enable SecureOn password for MagicPacket. Implied when
578 <varname>WakeOnLanPassword=</varname> is specified. If specified without
579 <varname>WakeOnLanPassword=</varname> option, then the password is read from the
580 credential <literal><replaceable>LINK</replaceable>.link.wol.password</literal> (e.g.,
581 <literal>60-foo.link.wol.password</literal>), and if the credential not found, then
582 read from <literal>wol.password</literal>. See
583 <varname>LoadCredential=</varname>/<varname>SetCredential=</varname> in
584 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>1</manvolnum></citerefentry>
585 for details. The password in the credential, must be 6 bytes in hex format with each
586 byte separated by a colon (<literal>:</literal>) like an Ethernet MAC address, e.g.,
587 <literal>aa:bb:cc:dd:ee:ff</literal>.</para>
617da14c
SS
588 </listitem>
589 </varlistentry>
798d3a52 590 </variablelist>
c605bd00 591
c50404ae
YW
592 <para>Defaults to unset, and the device's default will be used. This setting can be specified
593 multiple times. If an empty string is assigned, then the all previous assignments are
594 cleared.</para>
798d3a52
ZJS
595 </listitem>
596 </varlistentry>
d3867133
YW
597 <varlistentry>
598 <term><varname>WakeOnLanPassword=</varname></term>
599 <listitem>
600 <para>Specifies the SecureOn password for MagicPacket. Takes an absolute path to a regular
601 file or an <constant>AF_UNIX</constant> stream socket, or the plain password. When a path to
602 a regular file is specified, the password is read from it. When an
603 <constant>AF_UNIX</constant> stream socket is specified, a connection is made to it and the
604 password is read from it. The password must be 6 bytes in hex format with each byte separated
605 by a colon (<literal>:</literal>) like an Ethernet MAC address, e.g.,
606 <literal>aa:bb:cc:dd:ee:ff</literal>. This implies <varname>WakeOnLan=secureon</varname>.
607 Defaults to unset, and the current value will not be changed.</para>
608 </listitem>
609 </varlistentry>
593022fa
SS
610 <varlistentry>
611 <term><varname>Port=</varname></term>
612 <listitem>
613 <para>The port option is used to select the device port. The
614 supported values are:</para>
615
616 <variablelist>
617 <varlistentry>
d7dce7b6 618 <term><option>tp</option></term>
593022fa
SS
619 <listitem>
620 <para>An Ethernet interface using Twisted-Pair cable as the medium.</para>
621 </listitem>
622 </varlistentry>
623 <varlistentry>
d7dce7b6 624 <term><option>aui</option></term>
593022fa
SS
625 <listitem>
626 <para>Attachment Unit Interface (AUI). Normally used with hubs.
627 </para>
628 </listitem>
629 </varlistentry>
630 <varlistentry>
d7dce7b6 631 <term><option>bnc</option></term>
593022fa
SS
632 <listitem>
633 <para>An Ethernet interface using BNC connectors and co-axial cable.</para>
634 </listitem>
635 </varlistentry>
636 <varlistentry>
d7dce7b6 637 <term><option>mii</option></term>
593022fa
SS
638 <listitem>
639 <para>An Ethernet interface using a Media Independent Interface (MII).</para>
640 </listitem>
641 </varlistentry>
642 <varlistentry>
d7dce7b6 643 <term><option>fibre</option></term>
593022fa
SS
644 <listitem>
645 <para>An Ethernet interface using Optical Fibre as the medium.</para>
646 </listitem>
647 </varlistentry>
648 </variablelist>
649 </listitem>
650 </varlistentry>
6cf0a204
SS
651 <varlistentry>
652 <term><varname>Advertise=</varname></term>
653 <listitem>
654 <para>This sets what speeds and duplex modes of operation are advertised for auto-negotiation.
a0e1ad10 655 This implies <literal>AutoNegotiation=yes</literal>. The supported values are:
6cf0a204
SS
656
657 <table>
658 <title>Supported advertise values</title>
659 <tgroup cols='3'>
660 <colspec colname='Advertise' />
661 <colspec colname='Speed' />
662 <colspec colname='Duplex Mode' />
663
664 <thead><row>
665 <entry>Advertise</entry>
666 <entry>Speed (Mbps)</entry>
667 <entry>Duplex Mode</entry>
668 </row></thead>
669 <tbody>
d7dce7b6 670 <row><entry><option>10baset-half</option></entry>
6cf0a204
SS
671 <entry>10</entry><entry>half</entry></row>
672
d7dce7b6 673 <row><entry><option>10baset-full</option></entry>
6cf0a204
SS
674 <entry>10</entry><entry>full</entry></row>
675
d7dce7b6 676 <row><entry><option>100baset-half</option></entry>
6cf0a204
SS
677 <entry>100</entry><entry>half</entry></row>
678
d7dce7b6 679 <row><entry><option>100baset-full</option></entry>
6cf0a204
SS
680 <entry>100</entry><entry>full</entry></row>
681
d7dce7b6 682 <row><entry><option>1000baset-half</option></entry>
6cf0a204
SS
683 <entry>1000</entry><entry>half</entry></row>
684
d7dce7b6 685 <row><entry><option>1000baset-full</option></entry>
6cf0a204
SS
686 <entry>1000</entry><entry>full</entry></row>
687
d7dce7b6 688 <row><entry><option>10000baset-full</option></entry>
6cf0a204
SS
689 <entry>10000</entry><entry>full</entry></row>
690
d7dce7b6 691 <row><entry><option>2500basex-full</option></entry>
6cf0a204
SS
692 <entry>2500</entry><entry>full</entry></row>
693
d7dce7b6 694 <row><entry><option>1000basekx-full</option></entry>
6cf0a204
SS
695 <entry>1000</entry><entry>full</entry></row>
696
d7dce7b6 697 <row><entry><option>10000basekx4-full</option></entry>
6cf0a204
SS
698 <entry>10000</entry><entry>full</entry></row>
699
d7dce7b6 700 <row><entry><option>10000basekr-full</option></entry>
6cf0a204
SS
701 <entry>10000</entry><entry>full</entry></row>
702
d7dce7b6 703 <row><entry><option>10000baser-fec</option></entry>
6cf0a204
SS
704 <entry>10000</entry><entry>full</entry></row>
705
d7dce7b6 706 <row><entry><option>20000basemld2-full</option></entry>
6cf0a204
SS
707 <entry>20000</entry><entry>full</entry></row>
708
d7dce7b6 709 <row><entry><option>20000basekr2-full</option></entry>
6cf0a204
SS
710 <entry>20000</entry><entry>full</entry></row>
711 </tbody>
712 </tgroup>
713 </table>
714
715 By default this is unset, i.e. all possible modes will be advertised.
716 This option may be specified more than once, in which case all specified speeds and modes are advertised.
717 If the empty string is assigned to this option, the list is reset, and all prior assignments have no effect.
718 </para>
719 </listitem>
720 </varlistentry>
bf2334c0
YW
721 <varlistentry>
722 <term><varname>ReceiveChecksumOffload=</varname></term>
723 <listitem>
f20710c7 724 <para>Takes a boolean. If set to true, hardware offload for checksumming of ingress
bf2334c0
YW
725 network packets is enabled. When unset, the kernel's default will be used.</para>
726 </listitem>
727 </varlistentry>
728 <varlistentry>
729 <term><varname>TransmitChecksumOffload=</varname></term>
730 <listitem>
f20710c7 731 <para>Takes a boolean. If set to true, hardware offload for checksumming of egress
bf2334c0
YW
732 network packets is enabled. When unset, the kernel's default will be used.</para>
733 </listitem>
734 </varlistentry>
50725d10
SS
735 <varlistentry>
736 <term><varname>TCPSegmentationOffload=</varname></term>
737 <listitem>
f20710c7 738 <para>Takes a boolean. If set to true, TCP Segmentation Offload (TSO) is enabled.
025314d9 739 When unset, the kernel's default will be used.</para>
50725d10 740 </listitem>
ffa69a04
SS
741 </varlistentry>
742 <varlistentry>
743 <term><varname>TCP6SegmentationOffload=</varname></term>
744 <listitem>
f20710c7 745 <para>Takes a boolean. If set to true, TCP6 Segmentation Offload (tx-tcp6-segmentation) is enabled.
025314d9 746 When unset, the kernel's default will be used.</para>
ffa69a04 747 </listitem>
50725d10
SS
748 </varlistentry>
749 <varlistentry>
750 <term><varname>GenericSegmentationOffload=</varname></term>
751 <listitem>
f20710c7 752 <para>Takes a boolean. If set to true, Generic Segmentation Offload (GSO) is enabled.
025314d9 753 When unset, the kernel's default will be used.</para>
50725d10
SS
754 </listitem>
755 </varlistentry>
bf2334c0 756 <varlistentry>
f7ea90fb
SS
757 <term><varname>GenericReceiveOffload=</varname></term>
758 <listitem>
f20710c7 759 <para>Takes a boolean. If set to true, Generic Receive Offload (GRO) is enabled.
025314d9 760 When unset, the kernel's default will be used.</para>
f7ea90fb
SS
761 </listitem>
762 </varlistentry>
8f821d90
DDM
763 <varlistentry>
764 <term><varname>GenericReceiveOffloadHardware=</varname></term>
765 <listitem>
766 <para>Takes a boolean. If set to true, hardware accelerated Generic Receive Offload (GRO) is
767 enabled. When unset, the kernel's default will be used.</para>
768 </listitem>
769 </varlistentry>
f7ea90fb
SS
770 <varlistentry>
771 <term><varname>LargeReceiveOffload=</varname></term>
772 <listitem>
f20710c7 773 <para>Takes a boolean. If set to true, Large Receive Offload (LRO) is enabled.
025314d9 774 When unset, the kernel's default will be used.</para>
f7ea90fb
SS
775 </listitem>
776 </varlistentry>
2b33e41a
AZ
777 <varlistentry>
778 <term><varname>ReceiveVLANCTAGHardwareAcceleration=</varname></term>
779 <listitem>
780 <para>Takes a boolean. If set to true, receive VLAN CTAG hardware acceleration is enabled.
781 When unset, the kernel's default will be used.</para>
782 </listitem>
783 </varlistentry>
784 <varlistentry>
785 <term><varname>TransmitVLANCTAGHardwareAcceleration=</varname></term>
786 <listitem>
787 <para>Takes a boolean. If set to true, transmit VLAN CTAG hardware acceleration is enabled.
788 When unset, the kernel's default will be used.</para>
789 </listitem>
790 </varlistentry>
791 <varlistentry>
792 <term><varname>ReceiveVLANCTAGFilter=</varname></term>
793 <listitem>
794 <para>Takes a boolean. If set to true, receive filtering on VLAN CTAGs is enabled.
795 When unset, the kernel's default will be used.</para>
796 </listitem>
797 </varlistentry>
798 <varlistentry>
799 <term><varname>TransmitVLANSTAGHardwareAcceleration=</varname></term>
800 <listitem>
801 <para>Takes a boolean. If set to true, transmit VLAN STAG HW acceleration is enabled.
802 When unset, the kernel's default will be used.</para>
803 </listitem>
804 </varlistentry>
805 <varlistentry>
806 <term><varname>NTupleFilter=</varname></term>
807 <listitem>
808 <para>Takes a boolean. If set to true, receive N-tuple filters and actions are enabled.
809 When unset, the kernel's default will be used.</para>
810 </listitem>
811 </varlistentry>
5f945202
SS
812 <varlistentry>
813 <term><varname>RxChannels=</varname></term>
5f945202 814 <term><varname>TxChannels=</varname></term>
5f945202 815 <term><varname>OtherChannels=</varname></term>
5f945202
SS
816 <term><varname>CombinedChannels=</varname></term>
817 <listitem>
0d341ecc
YW
818 <para>Specifies the number of receive, transmit, other, or combined channels, respectively.
819 Takes an unsigned integer in the range 1…4294967295 or <literal>max</literal>. If set to
820 <literal>max</literal>, the advertised maximum value of the hardware will be used. When
821 unset, the number will not be changed. Defaults to unset.</para>
5f945202
SS
822 </listitem>
823 </varlistentry>
224ded67
SS
824 <varlistentry>
825 <term><varname>RxBufferSize=</varname></term>
e81f5fc4 826 <term><varname>RxMiniBufferSize=</varname></term>
e81f5fc4 827 <term><varname>RxJumboBufferSize=</varname></term>
224ded67
SS
828 <term><varname>TxBufferSize=</varname></term>
829 <listitem>
0d341ecc
YW
830 <para>Specifies the maximum number of pending packets in the NIC receive buffer, mini receive
831 buffer, jumbo receive buffer, or transmit buffer, respectively. Takes an unsigned integer in
832 the range 1…4294967295 or <literal>max</literal>. If set to <literal>max</literal>, the
833 advertised maximum value of the hardware will be used. When unset, the number will not be
834 changed. Defaults to unset.</para>
224ded67
SS
835 </listitem>
836 </varlistentry>
a34811e4
YW
837 <varlistentry>
838 <term><varname>RxFlowControl=</varname></term>
839 <listitem>
f20710c7 840 <para>Takes a boolean. When set, enables receive flow control, also known as the ethernet
a34811e4
YW
841 receive PAUSE message (generate and send ethernet PAUSE frames). When unset, the kernel's
842 default will be used.</para>
843 </listitem>
844 </varlistentry>
845 <varlistentry>
846 <term><varname>TxFlowControl=</varname></term>
847 <listitem>
f20710c7 848 <para>Takes a boolean. When set, enables transmit flow control, also known as the ethernet
a34811e4
YW
849 transmit PAUSE message (respond to received ethernet PAUSE frames). When unset, the kernel's
850 default will be used.</para>
851 </listitem>
852 </varlistentry>
853 <varlistentry>
854 <term><varname>AutoNegotiationFlowControl=</varname></term>
855 <listitem>
f20710c7 856 <para>Takes a boolean. When set, auto negotiation enables the interface to exchange state
a34811e4
YW
857 advertisements with the connected peer so that the two devices can agree on the ethernet
858 PAUSE configuration. When unset, the kernel's default will be used.</para>
859 </listitem>
860 </varlistentry>
1e270127
SS
861 <varlistentry>
862 <term><varname>GenericSegmentOffloadMaxBytes=</varname></term>
863 <listitem>
864 <para>Specifies the maximum size of a Generic Segment Offload (GSO) packet the
be0d27ee 865 device should accept. The usual suffixes K, M, G are supported and are
1d3a473b 866 understood to the base of 1024. An unsigned integer in the range 1…65536.
1e270127
SS
867 Defaults to unset.</para>
868 </listitem>
869 </varlistentry>
870 <varlistentry>
871 <term><varname>GenericSegmentOffloadMaxSegments=</varname></term>
872 <listitem>
be0d27ee
ZJS
873 <para>Specifies the maximum number of Generic Segment Offload (GSO) segments the device should
874 accept. An unsigned integer in the range 1…65535. Defaults to unset.</para>
1e270127
SS
875 </listitem>
876 </varlistentry>
6c35ea5e
DDM
877 <varlistentry>
878 <term><varname>UseAdaptiveRxCoalesce=</varname></term>
879 <term><varname>UseAdaptiveTxCoalesce=</varname></term>
880 <listitem>
881 <para>Boolean properties that, when set, enable/disable adaptive Rx/Tx coalescing if the hardware
882 supports it. When unset, the kernel's default will be used.</para>
883 </listitem>
884 </varlistentry>
885 <varlistentry>
886 <term><varname>RxCoalesceSec=</varname></term>
887 <term><varname>RxCoalesceIrqSec=</varname></term>
888 <term><varname>RxCoalesceLowSec=</varname></term>
889 <term><varname>RxCoalesceHighSec=</varname></term>
890 <term><varname>TxCoalesceSec=</varname></term>
891 <term><varname>TxCoalesceIrqSec=</varname></term>
892 <term><varname>TxCoalesceLowSec=</varname></term>
893 <term><varname>TxCoalesceHighSec=</varname></term>
894 <listitem>
895 <para>These properties configure the delay before Rx/Tx interrupts are generated after a packet is
896 sent/received. The <literal>Irq</literal> properties come into effect when the host is servicing an
897 IRQ. The <literal>Low</literal> and <literal>High</literal> properties come into effect when the
898 packet rate drops below the low packet rate threshold or exceeds the high packet rate threshold
899 respectively if adaptive Rx/Tx coalescing is enabled. When unset, the kernel's defaults will be
900 used.</para>
901 </listitem>
902 </varlistentry>
903 <varlistentry>
904 <term><varname>RxMaxCoalescedFrames=</varname></term>
905 <term><varname>RxMaxCoalescedIrqFrames=</varname></term>
906 <term><varname>RxMaxCoalescedLowFrames=</varname></term>
907 <term><varname>RxMaxCoalescedHighFrames=</varname></term>
908 <term><varname>TxMaxCoalescedFrames=</varname></term>
909 <term><varname>TxMaxCoalescedIrqFrames=</varname></term>
910 <term><varname>TxMaxCoalescedLowFrames=</varname></term>
911 <term><varname>TxMaxCoalescedHighFrames=</varname></term>
912 <listitem>
913 <para>These properties configure the maximum number of frames that are sent/received before a Rx/Tx
914 interrupt is generated. The <literal>Irq</literal> properties come into effect when the host is
915 servicing an IRQ. The <literal>Low</literal> and <literal>High</literal> properties come into
916 effect when the packet rate drops below the low packet rate threshold or exceeds the high packet
917 rate threshold respectively if adaptive Rx/Tx coalescing is enabled. When unset, the kernel's
918 defaults will be used.</para>
919 </listitem>
920 </varlistentry>
921 <varlistentry>
922 <term><varname>CoalescePacketRateLow=</varname></term>
923 <term><varname>CoalescePacketRateHigh=</varname></term>
924 <listitem>
925 <para>These properties configure the low and high packet rate (expressed in packets per second)
926 threshold respectively and are used to determine when the corresponding coalescing settings for low
927 and high packet rates come into effect if adaptive Rx/Tx coalescing is enabled. If unset, the
928 kernel's defaults will be used.</para>
929 </listitem>
930 </varlistentry>
931 <varlistentry>
932 <term><varname>CoalescePacketRateSampleIntervalSec=</varname></term>
933 <listitem>
934 <para>Configures how often to sample the packet rate used for adaptive Rx/Tx coalescing. This
935 property cannot be zero. This lowest time granularity supported by this property is seconds.
936 Partial seconds will be rounded up before being passed to the kernel. If unset, the kernel's
937 default will be used.</para>
938 </listitem>
939 </varlistentry>
940 <varlistentry>
941 <term><varname>StatisticsBlockCoalesceSec=</varname></term>
942 <listitem>
943 <para>How long to delay driver in-memory statistics block updates. If the driver does not have an
944 in-memory statistic block, this property is ignored. This property cannot be zero. If unset, the
945 kernel's default will be used.</para>
946 </listitem>
947 </varlistentry>
224ded67 948
798d3a52
ZJS
949 </variablelist>
950 </refsect1>
1ff28eae 951
798d3a52 952 <refsect1>
b97e7fab
LP
953 <title>Examples</title>
954
955 <example>
956 <title>/usr/lib/systemd/network/99-default.link</title>
957
958 <para>The link file <filename>99-default.link</filename> that is
959 shipped with systemd defines the default naming policy for
960 links.</para>
961
962 <programlisting>[Link]
963NamePolicy=kernel database onboard slot path
964MACAddressPolicy=persistent</programlisting>
965 </example>
966
967 <example>
968 <title>/etc/systemd/network/10-dmz.link</title>
969
58576937 970 <para>This example assigns the fixed name <literal>dmz0</literal> to the interface with the MAC address
b97e7fab
LP
971 00:a0:de:63:7a:e6:</para>
972
973 <programlisting>[Match]
974MACAddress=00:a0:de:63:7a:e6
975
976[Link]
977Name=dmz0</programlisting>
58576937 978
7a447d21 979 <para><varname>NamePolicy=</varname> is not set, so <varname>Name=</varname> takes effect. We use the
a19b9a38 980 <literal>10-</literal> prefix to order this file early in the list. Note that it needs to be before
7a447d21
ZJS
981 <literal>99-link</literal>, i.e. it needs a numerical prefix, to have any effect at all.</para>
982 </example>
983
984 <example>
985 <title>Debugging <varname>NamePolicy=</varname> assignments</title>
986
987 <programlisting>$ sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/hub0
988
989Parsed configuration file /usr/lib/systemd/network/99-default.link
990Parsed configuration file /etc/systemd/network/10-eth0.link
991ID_NET_DRIVER=cdc_ether
992Config file /etc/systemd/network/10-eth0.link applies to device hub0
993link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
994hub0: Device has name_assign_type=4
995Using default interface naming scheme 'v240'.
996hub0: Policies didn't yield a name, using specified Name=hub0.
997ID_NET_LINK_FILE=/etc/systemd/network/10-eth0.link
998ID_NET_NAME=hub0
999…</programlisting>
1000
1001 <para>Explicit <varname>Name=</varname> configuration wins in this case.</para>
1002
1003 <programlisting>sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/enp0s31f6
1004
1005Parsed configuration file /usr/lib/systemd/network/99-default.link
1006Parsed configuration file /etc/systemd/network/10-eth0.link
1007Created link configuration context.
1008ID_NET_DRIVER=e1000e
1009Config file /usr/lib/systemd/network/99-default.link applies to device enp0s31f6
1010link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
1011enp0s31f6: Device has name_assign_type=4
1012Using default interface naming scheme 'v240'.
1013enp0s31f6: Policy *keep*: keeping existing userspace name
1014enp0s31f6: Device has addr_assign_type=0
1015enp0s31f6: MAC on the device already matches policy *persistent*
1016ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
1017
1018</programlisting>
1019
1020 <para>In this case, the interface was already renamed, so the <option>keep</option> policy specified as
b0343f8c 1021 the first option in <filename index="false">99-default.link</filename> means that the existing name is
7a447d21
ZJS
1022 preserved. If <option>keep</option> was removed, or if were in boot before the renaming has happened,
1023 we might get the following instead:</para>
1024
1025 <programlisting>enp0s31f6: Policy *path* yields "enp0s31f6".
1026enp0s31f6: Device has addr_assign_type=0
1027enp0s31f6: MAC on the device already matches policy *persistent*
1028ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
1029ID_NET_NAME=enp0s31f6
1030
1031</programlisting>
1032
1033 <para>Please note that the details of output are subject to change.</para>
b97e7fab
LP
1034 </example>
1035
1036 <example>
1037 <title>/etc/systemd/network/10-internet.link</title>
1038
1039 <para>This example assigns the fixed name
1040 <literal>internet0</literal> to the interface with the device
1041 path <literal>pci-0000:00:1a.0-*</literal>:</para>
1042
1043 <programlisting>[Match]
1044Path=pci-0000:00:1a.0-*
1045
1046[Link]
1047Name=internet0</programlisting>
1048 </example>
1049
798d3a52 1050 <example>
6c1695be 1051 <title>/etc/systemd/network/25-wireless.link</title>
1ff28eae 1052
b97e7fab
LP
1053 <para>Here's an overly complex example that shows the use of a large number of [Match] and [Link] settings.</para>
1054
798d3a52 1055 <programlisting>[Match]
7abaad1a 1056MACAddress=12:34:56:78:9a:bc
1057Driver=brcmsmac
1058Path=pci-0000:02:00.0-*
1059Type=wlan
1060Virtualization=no
1061Host=my-laptop
1062Architecture=x86-64
1ff28eae 1063
7abaad1a 1064[Link]
1065Name=wireless0
1066MTUBytes=1450
1067BitsPerSecond=10M
1068WakeOnLan=magic
1069MACAddress=cb:a9:87:65:43:21</programlisting>
798d3a52
ZJS
1070 </example>
1071 </refsect1>
1ff28eae 1072
798d3a52
ZJS
1073 <refsect1>
1074 <title>See Also</title>
1075 <para>
1076 <citerefentry>
1077 <refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum>
1078 </citerefentry>,
1079 <citerefentry>
1080 <refentrytitle>udevadm</refentrytitle><manvolnum>8</manvolnum>
1081 </citerefentry>,
1082 <citerefentry>
1083 <refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum>
1084 </citerefentry>,
1085 <citerefentry>
1086 <refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum>
1087 </citerefentry>
1088 </para>
1089 </refsect1>
1ff28eae
TG
1090
1091</refentry>