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