2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
6 <refentry id=
"systemd.link"
7 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
9 <title>systemd.link
</title>
10 <productname>systemd
</productname>
14 <refentrytitle>systemd.link
</refentrytitle>
15 <manvolnum>5</manvolnum>
19 <refname>systemd.link
</refname>
20 <refpurpose>Network device configuration
</refpurpose>
24 <para><filename><replaceable>link
</replaceable>.link
</filename></para>
28 <title>Description
</title>
30 <para>A plain ini-style text file that encodes configuration for matching network devices, used by
31 <citerefentry><refentrytitle>systemd-udevd
</refentrytitle><manvolnum>8</manvolnum></citerefentry> and in
32 particular its
<command>net_setup_link
</command> builtin. See
33 <citerefentry><refentrytitle>systemd.syntax
</refentrytitle><manvolnum>7</manvolnum></citerefentry> for a
34 general description of the syntax.
</para>
36 <para>The
<filename>.link
</filename> files are read from the files located in the system network
37 directory
<filename>/usr/lib/systemd/network
</filename> and
38 <filename>/usr/local/lib/systemd/network
</filename>, the volatile runtime network directory
39 <filename>/run/systemd/network
</filename>, and the local administration network directory
40 <filename>/etc/systemd/network
</filename>. All configuration files are collectively sorted and
41 processed in alphanumeric order, regardless of the directories in which they live. However, files
42 with identical filenames replace each other. It is recommended that each filename is prefixed with
43 a number smaller than
<literal>70</literal> (e.g.
<filename>10-eth0.link
</filename>). Otherwise, the
44 default
<filename>.link
</filename> files or those generated by
45 <citerefentry><refentrytitle>systemd-network-generator.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
46 may take precedence over user configured files. Files in
<filename>/etc/
</filename> have the
47 highest priority, files in
<filename>/run/
</filename> take precedence over files with the same name
48 in
<filename>/usr/lib/
</filename>. This can be used to override a system-supplied link file with a
49 local file if needed. As a special case, an empty file (file size
0) or symlink with the same name
50 pointing to
<filename>/dev/null
</filename> disables the configuration file entirely (it is
53 <para>Along with the link file
<filename>foo.link
</filename>, a
"drop-in" directory
54 <filename>foo.link.d/
</filename> may exist. All files with the suffix
<literal>.conf
</literal>
55 from this directory will be merged in the alphanumeric order and parsed after the main file itself
56 has been parsed. This is useful to alter or add configuration settings, without having to modify
57 the main configuration file. Each drop-in file must have appropriate section headers.
</para>
59 <para>In addition to
<filename>/etc/systemd/network
</filename>, drop-in
<literal>.d
</literal>
60 directories can be placed in
<filename>/usr/lib/systemd/network
</filename> or
61 <filename>/run/systemd/network
</filename> directories. Drop-in files in
<filename>/etc/
</filename>
62 take precedence over those in
<filename>/run/
</filename> which in turn take precedence over those
63 in
<filename>/usr/lib/
</filename>. Drop-in files under any of these directories take precedence
64 over the main link file wherever located.
</para>
66 <para>The link file contains a [Match] section, which determines if a given link file may be applied to a
67 given device, as well as a [Link] section specifying how the device should be configured. The first (in
68 lexical order) of the link files that matches a given device is applied. Note that a default file
69 <filename>99-default.link
</filename> is shipped by the system. Any user-supplied
70 <filename>.link
</filename> should hence have a lexically earlier name to be considered at all.
</para>
72 <para>See
<citerefentry><refentrytitle>udevadm
</refentrytitle><manvolnum>8</manvolnum></citerefentry> for
73 diagnosing problems with
<filename>.link
</filename> files.
</para>
77 <title>[Match] Section Options
</title>
79 <para>A link file is said to match an interface if all matches specified by the [Match] section are
80 satisfied. When a link file does not contain valid settings in [Match] section, then the file will
81 match all interfaces and
<command>systemd-udevd
</command> warns about that. Hint: to avoid the
82 warning and to make it clear that all interfaces shall be matched, add the following:
83 <programlisting>OriginalName=*
</programlisting>
84 The first (in alphanumeric order) of the link files that matches a given interface is applied, all
85 later files are ignored, even if they match as well. The following keys are accepted:
</para>
87 <variablelist class='network-directives'
>
88 <!-- This list is reused in systemd.network(3), hence maintain a specific order:
89 1. device matches shared between the two lists
90 2. non-shared settings
91 3. host matches shared between the two lists
94 <varlistentry id='mac-address'
>
95 <term><varname>MACAddress=
</varname></term>
97 <para>A whitespace-separated list of hardware addresses. The acceptable formats are:
</para>
101 <term><option>colon-delimited hexadecimal
</option></term>
103 Each field must be one byte.
104 E.g.
<literal>12:
34:
56:
78:
90:ab
</literal> or
<literal>AA:BB:CC:DD:EE:FF
</literal>.
107 <xi:include href=
"version-info.xml" xpointer=
"v250"/></listitem>
110 <term><option>hyphen-delimited hexadecimal
</option></term>
112 Each field must be one byte.
113 E.g.
<literal>12-
34-
56-
78-
90-ab
</literal> or
<literal>AA-BB-CC-DD-EE-FF
</literal>.
116 <xi:include href=
"version-info.xml" xpointer=
"v250"/></listitem>
119 <term><option>dot-delimited hexadecimal
</option></term>
121 Each field must be two bytes.
122 E.g.
<literal>1234.5678.90ab
</literal> or
<literal>AABB.CCDD.EEFF
</literal>.
125 <xi:include href=
"version-info.xml" xpointer=
"v250"/></listitem>
128 <term><option>IPv4 address format
</option></term>
130 E.g.
<literal>127.0.0.1</literal> or
<literal>192.168.0.1</literal>.
133 <xi:include href=
"version-info.xml" xpointer=
"v250"/></listitem>
136 <term><option>IPv6 address format
</option></term>
138 E.g.
<literal>2001:
0db8:
85a3::
8a2e:
0370:
7334</literal> or
<literal>::
1</literal>.
141 <xi:include href=
"version-info.xml" xpointer=
"v250"/></listitem>
145 <para>The total length of each MAC address must be
4 (for IPv4 tunnel),
6 (for Ethernet),
16
146 (for IPv6 tunnel), or
20 (for InfiniBand). This option may appear more than once, in which
147 case the lists are merged. If the empty string is assigned to this option, the list of
148 hardware addresses defined prior to this is reset. Defaults to unset.
</para>
150 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
154 <varlistentry id='permanent-mac-address'
>
155 <term><varname>PermanentMACAddress=
</varname></term>
157 <para>A whitespace-separated list of hardware's permanent addresses. While
158 <varname>MACAddress=
</varname> matches the device's current MAC address, this matches the
159 device's permanent MAC address, which may be different from the current one. Use full
160 colon-, hyphen- or dot-delimited hexadecimal, or IPv4 or IPv6 address format. This option may
161 appear more than once, in which case the lists are merged. If the empty string is assigned to
162 this option, the list of hardware addresses defined prior to this is reset. Defaults to
165 <xi:include href=
"version-info.xml" xpointer=
"v245"/>
169 <varlistentry id='path'
>
170 <term><varname>Path=
</varname></term>
172 <para>A whitespace-separated list of shell-style globs matching
173 the persistent path, as exposed by the udev property
174 <varname>ID_PATH
</varname>.
</para>
176 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
180 <varlistentry id='driver'
>
181 <term><varname>Driver=
</varname></term>
183 <para>A whitespace-separated list of shell-style globs matching the driver currently bound to the
184 device, as exposed by the udev property
<varname>ID_NET_DRIVER
</varname> of its parent device, or
185 if that is not set, the driver as exposed by
<command>ethtool -i
</command> of the device itself.
186 If the list is prefixed with a
"!", the test is inverted.
</para>
188 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
192 <varlistentry id='type'
>
193 <term><varname>Type=
</varname></term>
195 <para>A whitespace-separated list of shell-style globs matching the device type, as exposed by
196 <command>networkctl list
</command>. If the list is prefixed with a
"!", the test is inverted.
197 Some valid values are
<literal>ether
</literal>,
<literal>loopback
</literal>,
<literal>wlan
</literal>,
<literal>wwan
</literal>.
198 Valid types are named either from the udev
<literal>DEVTYPE
</literal> attribute, or
199 <literal>ARPHRD_
</literal> macros in
<filename>linux/if_arp.h
</filename>, so this is not comprehensive.
202 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
206 <varlistentry id='kind'
>
207 <term><varname>Kind=
</varname></term>
209 <para>A whitespace-separated list of shell-style globs matching the device kind, as exposed by
210 <command>networkctl status
<replaceable>INTERFACE
</replaceable></command> or
211 <command>ip -d link show
<replaceable>INTERFACE
</replaceable></command>. If the list is
212 prefixed with a
"!", the test is inverted. Some valid values are
<literal>bond
</literal>,
213 <literal>bridge
</literal>,
<literal>gre
</literal>,
<literal>tun
</literal>,
214 <literal>veth
</literal>. Valid kinds are given by netlink's
<literal>IFLA_INFO_KIND
</literal>
215 attribute, so this is not comprehensive.
218 <xi:include href=
"version-info.xml" xpointer=
"v251"/>
222 <varlistentry id='property'
>
223 <term><varname>Property=
</varname></term>
225 <para>A whitespace-separated list of udev property names with their values after equals sign
226 (
<literal>=
</literal>). If multiple properties are specified, the test results are ANDed.
227 If the list is prefixed with a
"!", the test is inverted. If a value contains white
228 spaces, then please quote whole key and value pair. If a value contains quotation, then
229 please escape the quotation with
<literal>\
</literal>.
</para>
231 <para>Example: if a .link file has the following:
232 <programlisting>Property=ID_MODEL_ID=
9999 "ID_VENDOR_FROM_DATABASE=vendor name" "KEY=with \"quotation\
""</programlisting>
233 then, the .link file matches only when an interface has all the above three properties.
236 <xi:include href=
"version-info.xml" xpointer=
"v243"/>
241 <term><varname>OriginalName=
</varname></term>
243 <para>A whitespace-separated list of shell-style globs matching the device name, as exposed by the
244 udev property
"INTERFACE". This cannot be used to match on names that have already been changed
245 from userspace. Caution is advised when matching on kernel-assigned names, as they are known to be
246 unstable between reboots.
</para>
248 <xi:include href=
"version-info.xml" xpointer=
"v218"/>
252 <varlistentry id='host'
>
253 <term><varname>Host=
</varname></term>
255 <para>Matches against the hostname or machine ID of the host. See
<varname>ConditionHost=
</varname> in
256 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
257 for details. When prefixed with an exclamation mark (
<literal>!
</literal>), the result is negated.
258 If an empty string is assigned, the previously assigned value is cleared.
261 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
265 <varlistentry id='virtualization'
>
266 <term><varname>Virtualization=
</varname></term>
268 <para>Checks whether the system is executed in a virtualized environment and optionally test
269 whether it is a specific implementation. See
<varname>ConditionVirtualization=
</varname> in
270 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
271 for details. When prefixed with an exclamation mark (
<literal>!
</literal>), the result is negated.
272 If an empty string is assigned, the previously assigned value is cleared.
275 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
279 <varlistentry id='kernel-command-line'
>
280 <term><varname>KernelCommandLine=
</varname></term>
282 <para>Checks whether a specific kernel command line option is set. See
283 <varname>ConditionKernelCommandLine=
</varname> in
284 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
285 for details. When prefixed with an exclamation mark (
<literal>!
</literal>), the result is negated.
286 If an empty string is assigned, the previously assigned value is cleared.
289 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
293 <varlistentry id='kernel-version'
>
294 <term><varname>KernelVersion=
</varname></term>
296 <para>Checks whether the kernel version (as reported by
<command>uname -r
</command>) matches a certain
297 expression. See
<varname>ConditionKernelVersion=
</varname> in
298 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
299 details. When prefixed with an exclamation mark (
<literal>!
</literal>), the result is negated.
300 If an empty string is assigned, the previously assigned value is cleared.
303 <xi:include href=
"version-info.xml" xpointer=
"v237"/>
307 <varlistentry id='credential'
>
308 <term><varname>Credential=
</varname></term>
310 <para>Checks whether the specified credential was passed to the
311 <filename>systemd-udevd.service
</filename> service. See
<ulink
312 url=
"https://systemd.io/CREDENTIALS">System and Service Credentials
</ulink> for details. When
313 prefixed with an exclamation mark (
<literal>!
</literal>), the result is negated. If an empty
314 string is assigned, the previously assigned value is cleared.
317 <xi:include href=
"version-info.xml" xpointer=
"v252"/>
321 <varlistentry id='architecture'
>
322 <term><varname>Architecture=
</varname></term>
324 <para>Checks whether the system is running on a specific architecture. See
325 <varname>ConditionArchitecture=
</varname> in
326 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
327 for details. When prefixed with an exclamation mark (
<literal>!
</literal>), the result is negated.
328 If an empty string is assigned, the previously assigned value is cleared.
331 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
335 <varlistentry id='firmware'
>
336 <term><varname>Firmware=
</varname></term>
338 <para>Checks whether the system is running on a machine with the specified firmware. See
339 <varname>ConditionFirmware=
</varname> in
340 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
341 for details. When prefixed with an exclamation mark (
<literal>!
</literal>), the result is negated.
342 If an empty string is assigned, the previously assigned value is cleared.
345 <xi:include href=
"version-info.xml" xpointer=
"v249"/>
353 <title>[Link] Section Options
</title>
355 <para>The [Link] section accepts the following
358 <variablelist class='network-directives'
>
360 <term><varname>Description=
</varname></term>
362 <para>A description of the device.
</para>
364 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
368 <term><varname>Property=
</varname></term>
370 <para>Set specified udev properties. This takes space separated list of key-value pairs
371 concatenated with equal sign (
<literal>=
</literal>). Example:
372 <programlisting>Property=HOGE=foo BAR=baz
</programlisting>
373 This option supports simple specifier expansion, see the Specifiers section below.
374 This option can be specified multiple times. If an empty string is assigned, then the all previous
375 assignments are cleared.
</para>
377 <para>This setting is useful to configure the
<literal>ID_NET_MANAGED_BY=
</literal> property which
378 declares which network management service shall manage the interface, which is respected by
379 systemd-networkd and others. Use
380 <programlisting>Property=ID_NET_MANAGED_BY=io.systemd.Network
</programlisting>
381 to declare explicitly that
<command>systemd-networkd
</command> shall manage the interface, or set
382 the property to something else to declare explicitly it shall not do so. See
383 <citerefentry><refentrytitle>systemd.network
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
384 for details how this property is used to match interface names.
</para>
386 <xi:include href=
"version-info.xml" xpointer=
"v256"/>
390 <term><varname>ImportProperty=
</varname></term>
392 <para>Import specified udev properties from the saved database. This takes space separated list of
393 property names. Example:
<programlisting>ImportProperty=HOGE BAR
</programlisting>
394 This option supports simple specifier expansion, see the Specifiers section below.
395 This option can be specified multiple times. If an empty string is assigned, then the all previous
396 assignments are cleared.
</para>
397 <para>If the same property is also set in
<varname>Property=
</varname> in the above, then the
398 imported property value will be overridden by the value specified in
<varname>Property=
</varname>.
401 <xi:include href=
"version-info.xml" xpointer=
"v256"/>
405 <term><varname>UnsetProperty=
</varname></term>
407 <para>Unset specified udev properties. This takes space separated list of
408 property names. Example:
<programlisting>ImportProperty=HOGE BAR
</programlisting>
409 This option supports simple specifier expansion, see the Specifiers section below.
410 This option can be specified multiple times. If an empty string is assigned, then the all previous
411 assignments are cleared.
</para>
412 <para>This setting is applied after
<varname>ImportProperty=
</varname> and
413 <varname>Property=
</varname> are applied. Hence, if the same property is specified in
414 <varname>ImportProperty=
</varname> or
<varname>Property=
</varname>, then the imported or specified
415 property value will be ignored, and the property will be unset.
</para>
417 <xi:include href=
"version-info.xml" xpointer=
"v256"/>
421 <term><varname>Alias=
</varname></term>
423 <para>The
<varname>ifalias
</varname> interface property is set to this value.
</para>
425 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
429 <term><varname>MACAddressPolicy=
</varname></term>
431 <para>The policy by which the MAC address should be set. The
432 available policies are:
437 <term><option>persistent
</option></term>
439 <para>If the hardware has a persistent MAC address, as
440 most hardware should, and if it is used by the kernel,
441 nothing is done. Otherwise, a new MAC address is
442 generated which is guaranteed to be the same on every
443 boot for the given machine and the given device, but
444 which is otherwise random. This feature depends on ID_NET_NAME_*
445 properties to exist for the link. On hardware where these
446 properties are not set, the generation of a persistent MAC address
449 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
453 <term><option>random
</option></term>
455 <para>If the kernel is using a random MAC address,
456 nothing is done. Otherwise, a new address is randomly
457 generated each time the device appears, typically at
458 boot. Either way, the random address will have the
459 <literal>unicast
</literal> and
460 <literal>locally administered
</literal> bits set.
</para>
462 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
466 <term><option>none
</option></term>
468 <para>Keeps the MAC address assigned by the kernel. Or use the MAC address specified in
469 <varname>MACAddress=
</varname>.
</para>
471 <xi:include href=
"version-info.xml" xpointer=
"v227"/>
476 <para>An empty string assignment is equivalent to setting
<literal>none
</literal>.
</para>
478 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
482 <term><varname>MACAddress=
</varname></term>
484 <para>The interface MAC address to use. For this setting to take effect,
485 <varname>MACAddressPolicy=
</varname> must either be unset, empty, or
<literal>none
</literal>.
488 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
492 <term><varname>NamePolicy=
</varname></term>
494 <para>An ordered, space-separated list of policies by which the interface name should be set.
495 <varname>NamePolicy=
</varname> may be disabled by specifying
<option>net.ifnames=
0</option> on the
496 kernel command line. Each of the policies may fail, and the first successful one is used. The name
497 is not set directly, but is exported to udev as the property
<option>ID_NET_NAME
</option>, which
498 is, by default, used by a
499 <citerefentry><refentrytitle>udev
</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
500 rule to set
<varname>NAME
</varname>. The available policies are:
505 <term><option>kernel
</option></term>
507 <para>If the kernel claims that the name it has set
508 for a device is predictable, then no renaming is
511 <xi:include href=
"version-info.xml" xpointer=
"v216"/>
515 <term><option>database
</option></term>
517 <para>The name is set based on entries in the udev's
518 Hardware Database with the key
519 <varname>ID_NET_NAME_FROM_DATABASE
</varname>.
522 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
526 <term><option>onboard
</option></term>
528 <para>The name is set based on information given by
529 the firmware for on-board devices, as exported by the
530 udev property
<varname>ID_NET_NAME_ONBOARD
</varname>.
531 See
<citerefentry><refentrytitle>systemd.net-naming-scheme
</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
534 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
538 <term><option>slot
</option></term>
540 <para>The name is set based on information given by
541 the firmware for hot-plug devices, as exported by the
542 udev property
<varname>ID_NET_NAME_SLOT
</varname>.
543 See
<citerefentry><refentrytitle>systemd.net-naming-scheme
</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
546 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
550 <term><option>path
</option></term>
552 <para>The name is set based on the device's physical
553 location, as exported by the udev property
554 <varname>ID_NET_NAME_PATH
</varname>.
555 See
<citerefentry><refentrytitle>systemd.net-naming-scheme
</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
558 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
562 <term><option>mac
</option></term>
564 <para>The name is set based on the device's persistent
565 MAC address, as exported by the udev property
566 <varname>ID_NET_NAME_MAC
</varname>.
567 See
<citerefentry><refentrytitle>systemd.net-naming-scheme
</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
570 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
574 <term><option>keep
</option></term>
576 <para>If the device already had a name given by userspace (as part of creation of the device
577 or a rename), keep it.
</para>
579 <xi:include href=
"version-info.xml" xpointer=
"v241"/>
584 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
588 <term><varname>Name=
</varname></term>
590 <para>The interface name to use. This option has lower precedence than
591 <varname>NamePolicy=
</varname>, so for this setting to take effect,
<varname>NamePolicy=
</varname>
592 must either be unset, empty, disabled, or all policies configured there must fail. Also see the
593 example below with
<literal>Name=dmz0
</literal>.
</para>
595 <para>Note that specifying a name that the kernel might use for another interface (for example
596 <literal>eth0
</literal>) is dangerous because the name assignment done by udev will race with the
597 assignment done by the kernel, and only one interface may use the name. Depending on the order of
598 operations, either udev or the kernel will win, making the naming unpredictable. It is best to use
599 some different prefix, for example
<literal>internal0
</literal>/
<literal>external0
</literal> or
600 <literal>lan0
</literal>/
<literal>lan1
</literal>/
<literal>lan3
</literal>.
</para>
602 <para>Interface names must have a minimum length of
1 character and a maximum length of
15
603 characters, and may contain any
7bit ASCII character, with the exception of control characters,
604 <literal>:
</literal>,
<literal>/
</literal> and
<literal>%
</literal>. While
<literal>.
</literal> is
605 an allowed character, it's recommended to avoid it when naming interfaces as various tools (such as
606 <citerefentry><refentrytitle>resolvconf
</refentrytitle><manvolnum>1</manvolnum></citerefentry>) use
607 it as separator character. Also, fully numeric interface names are not allowed (in order to avoid
608 ambiguity with interface specification by numeric indexes), as are the special strings
609 <literal>.
</literal>,
<literal>..
</literal>,
<literal>all
</literal> and
610 <literal>default
</literal>.
</para>
612 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
616 <term><varname>AlternativeNamesPolicy=
</varname></term>
618 <para>A space-separated list of policies by which the interface's alternative names
619 should be set. Each of the policies may fail, and all successful policies are used. The
620 available policies are
<literal>database
</literal>,
<literal>onboard
</literal>,
621 <literal>slot
</literal>,
<literal>path
</literal>, and
<literal>mac
</literal>. If the
622 kernel does not support the alternative names, then this setting will be ignored.
625 <xi:include href=
"version-info.xml" xpointer=
"v245"/>
629 <term><varname>AlternativeName=
</varname></term>
631 <para>The alternative interface name to use. This option can be specified multiple times.
632 If the empty string is assigned to this option, the list is reset, and all prior assignments
633 have no effect. If the kernel does not support the alternative names, then this setting will
636 <para>Alternative interface names may be used to identify interfaces in various tools. In contrast
637 to the primary name (as configured with
<varname>Name=
</varname> above) there may be multiple
638 alternative names referring to the same interface. Alternative names may have a maximum length of
639 127 characters, in contrast to the
15 allowed for the primary interface name, but otherwise are
640 subject to the same naming constraints.
</para>
642 <xi:include href=
"version-info.xml" xpointer=
"v245"/>
646 <term><varname>TransmitQueues=
</varname></term>
648 <para>Specifies the device's number of transmit queues. An integer in the range
1…
4096.
649 When unset, the kernel's default will be used.
</para>
651 <xi:include href=
"version-info.xml" xpointer=
"v248"/>
655 <term><varname>ReceiveQueues=
</varname></term>
657 <para>Specifies the device's number of receive queues. An integer in the range
1…
4096.
658 When unset, the kernel's default will be used.
</para>
660 <xi:include href=
"version-info.xml" xpointer=
"v248"/>
664 <term><varname>TransmitQueueLength=
</varname></term>
666 <para>Specifies the transmit queue length of the device in number of packets. An unsigned integer
667 in the range
0…
4294967294. When unset, the kernel's default will be used.
</para>
669 <xi:include href=
"version-info.xml" xpointer=
"v248"/>
673 <term><varname>MTUBytes=
</varname></term>
675 <para>The maximum transmission unit in bytes to set for the
676 device. The usual suffixes K, M, G are supported and are
677 understood to the base of
1024.
</para>
679 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
683 <term><varname>BitsPerSecond=
</varname></term>
685 <para>The speed to set for the device, the value is rounded
686 down to the nearest Mbps. The usual suffixes K, M, G are
687 supported and are understood to the base of
1000.
</para>
689 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
693 <term><varname>Duplex=
</varname></term>
695 <para>The duplex mode to set for the device. The accepted values are
<option>half
</option> and
696 <option>full
</option>.
</para>
698 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
702 <term><varname>AutoNegotiation=
</varname></term>
704 <para>Takes a boolean. If set to yes, automatic negotiation of transmission parameters is enabled.
705 Autonegotiation is a procedure by which two connected ethernet devices choose
706 common transmission parameters, such as speed, duplex mode, and flow control.
707 When unset, the kernel's default will be used.
</para>
709 <para>Note that if autonegotiation is enabled, speed and duplex settings are
710 read-only. If autonegotiation is disabled, speed and duplex settings are writable
711 if the driver supports multiple link modes.
</para>
713 <xi:include href=
"version-info.xml" xpointer=
"v233"/>
717 <term><varname>WakeOnLan=
</varname></term>
719 <para>The Wake-on-LAN policy to set for the device. Takes the special value
720 <literal>off
</literal> which disables Wake-on-LAN, or space separated list of the following
725 <term><option>phy
</option></term>
727 <para>Wake on PHY activity.
</para>
729 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
733 <term><option>unicast
</option></term>
735 <para>Wake on unicast messages.
</para>
737 <xi:include href=
"version-info.xml" xpointer=
"v235"/>
741 <term><option>multicast
</option></term>
743 <para>Wake on multicast messages.
</para>
745 <xi:include href=
"version-info.xml" xpointer=
"v235"/>
749 <term><option>broadcast
</option></term>
751 <para>Wake on broadcast messages.
</para>
753 <xi:include href=
"version-info.xml" xpointer=
"v235"/>
757 <term><option>arp
</option></term>
759 <para>Wake on ARP.
</para>
761 <xi:include href=
"version-info.xml" xpointer=
"v235"/>
765 <term><option>magic
</option></term>
767 <para>Wake on receipt of a magic packet.
770 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
774 <term><option>secureon
</option></term>
776 <para>Enable SecureOn password for MagicPacket. Implied when
777 <varname>WakeOnLanPassword=
</varname> is specified. If specified without
778 <varname>WakeOnLanPassword=
</varname> option, then the password is read from the
779 credential
<literal><replaceable>LINK
</replaceable>.link.wol.password
</literal> (e.g.,
780 <literal>60-foo.link.wol.password
</literal>), and if the credential not found, then
781 read from
<literal>wol.password
</literal>. See
782 <varname>ImportCredential=
</varname>/
<varname>LoadCredential=
</varname>/
<varname>SetCredential=
</varname> in
783 <citerefentry><refentrytitle>systemd.exec
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
784 for details. The password in the credential, must be
6 bytes in hex format with each
785 byte separated by a colon (
<literal>:
</literal>) like an Ethernet MAC address, e.g.,
786 <literal>aa:bb:cc:dd:ee:ff
</literal>.
</para>
788 <xi:include href=
"version-info.xml" xpointer=
"v235"/>
793 <para>Defaults to unset, and the device's default will be used. This setting can be specified
794 multiple times. If an empty string is assigned, then the all previous assignments are
797 <xi:include href=
"version-info.xml" xpointer=
"v211"/>
801 <term><varname>WakeOnLanPassword=
</varname></term>
803 <para>Specifies the SecureOn password for MagicPacket. Takes an absolute path to a regular
804 file or an
<constant>AF_UNIX
</constant> stream socket, or the plain password. When a path to
805 a regular file is specified, the password is read from it. When an
806 <constant>AF_UNIX
</constant> stream socket is specified, a connection is made to it and the
807 password is read from it. The password must be
6 bytes in hex format with each byte separated
808 by a colon (
<literal>:
</literal>) like an Ethernet MAC address, e.g.,
809 <literal>aa:bb:cc:dd:ee:ff
</literal>. This implies
<varname>WakeOnLan=secureon
</varname>.
810 Defaults to unset, and the current value will not be changed.
</para>
812 <xi:include href=
"version-info.xml" xpointer=
"v250"/>
816 <term><varname>Port=
</varname></term>
818 <para>The port option is used to select the device port. The
819 supported values are:
</para>
823 <term><option>tp
</option></term>
825 <para>An Ethernet interface using Twisted-Pair cable as the medium.
</para>
827 <xi:include href=
"version-info.xml" xpointer=
"v234"/>
831 <term><option>aui
</option></term>
833 <para>Attachment Unit Interface (AUI). Normally used with hubs.
836 <xi:include href=
"version-info.xml" xpointer=
"v234"/>
840 <term><option>bnc
</option></term>
842 <para>An Ethernet interface using BNC connectors and co-axial cable.
</para>
844 <xi:include href=
"version-info.xml" xpointer=
"v234"/>
848 <term><option>mii
</option></term>
850 <para>An Ethernet interface using a Media Independent Interface (MII).
</para>
852 <xi:include href=
"version-info.xml" xpointer=
"v234"/>
856 <term><option>fibre
</option></term>
858 <para>An Ethernet interface using Optical Fibre as the medium.
</para>
860 <xi:include href=
"version-info.xml" xpointer=
"v234"/>
865 <xi:include href=
"version-info.xml" xpointer=
"v234"/>
869 <term><varname>Advertise=
</varname></term>
871 <para>This sets what speeds and duplex modes of operation are advertised for auto-negotiation.
872 This implies
<literal>AutoNegotiation=yes
</literal>. The supported values are:
875 <title>Supported advertise values
</title>
877 <colspec colname='Advertise'
/>
878 <colspec colname='Speed'
/>
879 <colspec colname='Duplex Mode'
/>
882 <entry>Advertise
</entry>
883 <entry>Speed (Mbps)
</entry>
884 <entry>Duplex Mode
</entry>
886 <xi:include href=
"ethtool-link-mode.xml" />
890 By default this is unset, i.e. all possible modes will be advertised.
891 This option may be specified more than once, in which case all specified speeds and modes are advertised.
892 If the empty string is assigned to this option, the list is reset, and all prior assignments have no effect.
895 <xi:include href=
"version-info.xml" xpointer=
"v240"/>
899 <term><varname>ReceiveChecksumOffload=
</varname></term>
901 <para>Takes a boolean. If set to true, hardware offload for checksumming of ingress
902 network packets is enabled. When unset, the kernel's default will be used.
</para>
904 <xi:include href=
"version-info.xml" xpointer=
"v245"/>
908 <term><varname>TransmitChecksumOffload=
</varname></term>
910 <para>Takes a boolean. If set to true, hardware offload for checksumming of egress
911 network packets is enabled. When unset, the kernel's default will be used.
</para>
913 <xi:include href=
"version-info.xml" xpointer=
"v245"/>
917 <term><varname>TCPSegmentationOffload=
</varname></term>
919 <para>Takes a boolean. If set to true, TCP Segmentation Offload (TSO) is enabled.
920 When unset, the kernel's default will be used.
</para>
922 <xi:include href=
"version-info.xml" xpointer=
"v232"/>
926 <term><varname>TCP6SegmentationOffload=
</varname></term>
928 <para>Takes a boolean. If set to true, TCP6 Segmentation Offload (tx-tcp6-segmentation) is enabled.
929 When unset, the kernel's default will be used.
</para>
931 <xi:include href=
"version-info.xml" xpointer=
"v235"/>
935 <term><varname>GenericSegmentationOffload=
</varname></term>
937 <para>Takes a boolean. If set to true, Generic Segmentation Offload (GSO) is enabled.
938 When unset, the kernel's default will be used.
</para>
940 <xi:include href=
"version-info.xml" xpointer=
"v232"/>
944 <term><varname>GenericReceiveOffload=
</varname></term>
946 <para>Takes a boolean. If set to true, Generic Receive Offload (GRO) is enabled.
947 When unset, the kernel's default will be used.
</para>
949 <xi:include href=
"version-info.xml" xpointer=
"v232"/>
953 <term><varname>GenericReceiveOffloadHardware=
</varname></term>
955 <para>Takes a boolean. If set to true, hardware accelerated Generic Receive Offload (GRO) is
956 enabled. When unset, the kernel's default will be used.
</para>
958 <xi:include href=
"version-info.xml" xpointer=
"v250"/>
962 <term><varname>LargeReceiveOffload=
</varname></term>
964 <para>Takes a boolean. If set to true, Large Receive Offload (LRO) is enabled.
965 When unset, the kernel's default will be used.
</para>
967 <xi:include href=
"version-info.xml" xpointer=
"v232"/>
971 <term><varname>ReceiveVLANCTAGHardwareAcceleration=
</varname></term>
973 <para>Takes a boolean. If set to true, receive VLAN CTAG hardware acceleration is enabled.
974 When unset, the kernel's default will be used.
</para>
976 <xi:include href=
"version-info.xml" xpointer=
"v250"/>
980 <term><varname>TransmitVLANCTAGHardwareAcceleration=
</varname></term>
982 <para>Takes a boolean. If set to true, transmit VLAN CTAG hardware acceleration is enabled.
983 When unset, the kernel's default will be used.
</para>
985 <xi:include href=
"version-info.xml" xpointer=
"v250"/>
989 <term><varname>ReceiveVLANCTAGFilter=
</varname></term>
991 <para>Takes a boolean. If set to true, receive filtering on VLAN CTAGs is enabled.
992 When unset, the kernel's default will be used.
</para>
994 <xi:include href=
"version-info.xml" xpointer=
"v250"/>
998 <term><varname>TransmitVLANSTAGHardwareAcceleration=
</varname></term>
1000 <para>Takes a boolean. If set to true, transmit VLAN STAG hardware acceleration is enabled.
1001 When unset, the kernel's default will be used.
</para>
1003 <xi:include href=
"version-info.xml" xpointer=
"v250"/>
1007 <term><varname>NTupleFilter=
</varname></term>
1009 <para>Takes a boolean. If set to true, receive N-tuple filters and actions are enabled.
1010 When unset, the kernel's default will be used.
</para>
1012 <xi:include href=
"version-info.xml" xpointer=
"v250"/>
1016 <term><varname>RxChannels=
</varname></term>
1017 <term><varname>TxChannels=
</varname></term>
1018 <term><varname>OtherChannels=
</varname></term>
1019 <term><varname>CombinedChannels=
</varname></term>
1021 <para>Specifies the number of receive, transmit, other, or combined channels, respectively.
1022 Takes an unsigned integer in the range
1…
4294967295 or
<literal>max
</literal>. If set to
1023 <literal>max
</literal>, the advertised maximum value of the hardware will be used. When
1024 unset, the number will not be changed. Defaults to unset.
</para>
1026 <xi:include href=
"version-info.xml" xpointer=
"v239"/>
1030 <term><varname>RxBufferSize=
</varname></term>
1031 <term><varname>RxMiniBufferSize=
</varname></term>
1032 <term><varname>RxJumboBufferSize=
</varname></term>
1033 <term><varname>TxBufferSize=
</varname></term>
1035 <para>Specifies the maximum number of pending packets in the NIC receive buffer, mini receive
1036 buffer, jumbo receive buffer, or transmit buffer, respectively. Takes an unsigned integer in
1037 the range
1…
4294967295 or
<literal>max
</literal>. If set to
<literal>max
</literal>, the
1038 advertised maximum value of the hardware will be used. When unset, the number will not be
1039 changed. Defaults to unset.
</para>
1041 <xi:include href=
"version-info.xml" xpointer=
"v244"/>
1045 <term><varname>RxFlowControl=
</varname></term>
1047 <para>Takes a boolean. When set, enables receive flow control, also known as the ethernet
1048 receive PAUSE message (generate and send ethernet PAUSE frames). When unset, the kernel's
1049 default will be used.
</para>
1051 <xi:include href=
"version-info.xml" xpointer=
"v246"/>
1055 <term><varname>TxFlowControl=
</varname></term>
1057 <para>Takes a boolean. When set, enables transmit flow control, also known as the ethernet
1058 transmit PAUSE message (respond to received ethernet PAUSE frames). When unset, the kernel's
1059 default will be used.
</para>
1061 <xi:include href=
"version-info.xml" xpointer=
"v246"/>
1065 <term><varname>AutoNegotiationFlowControl=
</varname></term>
1067 <para>Takes a boolean. When set, auto negotiation enables the interface to exchange state
1068 advertisements with the connected peer so that the two devices can agree on the ethernet
1069 PAUSE configuration. When unset, the kernel's default will be used.
</para>
1071 <xi:include href=
"version-info.xml" xpointer=
"v246"/>
1075 <term><varname>GenericSegmentOffloadMaxBytes=
</varname></term>
1077 <para>Specifies the maximum size of a Generic Segment Offload (GSO) packet the
1078 device should accept. The usual suffixes K, M, G are supported and are
1079 understood to the base of
1024. An unsigned integer in the range
1…
65536.
1080 Defaults to unset.
</para>
1082 <xi:include href=
"version-info.xml" xpointer=
"v248"/>
1086 <term><varname>GenericSegmentOffloadMaxSegments=
</varname></term>
1088 <para>Specifies the maximum number of Generic Segment Offload (GSO) segments the device should
1089 accept. An unsigned integer in the range
1…
65535. Defaults to unset.
</para>
1091 <xi:include href=
"version-info.xml" xpointer=
"v248"/>
1095 <term><varname>UseAdaptiveRxCoalesce=
</varname></term>
1096 <term><varname>UseAdaptiveTxCoalesce=
</varname></term>
1098 <para>Boolean properties that, when set, enable/disable adaptive Rx/Tx coalescing if the hardware
1099 supports it. When unset, the kernel's default will be used.
</para>
1101 <xi:include href=
"version-info.xml" xpointer=
"v250"/>
1105 <term><varname>RxCoalesceSec=
</varname></term>
1106 <term><varname>RxCoalesceIrqSec=
</varname></term>
1107 <term><varname>RxCoalesceLowSec=
</varname></term>
1108 <term><varname>RxCoalesceHighSec=
</varname></term>
1109 <term><varname>TxCoalesceSec=
</varname></term>
1110 <term><varname>TxCoalesceIrqSec=
</varname></term>
1111 <term><varname>TxCoalesceLowSec=
</varname></term>
1112 <term><varname>TxCoalesceHighSec=
</varname></term>
1114 <para>These properties configure the delay before Rx/Tx interrupts are generated after a packet is
1115 sent/received. The
<literal>Irq
</literal> properties come into effect when the host is servicing an
1116 IRQ. The
<literal>Low
</literal> and
<literal>High
</literal> properties come into effect when the
1117 packet rate drops below the low packet rate threshold or exceeds the high packet rate threshold
1118 respectively if adaptive Rx/Tx coalescing is enabled. When unset, the kernel's defaults will be
1121 <xi:include href=
"version-info.xml" xpointer=
"v250"/>
1125 <term><varname>RxMaxCoalescedFrames=
</varname></term>
1126 <term><varname>RxMaxCoalescedIrqFrames=
</varname></term>
1127 <term><varname>RxMaxCoalescedLowFrames=
</varname></term>
1128 <term><varname>RxMaxCoalescedHighFrames=
</varname></term>
1129 <term><varname>TxMaxCoalescedFrames=
</varname></term>
1130 <term><varname>TxMaxCoalescedIrqFrames=
</varname></term>
1131 <term><varname>TxMaxCoalescedLowFrames=
</varname></term>
1132 <term><varname>TxMaxCoalescedHighFrames=
</varname></term>
1134 <para>These properties configure the maximum number of frames that are sent/received before a Rx/Tx
1135 interrupt is generated. The
<literal>Irq
</literal> properties come into effect when the host is
1136 servicing an IRQ. The
<literal>Low
</literal> and
<literal>High
</literal> properties come into
1137 effect when the packet rate drops below the low packet rate threshold or exceeds the high packet
1138 rate threshold respectively if adaptive Rx/Tx coalescing is enabled. When unset, the kernel's
1139 defaults will be used.
</para>
1141 <xi:include href=
"version-info.xml" xpointer=
"v250"/>
1145 <term><varname>CoalescePacketRateLow=
</varname></term>
1146 <term><varname>CoalescePacketRateHigh=
</varname></term>
1148 <para>These properties configure the low and high packet rate (expressed in packets per second)
1149 threshold respectively and are used to determine when the corresponding coalescing settings for low
1150 and high packet rates come into effect if adaptive Rx/Tx coalescing is enabled. If unset, the
1151 kernel's defaults will be used.
</para>
1153 <xi:include href=
"version-info.xml" xpointer=
"v250"/>
1157 <term><varname>CoalescePacketRateSampleIntervalSec=
</varname></term>
1159 <para>Configures how often to sample the packet rate used for adaptive Rx/Tx coalescing. This
1160 property cannot be zero. This lowest time granularity supported by this property is seconds.
1161 Partial seconds will be rounded up before being passed to the kernel. If unset, the kernel's
1162 default will be used.
</para>
1164 <xi:include href=
"version-info.xml" xpointer=
"v250"/>
1168 <term><varname>StatisticsBlockCoalesceSec=
</varname></term>
1170 <para>How long to delay driver in-memory statistics block updates. If the driver does not have an
1171 in-memory statistic block, this property is ignored. This property cannot be zero. If unset, the
1172 kernel's default will be used.
</para>
1174 <xi:include href=
"version-info.xml" xpointer=
"v250"/>
1179 <term><varname>MDI=
</varname></term>
1181 <para>Specifies the medium dependent interface (MDI) mode for the interface. A MDI describes
1182 the interface from a physical layer implementation to the physical medium used to carry the
1183 transmission. Takes one of the following words:
<literal>straight
</literal> (or equivalently:
1184 <literal>mdi
</literal>),
<literal>crossover
</literal> (or equivalently:
1185 <literal>mdi-x
</literal>,
<literal>mdix
</literal>), and
<literal>auto
</literal>. When
1186 <literal>straight
</literal>, the MDI straight through mode will be used. When
1187 <literal>crossover
</literal>, the MDI crossover (MDI-X) mode will be used. When
1188 <literal>auto
</literal>, the MDI status is automatically detected. Defaults to unset, and the
1189 kernel's default will be used.
</para>
1191 <xi:include href=
"version-info.xml" xpointer=
"v251"/>
1196 <term><varname>SR-IOVVirtualFunctions=
</varname></term>
1198 <para>Specifies the number of SR-IOV virtual functions. Takes an integer in the range
1199 0…
2147483647. Defaults to unset, and automatically determined from the values specified in
1200 the
<varname>VirtualFunction=
</varname> settings in the [SR-IOV] sections.
</para>
1202 <xi:include href=
"version-info.xml" xpointer=
"v251"/>
1209 <refsect1 id='sr-iov'
>
1210 <title>[SR-IOV] Section Options
</title>
1211 <para>The [SR-IOV] section accepts the following keys. Specify several [SR-IOV] sections to
1212 configure several SR-IOVs. SR-IOV provides the ability to partition a single physical PCI resource
1213 into virtual PCI functions which can then be injected into a VM. In the case of network VFs, SR-IOV
1214 improves north-south network performance (that is, traffic with endpoints outside the host machine)
1215 by allowing traffic to bypass the host machine’s network stack.
</para>
1217 <variablelist class='network-directives'
>
1219 <term><varname>VirtualFunction=
</varname></term>
1221 <para>Specifies a Virtual Function (VF), lightweight PCIe function designed solely to move
1222 data in and out. Takes an integer in the range
0…
2147483646. This option is compulsory.
1225 <xi:include href=
"version-info.xml" xpointer=
"v251"/>
1230 <term><varname>VLANId=
</varname></term>
1232 <para>Specifies VLAN ID of the virtual function. Takes an integer in the range
1…
4095.
</para>
1234 <xi:include href=
"version-info.xml" xpointer=
"v251"/>
1239 <term><varname>QualityOfService=
</varname></term>
1241 <para>Specifies quality of service of the virtual function. Takes an integer in the range
1242 1…
4294967294.
</para>
1244 <xi:include href=
"version-info.xml" xpointer=
"v251"/>
1249 <term><varname>VLANProtocol=
</varname></term>
1251 <para>Specifies VLAN protocol of the virtual function. Takes
<literal>802.1Q
</literal> or
1252 <literal>802.1ad
</literal>.
</para>
1254 <xi:include href=
"version-info.xml" xpointer=
"v251"/>
1259 <term><varname>MACSpoofCheck=
</varname></term>
1261 <para>Takes a boolean. Controls the MAC spoof checking. When unset, the kernel's default will
1264 <xi:include href=
"version-info.xml" xpointer=
"v251"/>
1269 <term><varname>QueryReceiveSideScaling=
</varname></term>
1271 <para>Takes a boolean. Toggle the ability of querying the receive side scaling (RSS)
1272 configuration of the virtual function (VF). The VF RSS information like RSS hash key may be
1273 considered sensitive on some devices where this information is shared between VF and the
1274 physical function (PF). When unset, the kernel's default will be used.
</para>
1276 <xi:include href=
"version-info.xml" xpointer=
"v251"/>
1281 <term><varname>Trust=
</varname></term>
1283 <para>Takes a boolean. Allows one to set trust mode of the virtual function (VF). When set,
1284 VF users can set a specific feature which may impact security and/or performance. When unset,
1285 the kernel's default will be used.
</para>
1287 <xi:include href=
"version-info.xml" xpointer=
"v251"/>
1292 <term><varname>LinkState=
</varname></term>
1294 <para>Allows one to set the link state of the virtual function (VF). Takes a boolean or a
1295 special value
<literal>auto
</literal>. Setting to
<literal>auto
</literal> means a
1296 reflection of the physical function (PF) link state,
<literal>yes
</literal> lets the VF to
1297 communicate with other VFs on this host even if the PF link state is down,
1298 <literal>no
</literal> causes the hardware to drop any packets sent by the VF. When unset,
1299 the kernel's default will be used.
</para>
1301 <xi:include href=
"version-info.xml" xpointer=
"v251"/>
1306 <term><varname>MACAddress=
</varname></term>
1308 <para>Specifies the MAC address for the virtual function.
</para>
1310 <xi:include href=
"version-info.xml" xpointer=
"v251"/>
1317 <title>Specifiers
</title>
1319 <para>Some settings resolve specifiers which may be used to write generic unit files referring to runtime
1320 or unit parameters that are replaced when the unit files are loaded. Specifiers must be known and
1321 resolvable for the setting to be valid. The following specifiers are understood:
</para>
1323 <table class='specifiers'
>
1324 <title>Specifiers available in unit files
</title>
1325 <tgroup cols='
3' align='left' colsep='
1' rowsep='
1'
>
1326 <colspec colname=
"spec" />
1327 <colspec colname=
"mean" />
1328 <colspec colname=
"detail" />
1331 <entry>Specifier
</entry>
1332 <entry>Meaning
</entry>
1333 <entry>Details
</entry>
1337 <xi:include href=
"standard-specifiers.xml" xpointer=
"a"/>
1338 <xi:include href=
"standard-specifiers.xml" xpointer=
"A"/>
1339 <xi:include href=
"standard-specifiers.xml" xpointer=
"b"/>
1340 <xi:include href=
"standard-specifiers.xml" xpointer=
"B"/>
1341 <xi:include href=
"standard-specifiers.xml" xpointer=
"H"/>
1342 <xi:include href=
"standard-specifiers.xml" xpointer=
"l"/>
1343 <xi:include href=
"standard-specifiers.xml" xpointer=
"m"/>
1344 <xi:include href=
"standard-specifiers.xml" xpointer=
"M"/>
1345 <xi:include href=
"standard-specifiers.xml" xpointer=
"o"/>
1346 <xi:include href=
"standard-specifiers.xml" xpointer=
"q"/>
1347 <xi:include href=
"standard-specifiers.xml" xpointer=
"T"/>
1348 <xi:include href=
"standard-specifiers.xml" xpointer=
"v"/>
1349 <xi:include href=
"standard-specifiers.xml" xpointer=
"V"/>
1350 <xi:include href=
"standard-specifiers.xml" xpointer=
"w"/>
1351 <xi:include href=
"standard-specifiers.xml" xpointer=
"W"/>
1358 <title>Examples
</title>
1361 <title>/usr/lib/systemd/network/
99-default.link
</title>
1363 <para>The link file
<filename>99-default.link
</filename> that is shipped with systemd defines the
1364 default policies for the interface name, alternative names, and MAC address of links.
</para>
1366 <programlisting>[Match]
1370 NamePolicy=keep kernel database onboard slot path
1371 AlternativeNamesPolicy=database onboard slot path
1372 MACAddressPolicy=persistent
</programlisting>
1376 <title>/etc/systemd/network/
10-dmz.link
</title>
1378 <para>This example assigns the fixed name
<literal>dmz0
</literal> to the interface with the MAC address
1379 00:a0:de:
63:
7a:e6:
</para>
1381 <programlisting>[Match]
1382 MACAddress=
00:a0:de:
63:
7a:e6
1385 Name=dmz0
</programlisting>
1387 <para><varname>NamePolicy=
</varname> is not set, so
<varname>Name=
</varname> takes effect. We use the
1388 <literal>10-
</literal> prefix to order this file early in the list. Note that it needs to be before
1389 <filename>99-default.link
</filename>, i.e. it needs a numerical prefix, to have any effect at all.
</para>
1393 <title>(Re-)applying a .link file to an interface
</title>
1395 <para>After a new .link file has been created, or an existing .link file modified, the new settings
1396 may be applied to the matching interface with the following commands:
</para>
1398 <programlisting>$ sudo udevadm control --reload
1399 $ sudo ip link set eth0 down
1400 $ sudo udevadm trigger --verbose --settle --action add /sys/class/net/eth0
</programlisting>
1402 <para>You may also need to stop the service that manages the network interface, e.g.
1403 <citerefentry><refentrytitle>systemd-networkd.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
1404 or
<filename>NetworkManager.service
</filename> before the above operation, and then restart the service
1405 after that. For more details about
<command>udevadm
</command> command, see
1406 <citerefentry><refentrytitle>udevadm
</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
</para>
1410 <title>Debugging
<varname>NamePolicy=
</varname> assignments
</title>
1412 <programlisting>$ sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/hub0
1414 Parsed configuration file /usr/lib/systemd/network/
99-default.link
1415 Parsed configuration file /etc/systemd/network/
10-eth0.link
1416 ID_NET_DRIVER=cdc_ether
1417 Config file /etc/systemd/network/
10-eth0.link applies to device hub0
1418 link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
1419 hub0: Device has name_assign_type=
4
1420 Using default interface naming scheme 'v240'.
1421 hub0: Policies didn't yield a name, using specified Name=hub0.
1422 ID_NET_LINK_FILE=/etc/systemd/network/
10-eth0.link
1426 <para>Explicit
<varname>Name=
</varname> configuration wins in this case.
</para>
1428 <programlisting>sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/enp0s31f6
1430 Parsed configuration file /usr/lib/systemd/network/
99-default.link
1431 Parsed configuration file /etc/systemd/network/
10-eth0.link
1432 Created link configuration context.
1433 ID_NET_DRIVER=e1000e
1434 Config file /usr/lib/systemd/network/
99-default.link applies to device enp0s31f6
1435 link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
1436 enp0s31f6: Device has name_assign_type=
4
1437 Using default interface naming scheme 'v240'.
1438 enp0s31f6: Policy *keep*: keeping existing userspace name
1439 enp0s31f6: Device has addr_assign_type=
0
1440 enp0s31f6: MAC on the device already matches policy *persistent*
1441 ID_NET_LINK_FILE=/usr/lib/systemd/network/
99-default.link
1445 <para>In this case, the interface was already renamed, so the
<option>keep
</option> policy specified as
1446 the first option in
<filename index=
"false">99-default.link
</filename> means that the existing name is
1447 preserved. If
<option>keep
</option> was removed, or if were in boot before the renaming has happened,
1448 we might get the following instead:
</para>
1450 <programlisting>enp0s31f6: Policy *path* yields
"enp0s31f6".
1451 enp0s31f6: Device has addr_assign_type=
0
1452 enp0s31f6: MAC on the device already matches policy *persistent*
1453 ID_NET_LINK_FILE=/usr/lib/systemd/network/
99-default.link
1454 ID_NET_NAME=enp0s31f6
1458 <para>Please note that the details of output are subject to change.
</para>
1462 <title>/etc/systemd/network/
10-internet.link
</title>
1464 <para>This example assigns the fixed name
1465 <literal>internet0
</literal> to the interface with the device
1466 path
<literal>pci-
0000:
00:
1a
.0-*
</literal>:
</para>
1468 <programlisting>[Match]
1469 Path=pci-
0000:
00:
1a
.0-*
1472 Name=internet0
</programlisting>
1476 <title>/etc/systemd/network/
25-wireless.link
</title>
1478 <para>Here's an overly complex example that shows the use of a large number of [Match] and [Link] settings.
</para>
1480 <programlisting>[Match]
1481 MACAddress=
12:
34:
56:
78:
9a:bc
1483 Path=pci-
0000:
02:
00.0-*
1494 MACAddress=cb:a9:
87:
65:
43:
21</programlisting>
1499 <title>See Also
</title>
1500 <para><simplelist type=
"inline">
1501 <member><citerefentry>
1502 <refentrytitle>systemd-udevd.service
</refentrytitle><manvolnum>8</manvolnum>
1503 </citerefentry></member>
1504 <member><citerefentry>
1505 <refentrytitle>udevadm
</refentrytitle><manvolnum>8</manvolnum>
1506 </citerefentry></member>
1507 <member><citerefentry>
1508 <refentrytitle>systemd.netdev
</refentrytitle><manvolnum>5</manvolnum>
1509 </citerefentry></member>
1510 <member><citerefentry>
1511 <refentrytitle>systemd.network
</refentrytitle><manvolnum>5</manvolnum>
1512 </citerefentry></member>
1513 <member><citerefentry>
1514 <refentrytitle>systemd-network-generator.service
</refentrytitle><manvolnum>8</manvolnum>
1515 </citerefentry></member>
1516 </simplelist></para>