]>
Commit | Line | Data |
---|---|---|
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 | |
cc9b6bdc YW |
35 | <para>The <filename>.link</filename> files are read from the files located in the system network |
36 | directory <filename>/usr/lib/systemd/network</filename> and | |
37 | <filename>/usr/local/lib/systemd/network</filename>, the volatile runtime network directory | |
e406e8a2 | 38 | <filename>/run/systemd/network</filename>, and the local administration network directory |
cc9b6bdc YW |
39 | <filename>/etc/systemd/network</filename>. All configuration files are collectively sorted and |
40 | processed in alphanumeric order, regardless of the directories in which they live. However, files | |
41 | with identical filenames replace each other. It is recommended that each filename is prefixed with | |
42 | a number (e.g. <filename>10-eth0.link</filename>). Otherwise, the default | |
43 | <filename>.link</filename> files or those generated by | |
44 | <citerefentry><refentrytitle>systemd-network-generator.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
45 | may take precedence over user configured files. Files in <filename>/etc/</filename> have the | |
46 | highest priority, files in <filename>/run/</filename> take precedence over files with the same name | |
47 | in <filename>/usr/lib/</filename>. This can be used to override a system-supplied link file with a | |
e406e8a2 YW |
48 | local file if needed. As a special case, an empty file (file size 0) or symlink with the same name |
49 | pointing to <filename>/dev/null</filename> disables the configuration file entirely (it is | |
50 | "masked").</para> | |
51 | ||
52 | <para>Along with the link file <filename>foo.link</filename>, a "drop-in" directory | |
53 | <filename>foo.link.d/</filename> may exist. All files with the suffix <literal>.conf</literal> | |
e6655fbe YW |
54 | from this directory will be merged in the alphanumeric order and parsed after the main file itself |
55 | has been parsed. This is useful to alter or add configuration settings, without having to modify | |
56 | the main configuration file. Each drop-in file must have appropriate section headers.</para> | |
e406e8a2 YW |
57 | |
58 | <para>In addition to <filename>/etc/systemd/network</filename>, drop-in <literal>.d</literal> | |
59 | directories can be placed in <filename>/usr/lib/systemd/network</filename> or | |
60 | <filename>/run/systemd/network</filename> directories. Drop-in files in <filename>/etc/</filename> | |
61 | take precedence over those in <filename>/run/</filename> which in turn take precedence over those | |
62 | in <filename>/usr/lib/</filename>. Drop-in files under any of these directories take precedence | |
63 | over the main link file wherever located.</para> | |
1ff28eae | 64 | |
d7dce7b6 ZJS |
65 | <para>The link file contains a [Match] section, which determines if a given link file may be applied to a |
66 | given device, as well as a [Link] section specifying how the device should be configured. The first (in | |
67 | lexical order) of the link files that matches a given device is applied. Note that a default file | |
68 | <filename>99-default.link</filename> is shipped by the system. Any user-supplied | |
69 | <filename>.link</filename> should hence have a lexically earlier name to be considered at all.</para> | |
70 | ||
71 | <para>See <citerefentry><refentrytitle>udevadm</refentrytitle><manvolnum>8</manvolnum></citerefentry> for | |
72 | diagnosing problems with <filename>.link</filename> files.</para> | |
798d3a52 | 73 | </refsect1> |
102bd40e | 74 | |
798d3a52 ZJS |
75 | <refsect1> |
76 | <title>[Match] Section Options</title> | |
1ff28eae | 77 | |
cc9b6bdc YW |
78 | <para>A link file is said to match an interface if all matches specified by the [Match] section are |
79 | satisfied. When a link file does not contain valid settings in [Match] section, then the file will | |
80 | match all interfaces and <command>systemd-udevd</command> warns about that. Hint: to avoid the | |
81 | warning and to make it clear that all interfaces shall be matched, add the following: | |
84ea567e | 82 | <programlisting>OriginalName=*</programlisting> |
cc9b6bdc YW |
83 | The first (in alphanumeric order) of the link files that matches a given interface is applied, all |
84 | later files are ignored, even if they match as well. The following keys are accepted:</para> | |
1ff28eae | 85 | |
798d3a52 | 86 | <variablelist class='network-directives'> |
d9b20454 ZJS |
87 | <!-- This list is reused in systemd.network(3), hence maintain a specific order: |
88 | 1. device matches shared between the two lists | |
89 | 2. non-shared settings | |
90 | 3. host matches shared between the two lists | |
91 | --> | |
92 | ||
93 | <varlistentry id='mac-address'> | |
798d3a52 ZJS |
94 | <term><varname>MACAddress=</varname></term> |
95 | <listitem> | |
52135071 YW |
96 | <para>A whitespace-separated list of hardware addresses. The acceptable formats are:</para> |
97 | ||
98 | <variablelist> | |
99 | <varlistentry> | |
100 | <term><option>colon-delimited hexadecimal</option></term> | |
101 | <listitem><para> | |
102 | Each field must be one byte. | |
103 | E.g. <literal>12:34:56:78:90:ab</literal> or <literal>AA:BB:CC:DD:EE:FF</literal>. | |
104 | </para></listitem> | |
105 | </varlistentry> | |
106 | <varlistentry> | |
107 | <term><option>hyphen-delimited hexadecimal</option></term> | |
108 | <listitem><para> | |
109 | Each field must be one byte. | |
110 | E.g. <literal>12-34-56-78-90-ab</literal> or <literal>AA-BB-CC-DD-EE-FF</literal>. | |
111 | </para></listitem> | |
112 | </varlistentry> | |
113 | <varlistentry> | |
114 | <term><option>dot-delimited hexadecimal</option></term> | |
115 | <listitem><para> | |
116 | Each field must be two bytes. | |
117 | E.g. <literal>1234.5678.90ab</literal> or <literal>AABB.CCDD.EEFF</literal>. | |
118 | </para></listitem> | |
119 | </varlistentry> | |
120 | <varlistentry> | |
121 | <term><option>IPv4 address format</option></term> | |
122 | <listitem><para> | |
123 | E.g. <literal>127.0.0.1</literal> or <literal>192.168.0.1</literal>. | |
124 | </para></listitem> | |
125 | </varlistentry> | |
126 | <varlistentry> | |
127 | <term><option>IPv6 address format</option></term> | |
128 | <listitem><para> | |
129 | E.g. <literal>2001:0db8:85a3::8a2e:0370:7334</literal> or <literal>::1</literal>. | |
130 | </para></listitem> | |
131 | </varlistentry> | |
132 | </variablelist> | |
133 | ||
134 | <para>The total length of each MAC address must be 4 (for IPv4 tunnel), 6 (for Ethernet), 16 | |
135 | (for IPv6 tunnel), or 20 (for InfiniBand). This option may appear more than once, in which | |
136 | case the lists are merged. If the empty string is assigned to this option, the list of | |
137 | hardware addresses defined prior to this is reset. Defaults to unset.</para> | |
798d3a52 ZJS |
138 | </listitem> |
139 | </varlistentry> | |
d9b20454 ZJS |
140 | |
141 | <varlistentry id='permanent-mac-address'> | |
4bb7cc82 YW |
142 | <term><varname>PermanentMACAddress=</varname></term> |
143 | <listitem> | |
144 | <para>A whitespace-separated list of hardware's permanent addresses. While | |
145 | <varname>MACAddress=</varname> matches the device's current MAC address, this matches the | |
146 | device's permanent MAC address, which may be different from the current one. Use full | |
52135071 YW |
147 | colon-, hyphen- or dot-delimited hexadecimal, or IPv4 or IPv6 address format. This option may |
148 | appear more than once, in which case the lists are merged. If the empty string is assigned to | |
149 | this option, the list of hardware addresses defined prior to this is reset. Defaults to | |
150 | unset.</para> | |
4bb7cc82 YW |
151 | </listitem> |
152 | </varlistentry> | |
d9b20454 ZJS |
153 | |
154 | <varlistentry id='path'> | |
798d3a52 ZJS |
155 | <term><varname>Path=</varname></term> |
156 | <listitem> | |
5256e00e TG |
157 | <para>A whitespace-separated list of shell-style globs matching |
158 | the persistent path, as exposed by the udev property | |
d7dce7b6 | 159 | <varname>ID_PATH</varname>.</para> |
798d3a52 ZJS |
160 | </listitem> |
161 | </varlistentry> | |
d9b20454 ZJS |
162 | |
163 | <varlistentry id='driver'> | |
798d3a52 ZJS |
164 | <term><varname>Driver=</varname></term> |
165 | <listitem> | |
d7dce7b6 | 166 | <para>A whitespace-separated list of shell-style globs matching the driver currently bound to the |
d9b20454 ZJS |
167 | device, as exposed by the udev property <varname>ID_NET_DRIVER</varname> of its parent device, or |
168 | if that is not set, the driver as exposed by <command>ethtool -i</command> of the device itself. | |
169 | If the list is prefixed with a "!", the test is inverted.</para> | |
798d3a52 ZJS |
170 | </listitem> |
171 | </varlistentry> | |
d9b20454 ZJS |
172 | |
173 | <varlistentry id='type'> | |
798d3a52 ZJS |
174 | <term><varname>Type=</varname></term> |
175 | <listitem> | |
ef62949a | 176 | <para>A whitespace-separated list of shell-style globs matching the device type, as exposed by |
2480ca95 LM |
177 | <command>networkctl list</command>. If the list is prefixed with a "!", the test is inverted. |
178 | Some valid values are <literal>ether</literal>, <literal>loopback</literal>, <literal>wlan</literal>, <literal>wwan</literal>. | |
179 | Valid types are named either from the udev <literal>DEVTYPE</literal> attribute, or | |
180 | <literal>ARPHRD_</literal> macros in <filename>linux/if_arp.h</filename>, so this is not comprehensive. | |
ef62949a | 181 | </para> |
798d3a52 ZJS |
182 | </listitem> |
183 | </varlistentry> | |
d9b20454 | 184 | |
65022cd7 YW |
185 | <varlistentry id='kind'> |
186 | <term><varname>Kind=</varname></term> | |
187 | <listitem> | |
188 | <para>A whitespace-separated list of shell-style globs matching the device kind, as exposed by | |
189 | <command>networkctl status <replaceable>INTERFACE</replaceable></command> or | |
190 | <command>ip -d link show <replaceable>INTERFACE</replaceable></command>. If the list is | |
191 | prefixed with a "!", the test is inverted. Some valid values are <literal>bond</literal>, | |
192 | <literal>bridge</literal>, <literal>gre</literal>, <literal>tun</literal>, | |
193 | <literal>veth</literal>. Valid kinds are given by netlink's <literal>IFLA_INFO_KIND</literal> | |
194 | attribute, so this is not comprehensive. | |
195 | </para> | |
196 | </listitem> | |
197 | </varlistentry> | |
198 | ||
d9b20454 | 199 | <varlistentry id='property'> |
44005bfb YW |
200 | <term><varname>Property=</varname></term> |
201 | <listitem> | |
387f6955 | 202 | <para>A whitespace-separated list of udev property names with their values after equals sign |
44005bfb YW |
203 | (<literal>=</literal>). If multiple properties are specified, the test results are ANDed. |
204 | If the list is prefixed with a "!", the test is inverted. If a value contains white | |
205 | spaces, then please quote whole key and value pair. If a value contains quotation, then | |
206 | please escape the quotation with <literal>\</literal>.</para> | |
207 | ||
208 | <para>Example: if a .link file has the following: | |
209 | <programlisting>Property=ID_MODEL_ID=9999 "ID_VENDOR_FROM_DATABASE=vendor name" "KEY=with \"quotation\""</programlisting> | |
210 | then, the .link file matches only when an interface has all the above three properties. | |
211 | </para> | |
212 | </listitem> | |
213 | </varlistentry> | |
d9b20454 | 214 | |
798d3a52 | 215 | <varlistentry> |
d9b20454 ZJS |
216 | <term><varname>OriginalName=</varname></term> |
217 | <listitem> | |
218 | <para>A whitespace-separated list of shell-style globs matching the device name, as exposed by the | |
219 | udev property "INTERFACE". This cannot be used to match on names that have already been changed | |
220 | from userspace. Caution is advised when matching on kernel-assigned names, as they are known to be | |
221 | unstable between reboots.</para> | |
222 | </listitem> | |
223 | </varlistentry> | |
224 | ||
225 | <varlistentry id='host'> | |
798d3a52 ZJS |
226 | <term><varname>Host=</varname></term> |
227 | <listitem> | |
d689bbca | 228 | <para>Matches against the hostname or machine ID of the host. See <varname>ConditionHost=</varname> in |
798d3a52 | 229 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
d689bbca | 230 | for details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated. |
462511c8 | 231 | If an empty string is assigned, the previously assigned value is cleared. |
d689bbca | 232 | </para> |
798d3a52 ZJS |
233 | </listitem> |
234 | </varlistentry> | |
d9b20454 ZJS |
235 | |
236 | <varlistentry id='virtualization'> | |
798d3a52 ZJS |
237 | <term><varname>Virtualization=</varname></term> |
238 | <listitem> | |
d689bbca YW |
239 | <para>Checks whether the system is executed in a virtualized environment and optionally test |
240 | whether it is a specific implementation. See <varname>ConditionVirtualization=</varname> in | |
798d3a52 | 241 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
d689bbca | 242 | for details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated. |
462511c8 | 243 | If an empty string is assigned, the previously assigned value is cleared. |
d689bbca | 244 | </para> |
798d3a52 ZJS |
245 | </listitem> |
246 | </varlistentry> | |
d9b20454 ZJS |
247 | |
248 | <varlistentry id='kernel-command-line'> | |
798d3a52 ZJS |
249 | <term><varname>KernelCommandLine=</varname></term> |
250 | <listitem> | |
d689bbca | 251 | <para>Checks whether a specific kernel command line option is set. See |
d7dce7b6 | 252 | <varname>ConditionKernelCommandLine=</varname> in |
798d3a52 | 253 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
d689bbca | 254 | for details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated. |
462511c8 | 255 | If an empty string is assigned, the previously assigned value is cleared. |
d689bbca YW |
256 | </para> |
257 | </listitem> | |
258 | </varlistentry> | |
d9b20454 ZJS |
259 | |
260 | <varlistentry id='kernel-version'> | |
d689bbca YW |
261 | <term><varname>KernelVersion=</varname></term> |
262 | <listitem> | |
263 | <para>Checks whether the kernel version (as reported by <command>uname -r</command>) matches a certain | |
264 | expression. See <varname>ConditionKernelVersion=</varname> in | |
265 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> for | |
266 | details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated. | |
462511c8 | 267 | If an empty string is assigned, the previously assigned value is cleared. |
d689bbca | 268 | </para> |
798d3a52 ZJS |
269 | </listitem> |
270 | </varlistentry> | |
d9b20454 | 271 | |
4f80cfca LP |
272 | <varlistentry id='credential'> |
273 | <term><varname>Credential=</varname></term> | |
274 | <listitem> | |
275 | <para>Checks whether the specified credential was passed to the | |
425e2934 | 276 | <filename>systemd-udevd.service</filename> service. See <ulink |
4f80cfca LP |
277 | url="https://systemd.io/CREDENTIALS">System and Service Credentials</ulink> for details. When |
278 | prefixed with an exclamation mark (<literal>!</literal>), the result is negated. If an empty | |
279 | string is assigned, the previously assigned value is cleared. | |
280 | </para> | |
281 | </listitem> | |
282 | </varlistentry> | |
283 | ||
d9b20454 | 284 | <varlistentry id='architecture'> |
798d3a52 ZJS |
285 | <term><varname>Architecture=</varname></term> |
286 | <listitem> | |
d689bbca YW |
287 | <para>Checks whether the system is running on a specific architecture. See |
288 | <varname>ConditionArchitecture=</varname> in | |
798d3a52 | 289 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
d689bbca | 290 | for details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated. |
462511c8 | 291 | If an empty string is assigned, the previously assigned value is cleared. |
d689bbca | 292 | </para> |
798d3a52 | 293 | </listitem> |
cbcdcaaa UKK |
294 | </varlistentry> |
295 | ||
296 | <varlistentry id='firmware'> | |
297 | <term><varname>Firmware=</varname></term> | |
298 | <listitem> | |
299 | <para>Checks whether the system is running on a machine with the specified firmware. See | |
300 | <varname>ConditionFirmware=</varname> in | |
301 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
302 | for details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated. | |
462511c8 | 303 | If an empty string is assigned, the previously assigned value is cleared. |
cbcdcaaa UKK |
304 | </para> |
305 | </listitem> | |
798d3a52 ZJS |
306 | </varlistentry> |
307 | </variablelist> | |
1ff28eae | 308 | |
798d3a52 | 309 | </refsect1> |
102bd40e | 310 | |
798d3a52 ZJS |
311 | <refsect1> |
312 | <title>[Link] Section Options</title> | |
102bd40e | 313 | |
d7dce7b6 | 314 | <para>The [Link] section accepts the following |
798d3a52 | 315 | keys:</para> |
1ff28eae | 316 | |
798d3a52 ZJS |
317 | <variablelist class='network-directives'> |
318 | <varlistentry> | |
319 | <term><varname>Description=</varname></term> | |
320 | <listitem> | |
321 | <para>A description of the device.</para> | |
322 | </listitem> | |
323 | </varlistentry> | |
324 | <varlistentry> | |
325 | <term><varname>Alias=</varname></term> | |
326 | <listitem> | |
d7dce7b6 | 327 | <para>The <varname>ifalias</varname> interface property is set to this value.</para> |
798d3a52 ZJS |
328 | </listitem> |
329 | </varlistentry> | |
330 | <varlistentry> | |
331 | <term><varname>MACAddressPolicy=</varname></term> | |
332 | <listitem> | |
333 | <para>The policy by which the MAC address should be set. The | |
334 | available policies are: | |
335 | </para> | |
1ff28eae | 336 | |
798d3a52 ZJS |
337 | <variablelist> |
338 | <varlistentry> | |
d7dce7b6 | 339 | <term><option>persistent</option></term> |
798d3a52 ZJS |
340 | <listitem> |
341 | <para>If the hardware has a persistent MAC address, as | |
342 | most hardware should, and if it is used by the kernel, | |
343 | nothing is done. Otherwise, a new MAC address is | |
344 | generated which is guaranteed to be the same on every | |
345 | boot for the given machine and the given device, but | |
1c25683e | 346 | which is otherwise random. This feature depends on ID_NET_NAME_* |
a8eaaee7 | 347 | properties to exist for the link. On hardware where these |
b938cb90 | 348 | properties are not set, the generation of a persistent MAC address |
1c25683e | 349 | will fail.</para> |
798d3a52 ZJS |
350 | </listitem> |
351 | </varlistentry> | |
352 | <varlistentry> | |
d7dce7b6 | 353 | <term><option>random</option></term> |
798d3a52 ZJS |
354 | <listitem> |
355 | <para>If the kernel is using a random MAC address, | |
356 | nothing is done. Otherwise, a new address is randomly | |
357 | generated each time the device appears, typically at | |
b938cb90 | 358 | boot. Either way, the random address will have the |
2e229e0c TG |
359 | <literal>unicast</literal> and |
360 | <literal>locally administered</literal> bits set.</para> | |
798d3a52 ZJS |
361 | </listitem> |
362 | </varlistentry> | |
66d3752e | 363 | <varlistentry> |
d7dce7b6 | 364 | <term><option>none</option></term> |
66d3752e | 365 | <listitem> |
6ca4a070 YW |
366 | <para>Keeps the MAC address assigned by the kernel. Or use the MAC address specified in |
367 | <varname>MACAddress=</varname>.</para> | |
66d3752e JK |
368 | </listitem> |
369 | </varlistentry> | |
798d3a52 | 370 | </variablelist> |
6ca4a070 YW |
371 | |
372 | <para>An empty string assignment is equivalent to setting <literal>none</literal>.</para> | |
798d3a52 ZJS |
373 | </listitem> |
374 | </varlistentry> | |
375 | <varlistentry> | |
376 | <term><varname>MACAddress=</varname></term> | |
377 | <listitem> | |
6ca4a070 YW |
378 | <para>The interface MAC address to use. For this setting to take effect, |
379 | <varname>MACAddressPolicy=</varname> must either be unset, empty, or <literal>none</literal>. | |
380 | </para> | |
798d3a52 ZJS |
381 | </listitem> |
382 | </varlistentry> | |
383 | <varlistentry> | |
384 | <term><varname>NamePolicy=</varname></term> | |
385 | <listitem> | |
3907446f | 386 | <para>An ordered, space-separated list of policies by which the interface name should be set. |
d7dce7b6 | 387 | <varname>NamePolicy=</varname> may be disabled by specifying <option>net.ifnames=0</option> on the |
58576937 | 388 | kernel command line. Each of the policies may fail, and the first successful one is used. The name |
d7dce7b6 | 389 | is not set directly, but is exported to udev as the property <option>ID_NET_NAME</option>, which |
58576937 ZJS |
390 | is, by default, used by a |
391 | <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>, | |
392 | rule to set <varname>NAME</varname>. The available policies are: | |
3907446f | 393 | </para> |
1ff28eae | 394 | |
798d3a52 ZJS |
395 | <variablelist> |
396 | <varlistentry> | |
d7dce7b6 | 397 | <term><option>kernel</option></term> |
798d3a52 ZJS |
398 | <listitem> |
399 | <para>If the kernel claims that the name it has set | |
400 | for a device is predictable, then no renaming is | |
401 | performed.</para> | |
402 | </listitem> | |
403 | </varlistentry> | |
404 | <varlistentry> | |
d7dce7b6 | 405 | <term><option>database</option></term> |
798d3a52 ZJS |
406 | <listitem> |
407 | <para>The name is set based on entries in the udev's | |
408 | Hardware Database with the key | |
d7dce7b6 | 409 | <varname>ID_NET_NAME_FROM_DATABASE</varname>. |
798d3a52 ZJS |
410 | </para> |
411 | </listitem> | |
412 | </varlistentry> | |
413 | <varlistentry> | |
d7dce7b6 | 414 | <term><option>onboard</option></term> |
798d3a52 ZJS |
415 | <listitem> |
416 | <para>The name is set based on information given by | |
417 | the firmware for on-board devices, as exported by the | |
d7dce7b6 | 418 | udev property <varname>ID_NET_NAME_ONBOARD</varname>. |
0b1e5b6e | 419 | See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>. |
798d3a52 ZJS |
420 | </para> |
421 | </listitem> | |
422 | </varlistentry> | |
423 | <varlistentry> | |
d7dce7b6 | 424 | <term><option>slot</option></term> |
798d3a52 ZJS |
425 | <listitem> |
426 | <para>The name is set based on information given by | |
427 | the firmware for hot-plug devices, as exported by the | |
d7dce7b6 | 428 | udev property <varname>ID_NET_NAME_SLOT</varname>. |
0b1e5b6e | 429 | See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>. |
798d3a52 ZJS |
430 | </para> |
431 | </listitem> | |
432 | </varlistentry> | |
433 | <varlistentry> | |
d7dce7b6 | 434 | <term><option>path</option></term> |
798d3a52 ZJS |
435 | <listitem> |
436 | <para>The name is set based on the device's physical | |
437 | location, as exported by the udev property | |
0b1e5b6e ZJS |
438 | <varname>ID_NET_NAME_PATH</varname>. |
439 | See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>. | |
440 | </para> | |
798d3a52 ZJS |
441 | </listitem> |
442 | </varlistentry> | |
443 | <varlistentry> | |
d7dce7b6 | 444 | <term><option>mac</option></term> |
798d3a52 ZJS |
445 | <listitem> |
446 | <para>The name is set based on the device's persistent | |
447 | MAC address, as exported by the udev property | |
0b1e5b6e ZJS |
448 | <varname>ID_NET_NAME_MAC</varname>. |
449 | See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>. | |
450 | </para> | |
798d3a52 ZJS |
451 | </listitem> |
452 | </varlistentry> | |
3907446f | 453 | <varlistentry> |
d7dce7b6 | 454 | <term><option>keep</option></term> |
3907446f ZJS |
455 | <listitem> |
456 | <para>If the device already had a name given by userspace (as part of creation of the device | |
457 | or a rename), keep it.</para> | |
798d3a52 ZJS |
458 | </listitem> |
459 | </varlistentry> | |
460 | </variablelist> | |
461 | </listitem> | |
462 | </varlistentry> | |
463 | <varlistentry> | |
464 | <term><varname>Name=</varname></term> | |
465 | <listitem> | |
58576937 ZJS |
466 | <para>The interface name to use. This option has lower precedence than |
467 | <varname>NamePolicy=</varname>, so for this setting to take effect, <varname>NamePolicy=</varname> | |
468 | must either be unset, empty, disabled, or all policies configured there must fail. Also see the | |
469 | example below with <literal>Name=dmz0</literal>.</para> | |
1b934761 | 470 | |
8f598a46 LP |
471 | <para>Note that specifying a name that the kernel might use for another interface (for example |
472 | <literal>eth0</literal>) is dangerous because the name assignment done by udev will race with the | |
473 | assignment done by the kernel, and only one interface may use the name. Depending on the order of | |
474 | operations, either udev or the kernel will win, making the naming unpredictable. It is best to use | |
475 | some different prefix, for example <literal>internal0</literal>/<literal>external0</literal> or | |
476 | <literal>lan0</literal>/<literal>lan1</literal>/<literal>lan3</literal>.</para> | |
477 | ||
478 | <para>Interface names must have a minimum length of 1 character and a maximum length of 15 | |
479 | characters, and may contain any 7bit ASCII character, with the exception of control characters, | |
480 | <literal>:</literal>, <literal>/</literal> and <literal>%</literal>. While <literal>.</literal> is | |
481 | an allowed character, it's recommended to avoid it when naming interfaces as various tools (such as | |
482 | <citerefentry><refentrytitle>resolvconf</refentrytitle><manvolnum>1</manvolnum></citerefentry>) use | |
483 | it as separator character. Also, fully numeric interface names are not allowed (in order to avoid | |
484 | ambiguity with interface specification by numeric indexes), as are the special strings | |
485 | <literal>.</literal>, <literal>..</literal>, <literal>all</literal> and | |
486 | <literal>default</literal>.</para> | |
798d3a52 ZJS |
487 | </listitem> |
488 | </varlistentry> | |
ef1d2c07 YW |
489 | <varlistentry> |
490 | <term><varname>AlternativeNamesPolicy=</varname></term> | |
491 | <listitem> | |
492 | <para>A space-separated list of policies by which the interface's alternative names | |
493 | should be set. Each of the policies may fail, and all successful policies are used. The | |
494 | available policies are <literal>database</literal>, <literal>onboard</literal>, | |
495 | <literal>slot</literal>, <literal>path</literal>, and <literal>mac</literal>. If the | |
496 | kernel does not support the alternative names, then this setting will be ignored. | |
497 | </para> | |
498 | </listitem> | |
499 | </varlistentry> | |
a5053a15 YW |
500 | <varlistentry> |
501 | <term><varname>AlternativeName=</varname></term> | |
502 | <listitem> | |
503 | <para>The alternative interface name to use. This option can be specified multiple times. | |
504 | If the empty string is assigned to this option, the list is reset, and all prior assignments | |
bb181dd4 YW |
505 | have no effect. If the kernel does not support the alternative names, then this setting will |
506 | be ignored.</para> | |
8f598a46 LP |
507 | |
508 | <para>Alternative interface names may be used to identify interfaces in various tools. In contrast | |
509 | to the primary name (as configured with <varname>Name=</varname> above) there may be multiple | |
510 | alternative names referring to the same interface. Alternative names may have a maximum length of | |
511 | 127 characters, in contrast to the 15 allowed for the primary interface name, but otherwise are | |
512 | subject to the same naming constraints.</para> | |
a5053a15 YW |
513 | </listitem> |
514 | </varlistentry> | |
face9fcc YW |
515 | <varlistentry> |
516 | <term><varname>TransmitQueues=</varname></term> | |
517 | <listitem> | |
518 | <para>Specifies the device's number of transmit queues. An integer in the range 1…4096. | |
519 | When unset, the kernel's default will be used.</para> | |
520 | </listitem> | |
521 | </varlistentry> | |
522 | <varlistentry> | |
523 | <term><varname>ReceiveQueues=</varname></term> | |
524 | <listitem> | |
525 | <para>Specifies the device's number of receive queues. An integer in the range 1…4096. | |
526 | When unset, the kernel's default will be used.</para> | |
527 | </listitem> | |
528 | </varlistentry> | |
ef4a91a7 | 529 | <varlistentry> |
1f8dc96c | 530 | <term><varname>TransmitQueueLength=</varname></term> |
ef4a91a7 UÖ |
531 | <listitem> |
532 | <para>Specifies the transmit queue length of the device in number of packets. An unsigned integer | |
1d3a473b | 533 | in the range 0…4294967294. When unset, the kernel's default will be used.</para> |
ef4a91a7 UÖ |
534 | </listitem> |
535 | </varlistentry> | |
798d3a52 ZJS |
536 | <varlistentry> |
537 | <term><varname>MTUBytes=</varname></term> | |
538 | <listitem> | |
539 | <para>The maximum transmission unit in bytes to set for the | |
be0d27ee | 540 | device. The usual suffixes K, M, G are supported and are |
798d3a52 ZJS |
541 | understood to the base of 1024.</para> |
542 | </listitem> | |
543 | </varlistentry> | |
544 | <varlistentry> | |
545 | <term><varname>BitsPerSecond=</varname></term> | |
546 | <listitem> | |
547 | <para>The speed to set for the device, the value is rounded | |
be0d27ee | 548 | down to the nearest Mbps. The usual suffixes K, M, G are |
798d3a52 ZJS |
549 | supported and are understood to the base of 1000.</para> |
550 | </listitem> | |
551 | </varlistentry> | |
552 | <varlistentry> | |
553 | <term><varname>Duplex=</varname></term> | |
554 | <listitem> | |
d7dce7b6 ZJS |
555 | <para>The duplex mode to set for the device. The accepted values are <option>half</option> and |
556 | <option>full</option>.</para> | |
798d3a52 ZJS |
557 | </listitem> |
558 | </varlistentry> | |
a39f92d3 SS |
559 | <varlistentry> |
560 | <term><varname>AutoNegotiation=</varname></term> | |
561 | <listitem> | |
9b6ffef3 | 562 | <para>Takes a boolean. If set to yes, automatic negotiation of transmission parameters is enabled. |
a39f92d3 SS |
563 | Autonegotiation is a procedure by which two connected ethernet devices choose |
564 | common transmission parameters, such as speed, duplex mode, and flow control. | |
9b6ffef3 | 565 | When unset, the kernel's default will be used.</para> |
a39f92d3 | 566 | |
a0e1ad10 | 567 | <para>Note that if autonegotiation is enabled, speed and duplex settings are |
11fcfc53 | 568 | read-only. If autonegotiation is disabled, speed and duplex settings are writable |
a39f92d3 SS |
569 | if the driver supports multiple link modes.</para> |
570 | </listitem> | |
571 | </varlistentry> | |
798d3a52 ZJS |
572 | <varlistentry> |
573 | <term><varname>WakeOnLan=</varname></term> | |
574 | <listitem> | |
c50404ae YW |
575 | <para>The Wake-on-LAN policy to set for the device. Takes the special value |
576 | <literal>off</literal> which disables Wake-on-LAN, or space separated list of the following | |
577 | words:</para> | |
1ff28eae | 578 | |
798d3a52 ZJS |
579 | <variablelist> |
580 | <varlistentry> | |
d7dce7b6 | 581 | <term><option>phy</option></term> |
798d3a52 ZJS |
582 | <listitem> |
583 | <para>Wake on PHY activity.</para> | |
584 | </listitem> | |
585 | </varlistentry> | |
617da14c | 586 | <varlistentry> |
d7dce7b6 | 587 | <term><option>unicast</option></term> |
617da14c SS |
588 | <listitem> |
589 | <para>Wake on unicast messages.</para> | |
590 | </listitem> | |
591 | </varlistentry> | |
592 | <varlistentry> | |
d7dce7b6 | 593 | <term><option>multicast</option></term> |
617da14c SS |
594 | <listitem> |
595 | <para>Wake on multicast messages.</para> | |
596 | </listitem> | |
597 | </varlistentry> | |
598 | <varlistentry> | |
d7dce7b6 | 599 | <term><option>broadcast</option></term> |
617da14c SS |
600 | <listitem> |
601 | <para>Wake on broadcast messages.</para> | |
602 | </listitem> | |
603 | </varlistentry> | |
604 | <varlistentry> | |
d7dce7b6 | 605 | <term><option>arp</option></term> |
617da14c SS |
606 | <listitem> |
607 | <para>Wake on ARP.</para> | |
608 | </listitem> | |
609 | </varlistentry> | |
798d3a52 | 610 | <varlistentry> |
d7dce7b6 | 611 | <term><option>magic</option></term> |
798d3a52 ZJS |
612 | <listitem> |
613 | <para>Wake on receipt of a magic packet. | |
614 | </para> | |
615 | </listitem> | |
616 | </varlistentry> | |
617da14c | 617 | <varlistentry> |
d7dce7b6 | 618 | <term><option>secureon</option></term> |
617da14c | 619 | <listitem> |
d3867133 YW |
620 | <para>Enable SecureOn password for MagicPacket. Implied when |
621 | <varname>WakeOnLanPassword=</varname> is specified. If specified without | |
622 | <varname>WakeOnLanPassword=</varname> option, then the password is read from the | |
623 | credential <literal><replaceable>LINK</replaceable>.link.wol.password</literal> (e.g., | |
624 | <literal>60-foo.link.wol.password</literal>), and if the credential not found, then | |
625 | read from <literal>wol.password</literal>. See | |
626 | <varname>LoadCredential=</varname>/<varname>SetCredential=</varname> in | |
627 | <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
628 | for details. The password in the credential, must be 6 bytes in hex format with each | |
629 | byte separated by a colon (<literal>:</literal>) like an Ethernet MAC address, e.g., | |
630 | <literal>aa:bb:cc:dd:ee:ff</literal>.</para> | |
617da14c SS |
631 | </listitem> |
632 | </varlistentry> | |
798d3a52 | 633 | </variablelist> |
c605bd00 | 634 | |
c50404ae YW |
635 | <para>Defaults to unset, and the device's default will be used. This setting can be specified |
636 | multiple times. If an empty string is assigned, then the all previous assignments are | |
637 | cleared.</para> | |
798d3a52 ZJS |
638 | </listitem> |
639 | </varlistentry> | |
d3867133 YW |
640 | <varlistentry> |
641 | <term><varname>WakeOnLanPassword=</varname></term> | |
642 | <listitem> | |
643 | <para>Specifies the SecureOn password for MagicPacket. Takes an absolute path to a regular | |
644 | file or an <constant>AF_UNIX</constant> stream socket, or the plain password. When a path to | |
645 | a regular file is specified, the password is read from it. When an | |
646 | <constant>AF_UNIX</constant> stream socket is specified, a connection is made to it and the | |
647 | password is read from it. The password must be 6 bytes in hex format with each byte separated | |
648 | by a colon (<literal>:</literal>) like an Ethernet MAC address, e.g., | |
649 | <literal>aa:bb:cc:dd:ee:ff</literal>. This implies <varname>WakeOnLan=secureon</varname>. | |
650 | Defaults to unset, and the current value will not be changed.</para> | |
651 | </listitem> | |
652 | </varlistentry> | |
593022fa SS |
653 | <varlistentry> |
654 | <term><varname>Port=</varname></term> | |
655 | <listitem> | |
656 | <para>The port option is used to select the device port. The | |
657 | supported values are:</para> | |
658 | ||
659 | <variablelist> | |
660 | <varlistentry> | |
d7dce7b6 | 661 | <term><option>tp</option></term> |
593022fa SS |
662 | <listitem> |
663 | <para>An Ethernet interface using Twisted-Pair cable as the medium.</para> | |
664 | </listitem> | |
665 | </varlistentry> | |
666 | <varlistentry> | |
d7dce7b6 | 667 | <term><option>aui</option></term> |
593022fa SS |
668 | <listitem> |
669 | <para>Attachment Unit Interface (AUI). Normally used with hubs. | |
670 | </para> | |
671 | </listitem> | |
672 | </varlistentry> | |
673 | <varlistentry> | |
d7dce7b6 | 674 | <term><option>bnc</option></term> |
593022fa SS |
675 | <listitem> |
676 | <para>An Ethernet interface using BNC connectors and co-axial cable.</para> | |
677 | </listitem> | |
678 | </varlistentry> | |
679 | <varlistentry> | |
d7dce7b6 | 680 | <term><option>mii</option></term> |
593022fa SS |
681 | <listitem> |
682 | <para>An Ethernet interface using a Media Independent Interface (MII).</para> | |
683 | </listitem> | |
684 | </varlistentry> | |
685 | <varlistentry> | |
d7dce7b6 | 686 | <term><option>fibre</option></term> |
593022fa SS |
687 | <listitem> |
688 | <para>An Ethernet interface using Optical Fibre as the medium.</para> | |
689 | </listitem> | |
690 | </varlistentry> | |
691 | </variablelist> | |
692 | </listitem> | |
693 | </varlistentry> | |
6cf0a204 SS |
694 | <varlistentry> |
695 | <term><varname>Advertise=</varname></term> | |
696 | <listitem> | |
697 | <para>This sets what speeds and duplex modes of operation are advertised for auto-negotiation. | |
a0e1ad10 | 698 | This implies <literal>AutoNegotiation=yes</literal>. The supported values are: |
6cf0a204 SS |
699 | |
700 | <table> | |
701 | <title>Supported advertise values</title> | |
702 | <tgroup cols='3'> | |
703 | <colspec colname='Advertise' /> | |
704 | <colspec colname='Speed' /> | |
705 | <colspec colname='Duplex Mode' /> | |
706 | ||
707 | <thead><row> | |
708 | <entry>Advertise</entry> | |
709 | <entry>Speed (Mbps)</entry> | |
710 | <entry>Duplex Mode</entry> | |
711 | </row></thead> | |
712 | <tbody> | |
d7dce7b6 | 713 | <row><entry><option>10baset-half</option></entry> |
6cf0a204 SS |
714 | <entry>10</entry><entry>half</entry></row> |
715 | ||
d7dce7b6 | 716 | <row><entry><option>10baset-full</option></entry> |
6cf0a204 SS |
717 | <entry>10</entry><entry>full</entry></row> |
718 | ||
d7dce7b6 | 719 | <row><entry><option>100baset-half</option></entry> |
6cf0a204 SS |
720 | <entry>100</entry><entry>half</entry></row> |
721 | ||
d7dce7b6 | 722 | <row><entry><option>100baset-full</option></entry> |
6cf0a204 SS |
723 | <entry>100</entry><entry>full</entry></row> |
724 | ||
d7dce7b6 | 725 | <row><entry><option>1000baset-half</option></entry> |
6cf0a204 SS |
726 | <entry>1000</entry><entry>half</entry></row> |
727 | ||
d7dce7b6 | 728 | <row><entry><option>1000baset-full</option></entry> |
6cf0a204 SS |
729 | <entry>1000</entry><entry>full</entry></row> |
730 | ||
d7dce7b6 | 731 | <row><entry><option>10000baset-full</option></entry> |
6cf0a204 SS |
732 | <entry>10000</entry><entry>full</entry></row> |
733 | ||
d7dce7b6 | 734 | <row><entry><option>2500basex-full</option></entry> |
6cf0a204 SS |
735 | <entry>2500</entry><entry>full</entry></row> |
736 | ||
d7dce7b6 | 737 | <row><entry><option>1000basekx-full</option></entry> |
6cf0a204 SS |
738 | <entry>1000</entry><entry>full</entry></row> |
739 | ||
d7dce7b6 | 740 | <row><entry><option>10000basekx4-full</option></entry> |
6cf0a204 SS |
741 | <entry>10000</entry><entry>full</entry></row> |
742 | ||
d7dce7b6 | 743 | <row><entry><option>10000basekr-full</option></entry> |
6cf0a204 SS |
744 | <entry>10000</entry><entry>full</entry></row> |
745 | ||
d7dce7b6 | 746 | <row><entry><option>10000baser-fec</option></entry> |
6cf0a204 SS |
747 | <entry>10000</entry><entry>full</entry></row> |
748 | ||
d7dce7b6 | 749 | <row><entry><option>20000basemld2-full</option></entry> |
6cf0a204 SS |
750 | <entry>20000</entry><entry>full</entry></row> |
751 | ||
d7dce7b6 | 752 | <row><entry><option>20000basekr2-full</option></entry> |
6cf0a204 SS |
753 | <entry>20000</entry><entry>full</entry></row> |
754 | </tbody> | |
755 | </tgroup> | |
756 | </table> | |
757 | ||
758 | By default this is unset, i.e. all possible modes will be advertised. | |
759 | This option may be specified more than once, in which case all specified speeds and modes are advertised. | |
760 | If the empty string is assigned to this option, the list is reset, and all prior assignments have no effect. | |
761 | </para> | |
762 | </listitem> | |
763 | </varlistentry> | |
bf2334c0 YW |
764 | <varlistentry> |
765 | <term><varname>ReceiveChecksumOffload=</varname></term> | |
766 | <listitem> | |
f20710c7 | 767 | <para>Takes a boolean. If set to true, hardware offload for checksumming of ingress |
bf2334c0 YW |
768 | network packets is enabled. When unset, the kernel's default will be used.</para> |
769 | </listitem> | |
770 | </varlistentry> | |
771 | <varlistentry> | |
772 | <term><varname>TransmitChecksumOffload=</varname></term> | |
773 | <listitem> | |
f20710c7 | 774 | <para>Takes a boolean. If set to true, hardware offload for checksumming of egress |
bf2334c0 YW |
775 | network packets is enabled. When unset, the kernel's default will be used.</para> |
776 | </listitem> | |
777 | </varlistentry> | |
50725d10 SS |
778 | <varlistentry> |
779 | <term><varname>TCPSegmentationOffload=</varname></term> | |
780 | <listitem> | |
f20710c7 | 781 | <para>Takes a boolean. If set to true, TCP Segmentation Offload (TSO) is enabled. |
025314d9 | 782 | When unset, the kernel's default will be used.</para> |
50725d10 | 783 | </listitem> |
ffa69a04 SS |
784 | </varlistentry> |
785 | <varlistentry> | |
786 | <term><varname>TCP6SegmentationOffload=</varname></term> | |
787 | <listitem> | |
f20710c7 | 788 | <para>Takes a boolean. If set to true, TCP6 Segmentation Offload (tx-tcp6-segmentation) is enabled. |
025314d9 | 789 | When unset, the kernel's default will be used.</para> |
ffa69a04 | 790 | </listitem> |
50725d10 SS |
791 | </varlistentry> |
792 | <varlistentry> | |
793 | <term><varname>GenericSegmentationOffload=</varname></term> | |
794 | <listitem> | |
f20710c7 | 795 | <para>Takes a boolean. If set to true, Generic Segmentation Offload (GSO) is enabled. |
025314d9 | 796 | When unset, the kernel's default will be used.</para> |
50725d10 SS |
797 | </listitem> |
798 | </varlistentry> | |
bf2334c0 | 799 | <varlistentry> |
f7ea90fb SS |
800 | <term><varname>GenericReceiveOffload=</varname></term> |
801 | <listitem> | |
f20710c7 | 802 | <para>Takes a boolean. If set to true, Generic Receive Offload (GRO) is enabled. |
025314d9 | 803 | When unset, the kernel's default will be used.</para> |
f7ea90fb SS |
804 | </listitem> |
805 | </varlistentry> | |
8f821d90 DDM |
806 | <varlistentry> |
807 | <term><varname>GenericReceiveOffloadHardware=</varname></term> | |
808 | <listitem> | |
809 | <para>Takes a boolean. If set to true, hardware accelerated Generic Receive Offload (GRO) is | |
810 | enabled. When unset, the kernel's default will be used.</para> | |
811 | </listitem> | |
812 | </varlistentry> | |
f7ea90fb SS |
813 | <varlistentry> |
814 | <term><varname>LargeReceiveOffload=</varname></term> | |
815 | <listitem> | |
f20710c7 | 816 | <para>Takes a boolean. If set to true, Large Receive Offload (LRO) is enabled. |
025314d9 | 817 | When unset, the kernel's default will be used.</para> |
f7ea90fb SS |
818 | </listitem> |
819 | </varlistentry> | |
2b33e41a AZ |
820 | <varlistentry> |
821 | <term><varname>ReceiveVLANCTAGHardwareAcceleration=</varname></term> | |
822 | <listitem> | |
823 | <para>Takes a boolean. If set to true, receive VLAN CTAG hardware acceleration is enabled. | |
824 | When unset, the kernel's default will be used.</para> | |
825 | </listitem> | |
826 | </varlistentry> | |
827 | <varlistentry> | |
828 | <term><varname>TransmitVLANCTAGHardwareAcceleration=</varname></term> | |
829 | <listitem> | |
830 | <para>Takes a boolean. If set to true, transmit VLAN CTAG hardware acceleration is enabled. | |
831 | When unset, the kernel's default will be used.</para> | |
832 | </listitem> | |
833 | </varlistentry> | |
834 | <varlistentry> | |
835 | <term><varname>ReceiveVLANCTAGFilter=</varname></term> | |
836 | <listitem> | |
837 | <para>Takes a boolean. If set to true, receive filtering on VLAN CTAGs is enabled. | |
838 | When unset, the kernel's default will be used.</para> | |
839 | </listitem> | |
840 | </varlistentry> | |
841 | <varlistentry> | |
842 | <term><varname>TransmitVLANSTAGHardwareAcceleration=</varname></term> | |
843 | <listitem> | |
fe003f02 | 844 | <para>Takes a boolean. If set to true, transmit VLAN STAG hardware acceleration is enabled. |
2b33e41a AZ |
845 | When unset, the kernel's default will be used.</para> |
846 | </listitem> | |
847 | </varlistentry> | |
848 | <varlistentry> | |
849 | <term><varname>NTupleFilter=</varname></term> | |
850 | <listitem> | |
851 | <para>Takes a boolean. If set to true, receive N-tuple filters and actions are enabled. | |
852 | When unset, the kernel's default will be used.</para> | |
853 | </listitem> | |
854 | </varlistentry> | |
5f945202 SS |
855 | <varlistentry> |
856 | <term><varname>RxChannels=</varname></term> | |
5f945202 | 857 | <term><varname>TxChannels=</varname></term> |
5f945202 | 858 | <term><varname>OtherChannels=</varname></term> |
5f945202 SS |
859 | <term><varname>CombinedChannels=</varname></term> |
860 | <listitem> | |
0d341ecc YW |
861 | <para>Specifies the number of receive, transmit, other, or combined channels, respectively. |
862 | Takes an unsigned integer in the range 1…4294967295 or <literal>max</literal>. If set to | |
863 | <literal>max</literal>, the advertised maximum value of the hardware will be used. When | |
864 | unset, the number will not be changed. Defaults to unset.</para> | |
5f945202 SS |
865 | </listitem> |
866 | </varlistentry> | |
224ded67 SS |
867 | <varlistentry> |
868 | <term><varname>RxBufferSize=</varname></term> | |
e81f5fc4 | 869 | <term><varname>RxMiniBufferSize=</varname></term> |
e81f5fc4 | 870 | <term><varname>RxJumboBufferSize=</varname></term> |
224ded67 SS |
871 | <term><varname>TxBufferSize=</varname></term> |
872 | <listitem> | |
0d341ecc YW |
873 | <para>Specifies the maximum number of pending packets in the NIC receive buffer, mini receive |
874 | buffer, jumbo receive buffer, or transmit buffer, respectively. Takes an unsigned integer in | |
875 | the range 1…4294967295 or <literal>max</literal>. If set to <literal>max</literal>, the | |
876 | advertised maximum value of the hardware will be used. When unset, the number will not be | |
877 | changed. Defaults to unset.</para> | |
224ded67 SS |
878 | </listitem> |
879 | </varlistentry> | |
a34811e4 YW |
880 | <varlistentry> |
881 | <term><varname>RxFlowControl=</varname></term> | |
882 | <listitem> | |
f20710c7 | 883 | <para>Takes a boolean. When set, enables receive flow control, also known as the ethernet |
a34811e4 YW |
884 | receive PAUSE message (generate and send ethernet PAUSE frames). When unset, the kernel's |
885 | default will be used.</para> | |
886 | </listitem> | |
887 | </varlistentry> | |
888 | <varlistentry> | |
889 | <term><varname>TxFlowControl=</varname></term> | |
890 | <listitem> | |
f20710c7 | 891 | <para>Takes a boolean. When set, enables transmit flow control, also known as the ethernet |
a34811e4 YW |
892 | transmit PAUSE message (respond to received ethernet PAUSE frames). When unset, the kernel's |
893 | default will be used.</para> | |
894 | </listitem> | |
895 | </varlistentry> | |
896 | <varlistentry> | |
897 | <term><varname>AutoNegotiationFlowControl=</varname></term> | |
898 | <listitem> | |
f20710c7 | 899 | <para>Takes a boolean. When set, auto negotiation enables the interface to exchange state |
a34811e4 YW |
900 | advertisements with the connected peer so that the two devices can agree on the ethernet |
901 | PAUSE configuration. When unset, the kernel's default will be used.</para> | |
902 | </listitem> | |
903 | </varlistentry> | |
1e270127 SS |
904 | <varlistentry> |
905 | <term><varname>GenericSegmentOffloadMaxBytes=</varname></term> | |
906 | <listitem> | |
907 | <para>Specifies the maximum size of a Generic Segment Offload (GSO) packet the | |
be0d27ee | 908 | device should accept. The usual suffixes K, M, G are supported and are |
1d3a473b | 909 | understood to the base of 1024. An unsigned integer in the range 1…65536. |
1e270127 SS |
910 | Defaults to unset.</para> |
911 | </listitem> | |
912 | </varlistentry> | |
913 | <varlistentry> | |
914 | <term><varname>GenericSegmentOffloadMaxSegments=</varname></term> | |
915 | <listitem> | |
be0d27ee ZJS |
916 | <para>Specifies the maximum number of Generic Segment Offload (GSO) segments the device should |
917 | accept. An unsigned integer in the range 1…65535. Defaults to unset.</para> | |
1e270127 SS |
918 | </listitem> |
919 | </varlistentry> | |
6c35ea5e DDM |
920 | <varlistentry> |
921 | <term><varname>UseAdaptiveRxCoalesce=</varname></term> | |
922 | <term><varname>UseAdaptiveTxCoalesce=</varname></term> | |
923 | <listitem> | |
924 | <para>Boolean properties that, when set, enable/disable adaptive Rx/Tx coalescing if the hardware | |
925 | supports it. When unset, the kernel's default will be used.</para> | |
926 | </listitem> | |
927 | </varlistentry> | |
928 | <varlistentry> | |
929 | <term><varname>RxCoalesceSec=</varname></term> | |
930 | <term><varname>RxCoalesceIrqSec=</varname></term> | |
931 | <term><varname>RxCoalesceLowSec=</varname></term> | |
932 | <term><varname>RxCoalesceHighSec=</varname></term> | |
933 | <term><varname>TxCoalesceSec=</varname></term> | |
934 | <term><varname>TxCoalesceIrqSec=</varname></term> | |
935 | <term><varname>TxCoalesceLowSec=</varname></term> | |
936 | <term><varname>TxCoalesceHighSec=</varname></term> | |
937 | <listitem> | |
938 | <para>These properties configure the delay before Rx/Tx interrupts are generated after a packet is | |
939 | sent/received. The <literal>Irq</literal> properties come into effect when the host is servicing an | |
940 | IRQ. The <literal>Low</literal> and <literal>High</literal> properties come into effect when the | |
941 | packet rate drops below the low packet rate threshold or exceeds the high packet rate threshold | |
942 | respectively if adaptive Rx/Tx coalescing is enabled. When unset, the kernel's defaults will be | |
943 | used.</para> | |
944 | </listitem> | |
945 | </varlistentry> | |
946 | <varlistentry> | |
947 | <term><varname>RxMaxCoalescedFrames=</varname></term> | |
948 | <term><varname>RxMaxCoalescedIrqFrames=</varname></term> | |
949 | <term><varname>RxMaxCoalescedLowFrames=</varname></term> | |
950 | <term><varname>RxMaxCoalescedHighFrames=</varname></term> | |
951 | <term><varname>TxMaxCoalescedFrames=</varname></term> | |
952 | <term><varname>TxMaxCoalescedIrqFrames=</varname></term> | |
953 | <term><varname>TxMaxCoalescedLowFrames=</varname></term> | |
954 | <term><varname>TxMaxCoalescedHighFrames=</varname></term> | |
955 | <listitem> | |
956 | <para>These properties configure the maximum number of frames that are sent/received before a Rx/Tx | |
957 | interrupt is generated. The <literal>Irq</literal> properties come into effect when the host is | |
958 | servicing an IRQ. The <literal>Low</literal> and <literal>High</literal> properties come into | |
959 | effect when the packet rate drops below the low packet rate threshold or exceeds the high packet | |
960 | rate threshold respectively if adaptive Rx/Tx coalescing is enabled. When unset, the kernel's | |
961 | defaults will be used.</para> | |
962 | </listitem> | |
963 | </varlistentry> | |
964 | <varlistentry> | |
965 | <term><varname>CoalescePacketRateLow=</varname></term> | |
966 | <term><varname>CoalescePacketRateHigh=</varname></term> | |
967 | <listitem> | |
968 | <para>These properties configure the low and high packet rate (expressed in packets per second) | |
969 | threshold respectively and are used to determine when the corresponding coalescing settings for low | |
970 | and high packet rates come into effect if adaptive Rx/Tx coalescing is enabled. If unset, the | |
971 | kernel's defaults will be used.</para> | |
972 | </listitem> | |
973 | </varlistentry> | |
974 | <varlistentry> | |
975 | <term><varname>CoalescePacketRateSampleIntervalSec=</varname></term> | |
976 | <listitem> | |
977 | <para>Configures how often to sample the packet rate used for adaptive Rx/Tx coalescing. This | |
978 | property cannot be zero. This lowest time granularity supported by this property is seconds. | |
979 | Partial seconds will be rounded up before being passed to the kernel. If unset, the kernel's | |
980 | default will be used.</para> | |
981 | </listitem> | |
982 | </varlistentry> | |
983 | <varlistentry> | |
984 | <term><varname>StatisticsBlockCoalesceSec=</varname></term> | |
985 | <listitem> | |
986 | <para>How long to delay driver in-memory statistics block updates. If the driver does not have an | |
987 | in-memory statistic block, this property is ignored. This property cannot be zero. If unset, the | |
988 | kernel's default will be used.</para> | |
989 | </listitem> | |
18f84f8a YW |
990 | </varlistentry> |
991 | ||
992 | <varlistentry> | |
993 | <term><varname>MDI=</varname></term> | |
994 | <listitem> | |
995 | <para>Specifies the medium dependent interface (MDI) mode for the interface. A MDI describes | |
996 | the interface from a physical layer implementation to the physical medium used to carry the | |
997 | transmission. Takes one of the following words: <literal>straight</literal> (or equivalently: | |
998 | <literal>mdi</literal>), <literal>crossover</literal> (or equivalently: | |
999 | <literal>mdi-x</literal>, <literal>mdix</literal>), and <literal>auto</literal>. When | |
1000 | <literal>straight</literal>, the MDI straight through mode will be used. When | |
1001 | <literal>crossover</literal>, the MDI crossover (MDI-X) mode will be used. When | |
1002 | <literal>auto</literal>, the MDI status is automatically detected. Defaults to unset, and the | |
1003 | kernel's default will be used.</para> | |
1004 | </listitem> | |
6c35ea5e | 1005 | </varlistentry> |
224ded67 | 1006 | |
41ce9d76 YW |
1007 | <varlistentry> |
1008 | <term><varname>SR-IOVVirtualFunctions=</varname></term> | |
1009 | <listitem> | |
1010 | <para>Specifies the number of SR-IOV virtual functions. Takes an integer in the range | |
1011 | 0…2147483647. Defaults to unset, and automatically determined from the values specified in | |
1012 | the <varname>VirtualFunction=</varname> settings in the [SR-IOV] sections.</para> | |
1013 | </listitem> | |
1014 | </varlistentry> | |
1015 | ||
798d3a52 ZJS |
1016 | </variablelist> |
1017 | </refsect1> | |
1ff28eae | 1018 | |
bd29dfef YW |
1019 | <refsect1 id='sr-iov'> |
1020 | <title>[SR-IOV] Section Options</title> | |
1021 | <para>The [SR-IOV] section accepts the following keys. Specify several [SR-IOV] sections to | |
1022 | configure several SR-IOVs. SR-IOV provides the ability to partition a single physical PCI resource | |
1023 | into virtual PCI functions which can then be injected into a VM. In the case of network VFs, SR-IOV | |
1024 | improves north-south network performance (that is, traffic with endpoints outside the host machine) | |
1025 | by allowing traffic to bypass the host machine’s network stack.</para> | |
1026 | ||
1027 | <variablelist class='network-directives'> | |
1028 | <varlistentry> | |
1029 | <term><varname>VirtualFunction=</varname></term> | |
1030 | <listitem> | |
1031 | <para>Specifies a Virtual Function (VF), lightweight PCIe function designed solely to move | |
1032 | data in and out. Takes an integer in the range 0…2147483646. This option is compulsory. | |
1033 | </para> | |
1034 | </listitem> | |
1035 | </varlistentry> | |
1036 | ||
1037 | <varlistentry> | |
1038 | <term><varname>VLANId=</varname></term> | |
1039 | <listitem> | |
1040 | <para>Specifies VLAN ID of the virtual function. Takes an integer in the range 1…4095.</para> | |
1041 | </listitem> | |
1042 | </varlistentry> | |
1043 | ||
1044 | <varlistentry> | |
1045 | <term><varname>QualityOfService=</varname></term> | |
1046 | <listitem> | |
1047 | <para>Specifies quality of service of the virtual function. Takes an integer in the range | |
1048 | 1…4294967294.</para> | |
1049 | </listitem> | |
1050 | </varlistentry> | |
1051 | ||
1052 | <varlistentry> | |
1053 | <term><varname>VLANProtocol=</varname></term> | |
1054 | <listitem> | |
1055 | <para>Specifies VLAN protocol of the virtual function. Takes <literal>802.1Q</literal> or | |
1056 | <literal>802.1ad</literal>.</para> | |
1057 | </listitem> | |
1058 | </varlistentry> | |
1059 | ||
1060 | <varlistentry> | |
1061 | <term><varname>MACSpoofCheck=</varname></term> | |
1062 | <listitem> | |
1063 | <para>Takes a boolean. Controls the MAC spoof checking. When unset, the kernel's default will | |
1064 | be used.</para> | |
1065 | </listitem> | |
1066 | </varlistentry> | |
1067 | ||
1068 | <varlistentry> | |
1069 | <term><varname>QueryReceiveSideScaling=</varname></term> | |
1070 | <listitem> | |
1071 | <para>Takes a boolean. Toggle the ability of querying the receive side scaling (RSS) | |
1072 | configuration of the virtual function (VF). The VF RSS information like RSS hash key may be | |
1073 | considered sensitive on some devices where this information is shared between VF and the | |
1074 | physical function (PF). When unset, the kernel's default will be used.</para> | |
1075 | </listitem> | |
1076 | </varlistentry> | |
1077 | ||
1078 | <varlistentry> | |
1079 | <term><varname>Trust=</varname></term> | |
1080 | <listitem> | |
1081 | <para>Takes a boolean. Allows one to set trust mode of the virtual function (VF). When set, | |
1082 | VF users can set a specific feature which may impact security and/or performance. When unset, | |
1083 | the kernel's default will be used.</para> | |
1084 | </listitem> | |
1085 | </varlistentry> | |
1086 | ||
1087 | <varlistentry> | |
1088 | <term><varname>LinkState=</varname></term> | |
1089 | <listitem> | |
1090 | <para>Allows one to set the link state of the virtual function (VF). Takes a boolean or a | |
1091 | special value <literal>auto</literal>. Setting to <literal>auto</literal> means a | |
1092 | reflection of the physical function (PF) link state, <literal>yes</literal> lets the VF to | |
1093 | communicate with other VFs on this host even if the PF link state is down, | |
1094 | <literal>no</literal> causes the hardware to drop any packets sent by the VF. When unset, | |
1095 | the kernel's default will be used.</para> | |
1096 | </listitem> | |
1097 | </varlistentry> | |
1098 | ||
1099 | <varlistentry> | |
1100 | <term><varname>MACAddress=</varname></term> | |
1101 | <listitem> | |
1102 | <para>Specifies the MAC address for the virtual function.</para> | |
1103 | </listitem> | |
1104 | </varlistentry> | |
1105 | </variablelist> | |
1106 | </refsect1> | |
1107 | ||
798d3a52 | 1108 | <refsect1> |
b97e7fab LP |
1109 | <title>Examples</title> |
1110 | ||
1111 | <example> | |
1112 | <title>/usr/lib/systemd/network/99-default.link</title> | |
1113 | ||
9b7f499f YW |
1114 | <para>The link file <filename>99-default.link</filename> that is shipped with systemd defines the |
1115 | default policies for the interface name, alternative names, and MAC address of links.</para> | |
b97e7fab | 1116 | |
9b7f499f YW |
1117 | <programlisting>[Match] |
1118 | OriginalName=* | |
1119 | ||
1120 | [Link] | |
1121 | NamePolicy=keep kernel database onboard slot path | |
1122 | AlternativeNamesPolicy=database onboard slot path | |
b97e7fab LP |
1123 | MACAddressPolicy=persistent</programlisting> |
1124 | </example> | |
1125 | ||
1126 | <example> | |
1127 | <title>/etc/systemd/network/10-dmz.link</title> | |
1128 | ||
58576937 | 1129 | <para>This example assigns the fixed name <literal>dmz0</literal> to the interface with the MAC address |
b97e7fab LP |
1130 | 00:a0:de:63:7a:e6:</para> |
1131 | ||
1132 | <programlisting>[Match] | |
1133 | MACAddress=00:a0:de:63:7a:e6 | |
1134 | ||
1135 | [Link] | |
1136 | Name=dmz0</programlisting> | |
58576937 | 1137 | |
7a447d21 | 1138 | <para><varname>NamePolicy=</varname> is not set, so <varname>Name=</varname> takes effect. We use the |
a19b9a38 | 1139 | <literal>10-</literal> prefix to order this file early in the list. Note that it needs to be before |
9b7f499f | 1140 | <filename>99-default.link</filename>, i.e. it needs a numerical prefix, to have any effect at all.</para> |
7a447d21 ZJS |
1141 | </example> |
1142 | ||
181d7195 YW |
1143 | <example> |
1144 | <title>(Re-)applying a .link file to an interface</title> | |
1145 | ||
1146 | <para>After a new .link file has been created, or an exisiting .link file modified, the new settings | |
1147 | may be applied to the matching interface with the following commands:</para> | |
1148 | ||
1149 | <programlisting>$ sudo udevadm control --reload | |
1150 | $ sudo ip link set eth0 down | |
1151 | $ sudo udevadm trigger --verbose --settle --action add /sys/class/net/eth0</programlisting> | |
1152 | ||
1153 | <para>You may also need to stop the service that manages the network interface, e.g. | |
1154 | <filename>systemd-networkd.service</filename> or <filename>NetworkManager.service</filename> before | |
1155 | the above operation, and then restart the service after that. For more details about | |
1156 | <command>udevadm</command> command, see | |
1157 | <citerefentry><refentrytitle>udevadm</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para> | |
1158 | </example> | |
1159 | ||
7a447d21 ZJS |
1160 | <example> |
1161 | <title>Debugging <varname>NamePolicy=</varname> assignments</title> | |
1162 | ||
1163 | <programlisting>$ sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/hub0 | |
1164 | … | |
1165 | Parsed configuration file /usr/lib/systemd/network/99-default.link | |
1166 | Parsed configuration file /etc/systemd/network/10-eth0.link | |
1167 | ID_NET_DRIVER=cdc_ether | |
1168 | Config file /etc/systemd/network/10-eth0.link applies to device hub0 | |
1169 | link_config: autonegotiation is unset or enabled, the speed and duplex are not writable. | |
1170 | hub0: Device has name_assign_type=4 | |
1171 | Using default interface naming scheme 'v240'. | |
1172 | hub0: Policies didn't yield a name, using specified Name=hub0. | |
1173 | ID_NET_LINK_FILE=/etc/systemd/network/10-eth0.link | |
1174 | ID_NET_NAME=hub0 | |
1175 | …</programlisting> | |
1176 | ||
1177 | <para>Explicit <varname>Name=</varname> configuration wins in this case.</para> | |
1178 | ||
1179 | <programlisting>sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/enp0s31f6 | |
1180 | … | |
1181 | Parsed configuration file /usr/lib/systemd/network/99-default.link | |
1182 | Parsed configuration file /etc/systemd/network/10-eth0.link | |
1183 | Created link configuration context. | |
1184 | ID_NET_DRIVER=e1000e | |
1185 | Config file /usr/lib/systemd/network/99-default.link applies to device enp0s31f6 | |
1186 | link_config: autonegotiation is unset or enabled, the speed and duplex are not writable. | |
1187 | enp0s31f6: Device has name_assign_type=4 | |
1188 | Using default interface naming scheme 'v240'. | |
1189 | enp0s31f6: Policy *keep*: keeping existing userspace name | |
1190 | enp0s31f6: Device has addr_assign_type=0 | |
1191 | enp0s31f6: MAC on the device already matches policy *persistent* | |
1192 | ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link | |
1193 | … | |
1194 | </programlisting> | |
1195 | ||
1196 | <para>In this case, the interface was already renamed, so the <option>keep</option> policy specified as | |
b0343f8c | 1197 | the first option in <filename index="false">99-default.link</filename> means that the existing name is |
7a447d21 ZJS |
1198 | preserved. If <option>keep</option> was removed, or if were in boot before the renaming has happened, |
1199 | we might get the following instead:</para> | |
1200 | ||
1201 | <programlisting>enp0s31f6: Policy *path* yields "enp0s31f6". | |
1202 | enp0s31f6: Device has addr_assign_type=0 | |
1203 | enp0s31f6: MAC on the device already matches policy *persistent* | |
1204 | ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link | |
1205 | ID_NET_NAME=enp0s31f6 | |
1206 | … | |
1207 | </programlisting> | |
1208 | ||
1209 | <para>Please note that the details of output are subject to change.</para> | |
b97e7fab LP |
1210 | </example> |
1211 | ||
1212 | <example> | |
1213 | <title>/etc/systemd/network/10-internet.link</title> | |
1214 | ||
1215 | <para>This example assigns the fixed name | |
1216 | <literal>internet0</literal> to the interface with the device | |
1217 | path <literal>pci-0000:00:1a.0-*</literal>:</para> | |
1218 | ||
1219 | <programlisting>[Match] | |
1220 | Path=pci-0000:00:1a.0-* | |
1221 | ||
1222 | [Link] | |
1223 | Name=internet0</programlisting> | |
1224 | </example> | |
1225 | ||
798d3a52 | 1226 | <example> |
6c1695be | 1227 | <title>/etc/systemd/network/25-wireless.link</title> |
1ff28eae | 1228 | |
b97e7fab LP |
1229 | <para>Here's an overly complex example that shows the use of a large number of [Match] and [Link] settings.</para> |
1230 | ||
798d3a52 | 1231 | <programlisting>[Match] |
7abaad1a | 1232 | MACAddress=12:34:56:78:9a:bc |
1233 | Driver=brcmsmac | |
1234 | Path=pci-0000:02:00.0-* | |
1235 | Type=wlan | |
1236 | Virtualization=no | |
1237 | Host=my-laptop | |
1238 | Architecture=x86-64 | |
1ff28eae | 1239 | |
7abaad1a | 1240 | [Link] |
1241 | Name=wireless0 | |
1242 | MTUBytes=1450 | |
1243 | BitsPerSecond=10M | |
1244 | WakeOnLan=magic | |
1245 | MACAddress=cb:a9:87:65:43:21</programlisting> | |
798d3a52 ZJS |
1246 | </example> |
1247 | </refsect1> | |
1ff28eae | 1248 | |
798d3a52 ZJS |
1249 | <refsect1> |
1250 | <title>See Also</title> | |
1251 | <para> | |
1252 | <citerefentry> | |
1253 | <refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum> | |
1254 | </citerefentry>, | |
1255 | <citerefentry> | |
1256 | <refentrytitle>udevadm</refentrytitle><manvolnum>8</manvolnum> | |
1257 | </citerefentry>, | |
1258 | <citerefentry> | |
1259 | <refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum> | |
1260 | </citerefentry>, | |
1261 | <citerefentry> | |
1262 | <refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum> | |
cc9b6bdc YW |
1263 | </citerefentry>, |
1264 | <citerefentry> | |
1265 | <refentrytitle>systemd-network-generator.service</refentrytitle><manvolnum>8</manvolnum> | |
798d3a52 ZJS |
1266 | </citerefentry> |
1267 | </para> | |
1268 | </refsect1> | |
1ff28eae TG |
1269 | |
1270 | </refentry> |