1<?xml version='1.0'?> 2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" 3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> 4<!-- SPDX-License-Identifier: LGPL-2.1-or-later --> 5 6<refentry id="systemd.link"> 7 <refentryinfo> 8 <title>systemd.link</title> 9 <productname>systemd</productname> 10 </refentryinfo> 11 12 <refmeta> 13 <refentrytitle>systemd.link</refentrytitle> 14 <manvolnum>5</manvolnum> 15 </refmeta> 16 17 <refnamediv> 18 <refname>systemd.link</refname> 19 <refpurpose>Network device configuration</refpurpose> 20 </refnamediv> 21 22 <refsynopsisdiv> 23 <para><filename><replaceable>link</replaceable>.link</filename></para> 24 </refsynopsisdiv> 25 26 <refsect1> 27 <title>Description</title> 28 29 <para>A plain ini-style text file that encodes configuration for matching network devices, used by 30 <citerefentry><refentrytitle>systemd-udevd</refentrytitle><manvolnum>8</manvolnum></citerefentry> and in 31 particular its <command>net_setup_link</command> builtin. See 32 <citerefentry><refentrytitle>systemd.syntax</refentrytitle><manvolnum>7</manvolnum></citerefentry> for a 33 general description of the syntax.</para> 34 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 38 <filename>/run/systemd/network</filename>, and the local administration network directory 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 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> 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> 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> 64 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> 73 </refsect1> 74 75 <refsect1> 76 <title>[Match] Section Options</title> 77 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: 82 <programlisting>OriginalName=*</programlisting> 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> 85 86 <variablelist class='network-directives'> 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'> 94 <term><varname>MACAddress=</varname></term> 95 <listitem> 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> 138 </listitem> 139 </varlistentry> 140 141 <varlistentry id='permanent-mac-address'> 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 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> 151 </listitem> 152 </varlistentry> 153 154 <varlistentry id='path'> 155 <term><varname>Path=</varname></term> 156 <listitem> 157 <para>A whitespace-separated list of shell-style globs matching 158 the persistent path, as exposed by the udev property 159 <varname>ID_PATH</varname>.</para> 160 </listitem> 161 </varlistentry> 162 163 <varlistentry id='driver'> 164 <term><varname>Driver=</varname></term> 165 <listitem> 166 <para>A whitespace-separated list of shell-style globs matching the driver currently bound to the 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> 170 </listitem> 171 </varlistentry> 172 173 <varlistentry id='type'> 174 <term><varname>Type=</varname></term> 175 <listitem> 176 <para>A whitespace-separated list of shell-style globs matching the device type, as exposed by 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. 181 </para> 182 </listitem> 183 </varlistentry> 184 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 199 <varlistentry id='property'> 200 <term><varname>Property=</varname></term> 201 <listitem> 202 <para>A whitespace-separated list of udev property names with their values after equals sign 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> 214 215 <varlistentry> 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'> 226 <term><varname>Host=</varname></term> 227 <listitem> 228 <para>Matches against the hostname or machine ID of the host. See <varname>ConditionHost=</varname> in 229 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> 230 for details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated. 231 If an empty string is assigned, then previously assigned value is cleared. 232 </para> 233 </listitem> 234 </varlistentry> 235 236 <varlistentry id='virtualization'> 237 <term><varname>Virtualization=</varname></term> 238 <listitem> 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 241 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> 242 for details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated. 243 If an empty string is assigned, then previously assigned value is cleared. 244 </para> 245 </listitem> 246 </varlistentry> 247 248 <varlistentry id='kernel-command-line'> 249 <term><varname>KernelCommandLine=</varname></term> 250 <listitem> 251 <para>Checks whether a specific kernel command line option is set. See 252 <varname>ConditionKernelCommandLine=</varname> in 253 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> 254 for details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated. 255 If an empty string is assigned, then previously assigned value is cleared. 256 </para> 257 </listitem> 258 </varlistentry> 259 260 <varlistentry id='kernel-version'> 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. 267 If an empty string is assigned, then previously assigned value is cleared. 268 </para> 269 </listitem> 270 </varlistentry> 271 272 <varlistentry id='architecture'> 273 <term><varname>Architecture=</varname></term> 274 <listitem> 275 <para>Checks whether the system is running on a specific architecture. See 276 <varname>ConditionArchitecture=</varname> in 277 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> 278 for details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated. 279 If an empty string is assigned, then previously assigned value is cleared. 280 </para> 281 </listitem> 282 </varlistentry> 283 284 <varlistentry id='firmware'> 285 <term><varname>Firmware=</varname></term> 286 <listitem> 287 <para>Checks whether the system is running on a machine with the specified firmware. See 288 <varname>ConditionFirmware=</varname> in 289 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> 290 for details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated. 291 If an empty string is assigned, then previously assigned value is cleared. 292 </para> 293 </listitem> 294 </varlistentry> 295 </variablelist> 296 297 </refsect1> 298 299 <refsect1> 300 <title>[Link] Section Options</title> 301 302 <para>The [Link] section accepts the following 303 keys:</para> 304 305 <variablelist class='network-directives'> 306 <varlistentry> 307 <term><varname>Description=</varname></term> 308 <listitem> 309 <para>A description of the device.</para> 310 </listitem> 311 </varlistentry> 312 <varlistentry> 313 <term><varname>Alias=</varname></term> 314 <listitem> 315 <para>The <varname>ifalias</varname> interface property is set to this value.</para> 316 </listitem> 317 </varlistentry> 318 <varlistentry> 319 <term><varname>MACAddressPolicy=</varname></term> 320 <listitem> 321 <para>The policy by which the MAC address should be set. The 322 available policies are: 323 </para> 324 325 <variablelist> 326 <varlistentry> 327 <term><option>persistent</option></term> 328 <listitem> 329 <para>If the hardware has a persistent MAC address, as 330 most hardware should, and if it is used by the kernel, 331 nothing is done. Otherwise, a new MAC address is 332 generated which is guaranteed to be the same on every 333 boot for the given machine and the given device, but 334 which is otherwise random. This feature depends on ID_NET_NAME_* 335 properties to exist for the link. On hardware where these 336 properties are not set, the generation of a persistent MAC address 337 will fail.</para> 338 </listitem> 339 </varlistentry> 340 <varlistentry> 341 <term><option>random</option></term> 342 <listitem> 343 <para>If the kernel is using a random MAC address, 344 nothing is done. Otherwise, a new address is randomly 345 generated each time the device appears, typically at 346 boot. Either way, the random address will have the 347 <literal>unicast</literal> and 348 <literal>locally administered</literal> bits set.</para> 349 </listitem> 350 </varlistentry> 351 <varlistentry> 352 <term><option>none</option></term> 353 <listitem> 354 <para>Keeps the MAC address assigned by the kernel. Or use the MAC address specified in 355 <varname>MACAddress=</varname>.</para> 356 </listitem> 357 </varlistentry> 358 </variablelist> 359 360 <para>An empty string assignment is equivalent to setting <literal>none</literal>.</para> 361 </listitem> 362 </varlistentry> 363 <varlistentry> 364 <term><varname>MACAddress=</varname></term> 365 <listitem> 366 <para>The interface MAC address to use. For this setting to take effect, 367 <varname>MACAddressPolicy=</varname> must either be unset, empty, or <literal>none</literal>. 368 </para> 369 </listitem> 370 </varlistentry> 371 <varlistentry> 372 <term><varname>NamePolicy=</varname></term> 373 <listitem> 374 <para>An ordered, space-separated list of policies by which the interface name should be set. 375 <varname>NamePolicy=</varname> may be disabled by specifying <option>net.ifnames=0</option> on the 376 kernel command line. Each of the policies may fail, and the first successful one is used. The name 377 is not set directly, but is exported to udev as the property <option>ID_NET_NAME</option>, which 378 is, by default, used by a 379 <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>, 380 rule to set <varname>NAME</varname>. The available policies are: 381 </para> 382 383 <variablelist> 384 <varlistentry> 385 <term><option>kernel</option></term> 386 <listitem> 387 <para>If the kernel claims that the name it has set 388 for a device is predictable, then no renaming is 389 performed.</para> 390 </listitem> 391 </varlistentry> 392 <varlistentry> 393 <term><option>database</option></term> 394 <listitem> 395 <para>The name is set based on entries in the udev's 396 Hardware Database with the key 397 <varname>ID_NET_NAME_FROM_DATABASE</varname>. 398 </para> 399 </listitem> 400 </varlistentry> 401 <varlistentry> 402 <term><option>onboard</option></term> 403 <listitem> 404 <para>The name is set based on information given by 405 the firmware for on-board devices, as exported by the 406 udev property <varname>ID_NET_NAME_ONBOARD</varname>. 407 See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>. 408 </para> 409 </listitem> 410 </varlistentry> 411 <varlistentry> 412 <term><option>slot</option></term> 413 <listitem> 414 <para>The name is set based on information given by 415 the firmware for hot-plug devices, as exported by the 416 udev property <varname>ID_NET_NAME_SLOT</varname>. 417 See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>. 418 </para> 419 </listitem> 420 </varlistentry> 421 <varlistentry> 422 <term><option>path</option></term> 423 <listitem> 424 <para>The name is set based on the device's physical 425 location, as exported by the udev property 426 <varname>ID_NET_NAME_PATH</varname>. 427 See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>. 428 </para> 429 </listitem> 430 </varlistentry> 431 <varlistentry> 432 <term><option>mac</option></term> 433 <listitem> 434 <para>The name is set based on the device's persistent 435 MAC address, as exported by the udev property 436 <varname>ID_NET_NAME_MAC</varname>. 437 See <citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>. 438 </para> 439 </listitem> 440 </varlistentry> 441 <varlistentry> 442 <term><option>keep</option></term> 443 <listitem> 444 <para>If the device already had a name given by userspace (as part of creation of the device 445 or a rename), keep it.</para> 446 </listitem> 447 </varlistentry> 448 </variablelist> 449 </listitem> 450 </varlistentry> 451 <varlistentry> 452 <term><varname>Name=</varname></term> 453 <listitem> 454 <para>The interface name to use. This option has lower precedence than 455 <varname>NamePolicy=</varname>, so for this setting to take effect, <varname>NamePolicy=</varname> 456 must either be unset, empty, disabled, or all policies configured there must fail. Also see the 457 example below with <literal>Name=dmz0</literal>.</para> 458 459 <para>Note that specifying a name that the kernel might use for another 460 interface (for example <literal>eth0</literal>) is dangerous because the 461 name assignment done by udev will race with the assignment done by the 462 kernel, and only one interface may use the name. Depending on the order of 463 operations, either udev or the kernel will win, making the naming 464 unpredictable. It is best to use some different prefix, for example 465 <literal>internal0</literal>/<literal>external0</literal> or 466 <literal>lan0</literal>/<literal>lan1</literal>/<literal>lan3</literal>. 467 </para> 468 </listitem> 469 </varlistentry> 470 <varlistentry> 471 <term><varname>AlternativeNamesPolicy=</varname></term> 472 <listitem> 473 <para>A space-separated list of policies by which the interface's alternative names 474 should be set. Each of the policies may fail, and all successful policies are used. The 475 available policies are <literal>database</literal>, <literal>onboard</literal>, 476 <literal>slot</literal>, <literal>path</literal>, and <literal>mac</literal>. If the 477 kernel does not support the alternative names, then this setting will be ignored. 478 </para> 479 </listitem> 480 </varlistentry> 481 <varlistentry> 482 <term><varname>AlternativeName=</varname></term> 483 <listitem> 484 <para>The alternative interface name to use. This option can be specified multiple times. 485 If the empty string is assigned to this option, the list is reset, and all prior assignments 486 have no effect. If the kernel does not support the alternative names, then this setting will 487 be ignored.</para> 488 </listitem> 489 </varlistentry> 490 <varlistentry> 491 <term><varname>TransmitQueues=</varname></term> 492 <listitem> 493 <para>Specifies the device's number of transmit queues. An integer in the range 1…4096. 494 When unset, the kernel's default will be used.</para> 495 </listitem> 496 </varlistentry> 497 <varlistentry> 498 <term><varname>ReceiveQueues=</varname></term> 499 <listitem> 500 <para>Specifies the device's number of receive queues. An integer in the range 1…4096. 501 When unset, the kernel's default will be used.</para> 502 </listitem> 503 </varlistentry> 504 <varlistentry> 505 <term><varname>TransmitQueueLength=</varname></term> 506 <listitem> 507 <para>Specifies the transmit queue length of the device in number of packets. An unsigned integer 508 in the range 0…4294967294. When unset, the kernel's default will be used.</para> 509 </listitem> 510 </varlistentry> 511 <varlistentry> 512 <term><varname>MTUBytes=</varname></term> 513 <listitem> 514 <para>The maximum transmission unit in bytes to set for the 515 device. The usual suffixes K, M, G are supported and are 516 understood to the base of 1024.</para> 517 </listitem> 518 </varlistentry> 519 <varlistentry> 520 <term><varname>BitsPerSecond=</varname></term> 521 <listitem> 522 <para>The speed to set for the device, the value is rounded 523 down to the nearest Mbps. The usual suffixes K, M, G are 524 supported and are understood to the base of 1000.</para> 525 </listitem> 526 </varlistentry> 527 <varlistentry> 528 <term><varname>Duplex=</varname></term> 529 <listitem> 530 <para>The duplex mode to set for the device. The accepted values are <option>half</option> and 531 <option>full</option>.</para> 532 </listitem> 533 </varlistentry> 534 <varlistentry> 535 <term><varname>AutoNegotiation=</varname></term> 536 <listitem> 537 <para>Takes a boolean. If set to yes, automatic negotiation of transmission parameters is enabled. 538 Autonegotiation is a procedure by which two connected ethernet devices choose 539 common transmission parameters, such as speed, duplex mode, and flow control. 540 When unset, the kernel's default will be used.</para> 541 542 <para>Note that if autonegotiation is enabled, speed and duplex settings are 543 read-only. If autonegotiation is disabled, speed and duplex settings are writable 544 if the driver supports multiple link modes.</para> 545 </listitem> 546 </varlistentry> 547 <varlistentry> 548 <term><varname>WakeOnLan=</varname></term> 549 <listitem> 550 <para>The Wake-on-LAN policy to set for the device. Takes the special value 551 <literal>off</literal> which disables Wake-on-LAN, or space separated list of the following 552 words:</para> 553 554 <variablelist> 555 <varlistentry> 556 <term><option>phy</option></term> 557 <listitem> 558 <para>Wake on PHY activity.</para> 559 </listitem> 560 </varlistentry> 561 <varlistentry> 562 <term><option>unicast</option></term> 563 <listitem> 564 <para>Wake on unicast messages.</para> 565 </listitem> 566 </varlistentry> 567 <varlistentry> 568 <term><option>multicast</option></term> 569 <listitem> 570 <para>Wake on multicast messages.</para> 571 </listitem> 572 </varlistentry> 573 <varlistentry> 574 <term><option>broadcast</option></term> 575 <listitem> 576 <para>Wake on broadcast messages.</para> 577 </listitem> 578 </varlistentry> 579 <varlistentry> 580 <term><option>arp</option></term> 581 <listitem> 582 <para>Wake on ARP.</para> 583 </listitem> 584 </varlistentry> 585 <varlistentry> 586 <term><option>magic</option></term> 587 <listitem> 588 <para>Wake on receipt of a magic packet. 589 </para> 590 </listitem> 591 </varlistentry> 592 <varlistentry> 593 <term><option>secureon</option></term> 594 <listitem> 595 <para>Enable SecureOn password for MagicPacket. Implied when 596 <varname>WakeOnLanPassword=</varname> is specified. If specified without 597 <varname>WakeOnLanPassword=</varname> option, then the password is read from the 598 credential <literal><replaceable>LINK</replaceable>.link.wol.password</literal> (e.g., 599 <literal>60-foo.link.wol.password</literal>), and if the credential not found, then 600 read from <literal>wol.password</literal>. See 601 <varname>LoadCredential=</varname>/<varname>SetCredential=</varname> in 602 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>1</manvolnum></citerefentry> 603 for details. The password in the credential, must be 6 bytes in hex format with each 604 byte separated by a colon (<literal>:</literal>) like an Ethernet MAC address, e.g., 605 <literal>aa:bb:cc:dd:ee:ff</literal>.</para> 606 </listitem> 607 </varlistentry> 608 </variablelist> 609 610 <para>Defaults to unset, and the device's default will be used. This setting can be specified 611 multiple times. If an empty string is assigned, then the all previous assignments are 612 cleared.</para> 613 </listitem> 614 </varlistentry> 615 <varlistentry> 616 <term><varname>WakeOnLanPassword=</varname></term> 617 <listitem> 618 <para>Specifies the SecureOn password for MagicPacket. Takes an absolute path to a regular 619 file or an <constant>AF_UNIX</constant> stream socket, or the plain password. When a path to 620 a regular file is specified, the password is read from it. When an 621 <constant>AF_UNIX</constant> stream socket is specified, a connection is made to it and the 622 password is read from it. The password must be 6 bytes in hex format with each byte separated 623 by a colon (<literal>:</literal>) like an Ethernet MAC address, e.g., 624 <literal>aa:bb:cc:dd:ee:ff</literal>. This implies <varname>WakeOnLan=secureon</varname>. 625 Defaults to unset, and the current value will not be changed.</para> 626 </listitem> 627 </varlistentry> 628 <varlistentry> 629 <term><varname>Port=</varname></term> 630 <listitem> 631 <para>The port option is used to select the device port. The 632 supported values are:</para> 633 634 <variablelist> 635 <varlistentry> 636 <term><option>tp</option></term> 637 <listitem> 638 <para>An Ethernet interface using Twisted-Pair cable as the medium.</para> 639 </listitem> 640 </varlistentry> 641 <varlistentry> 642 <term><option>aui</option></term> 643 <listitem> 644 <para>Attachment Unit Interface (AUI). Normally used with hubs. 645 </para> 646 </listitem> 647 </varlistentry> 648 <varlistentry> 649 <term><option>bnc</option></term> 650 <listitem> 651 <para>An Ethernet interface using BNC connectors and co-axial cable.</para> 652 </listitem> 653 </varlistentry> 654 <varlistentry> 655 <term><option>mii</option></term> 656 <listitem> 657 <para>An Ethernet interface using a Media Independent Interface (MII).</para> 658 </listitem> 659 </varlistentry> 660 <varlistentry> 661 <term><option>fibre</option></term> 662 <listitem> 663 <para>An Ethernet interface using Optical Fibre as the medium.</para> 664 </listitem> 665 </varlistentry> 666 </variablelist> 667 </listitem> 668 </varlistentry> 669 <varlistentry> 670 <term><varname>Advertise=</varname></term> 671 <listitem> 672 <para>This sets what speeds and duplex modes of operation are advertised for auto-negotiation. 673 This implies <literal>AutoNegotiation=yes</literal>. The supported values are: 674 675 <table> 676 <title>Supported advertise values</title> 677 <tgroup cols='3'> 678 <colspec colname='Advertise' /> 679 <colspec colname='Speed' /> 680 <colspec colname='Duplex Mode' /> 681 682 <thead><row> 683 <entry>Advertise</entry> 684 <entry>Speed (Mbps)</entry> 685 <entry>Duplex Mode</entry> 686 </row></thead> 687 <tbody> 688 <row><entry><option>10baset-half</option></entry> 689 <entry>10</entry><entry>half</entry></row> 690 691 <row><entry><option>10baset-full</option></entry> 692 <entry>10</entry><entry>full</entry></row> 693 694 <row><entry><option>100baset-half</option></entry> 695 <entry>100</entry><entry>half</entry></row> 696 697 <row><entry><option>100baset-full</option></entry> 698 <entry>100</entry><entry>full</entry></row> 699 700 <row><entry><option>1000baset-half</option></entry> 701 <entry>1000</entry><entry>half</entry></row> 702 703 <row><entry><option>1000baset-full</option></entry> 704 <entry>1000</entry><entry>full</entry></row> 705 706 <row><entry><option>10000baset-full</option></entry> 707 <entry>10000</entry><entry>full</entry></row> 708 709 <row><entry><option>2500basex-full</option></entry> 710 <entry>2500</entry><entry>full</entry></row> 711 712 <row><entry><option>1000basekx-full</option></entry> 713 <entry>1000</entry><entry>full</entry></row> 714 715 <row><entry><option>10000basekx4-full</option></entry> 716 <entry>10000</entry><entry>full</entry></row> 717 718 <row><entry><option>10000basekr-full</option></entry> 719 <entry>10000</entry><entry>full</entry></row> 720 721 <row><entry><option>10000baser-fec</option></entry> 722 <entry>10000</entry><entry>full</entry></row> 723 724 <row><entry><option>20000basemld2-full</option></entry> 725 <entry>20000</entry><entry>full</entry></row> 726 727 <row><entry><option>20000basekr2-full</option></entry> 728 <entry>20000</entry><entry>full</entry></row> 729 </tbody> 730 </tgroup> 731 </table> 732 733 By default this is unset, i.e. all possible modes will be advertised. 734 This option may be specified more than once, in which case all specified speeds and modes are advertised. 735 If the empty string is assigned to this option, the list is reset, and all prior assignments have no effect. 736 </para> 737 </listitem> 738 </varlistentry> 739 <varlistentry> 740 <term><varname>ReceiveChecksumOffload=</varname></term> 741 <listitem> 742 <para>Takes a boolean. If set to true, hardware offload for checksumming of ingress 743 network packets is enabled. When unset, the kernel's default will be used.</para> 744 </listitem> 745 </varlistentry> 746 <varlistentry> 747 <term><varname>TransmitChecksumOffload=</varname></term> 748 <listitem> 749 <para>Takes a boolean. If set to true, hardware offload for checksumming of egress 750 network packets is enabled. When unset, the kernel's default will be used.</para> 751 </listitem> 752 </varlistentry> 753 <varlistentry> 754 <term><varname>TCPSegmentationOffload=</varname></term> 755 <listitem> 756 <para>Takes a boolean. If set to true, TCP Segmentation Offload (TSO) is enabled. 757 When unset, the kernel's default will be used.</para> 758 </listitem> 759 </varlistentry> 760 <varlistentry> 761 <term><varname>TCP6SegmentationOffload=</varname></term> 762 <listitem> 763 <para>Takes a boolean. If set to true, TCP6 Segmentation Offload (tx-tcp6-segmentation) is enabled. 764 When unset, the kernel's default will be used.</para> 765 </listitem> 766 </varlistentry> 767 <varlistentry> 768 <term><varname>GenericSegmentationOffload=</varname></term> 769 <listitem> 770 <para>Takes a boolean. If set to true, Generic Segmentation Offload (GSO) is enabled. 771 When unset, the kernel's default will be used.</para> 772 </listitem> 773 </varlistentry> 774 <varlistentry> 775 <term><varname>GenericReceiveOffload=</varname></term> 776 <listitem> 777 <para>Takes a boolean. If set to true, Generic Receive Offload (GRO) is enabled. 778 When unset, the kernel's default will be used.</para> 779 </listitem> 780 </varlistentry> 781 <varlistentry> 782 <term><varname>GenericReceiveOffloadHardware=</varname></term> 783 <listitem> 784 <para>Takes a boolean. If set to true, hardware accelerated Generic Receive Offload (GRO) is 785 enabled. When unset, the kernel's default will be used.</para> 786 </listitem> 787 </varlistentry> 788 <varlistentry> 789 <term><varname>LargeReceiveOffload=</varname></term> 790 <listitem> 791 <para>Takes a boolean. If set to true, Large Receive Offload (LRO) is enabled. 792 When unset, the kernel's default will be used.</para> 793 </listitem> 794 </varlistentry> 795 <varlistentry> 796 <term><varname>ReceiveVLANCTAGHardwareAcceleration=</varname></term> 797 <listitem> 798 <para>Takes a boolean. If set to true, receive VLAN CTAG hardware acceleration is enabled. 799 When unset, the kernel's default will be used.</para> 800 </listitem> 801 </varlistentry> 802 <varlistentry> 803 <term><varname>TransmitVLANCTAGHardwareAcceleration=</varname></term> 804 <listitem> 805 <para>Takes a boolean. If set to true, transmit VLAN CTAG hardware acceleration is enabled. 806 When unset, the kernel's default will be used.</para> 807 </listitem> 808 </varlistentry> 809 <varlistentry> 810 <term><varname>ReceiveVLANCTAGFilter=</varname></term> 811 <listitem> 812 <para>Takes a boolean. If set to true, receive filtering on VLAN CTAGs is enabled. 813 When unset, the kernel's default will be used.</para> 814 </listitem> 815 </varlistentry> 816 <varlistentry> 817 <term><varname>TransmitVLANSTAGHardwareAcceleration=</varname></term> 818 <listitem> 819 <para>Takes a boolean. If set to true, transmit VLAN STAG hardware acceleration is enabled. 820 When unset, the kernel's default will be used.</para> 821 </listitem> 822 </varlistentry> 823 <varlistentry> 824 <term><varname>NTupleFilter=</varname></term> 825 <listitem> 826 <para>Takes a boolean. If set to true, receive N-tuple filters and actions are enabled. 827 When unset, the kernel's default will be used.</para> 828 </listitem> 829 </varlistentry> 830 <varlistentry> 831 <term><varname>RxChannels=</varname></term> 832 <term><varname>TxChannels=</varname></term> 833 <term><varname>OtherChannels=</varname></term> 834 <term><varname>CombinedChannels=</varname></term> 835 <listitem> 836 <para>Specifies the number of receive, transmit, other, or combined channels, respectively. 837 Takes an unsigned integer in the range 1…4294967295 or <literal>max</literal>. If set to 838 <literal>max</literal>, the advertised maximum value of the hardware will be used. When 839 unset, the number will not be changed. Defaults to unset.</para> 840 </listitem> 841 </varlistentry> 842 <varlistentry> 843 <term><varname>RxBufferSize=</varname></term> 844 <term><varname>RxMiniBufferSize=</varname></term> 845 <term><varname>RxJumboBufferSize=</varname></term> 846 <term><varname>TxBufferSize=</varname></term> 847 <listitem> 848 <para>Specifies the maximum number of pending packets in the NIC receive buffer, mini receive 849 buffer, jumbo receive buffer, or transmit buffer, respectively. Takes an unsigned integer in 850 the range 1…4294967295 or <literal>max</literal>. If set to <literal>max</literal>, the 851 advertised maximum value of the hardware will be used. When unset, the number will not be 852 changed. Defaults to unset.</para> 853 </listitem> 854 </varlistentry> 855 <varlistentry> 856 <term><varname>RxFlowControl=</varname></term> 857 <listitem> 858 <para>Takes a boolean. When set, enables receive flow control, also known as the ethernet 859 receive PAUSE message (generate and send ethernet PAUSE frames). When unset, the kernel's 860 default will be used.</para> 861 </listitem> 862 </varlistentry> 863 <varlistentry> 864 <term><varname>TxFlowControl=</varname></term> 865 <listitem> 866 <para>Takes a boolean. When set, enables transmit flow control, also known as the ethernet 867 transmit PAUSE message (respond to received ethernet PAUSE frames). When unset, the kernel's 868 default will be used.</para> 869 </listitem> 870 </varlistentry> 871 <varlistentry> 872 <term><varname>AutoNegotiationFlowControl=</varname></term> 873 <listitem> 874 <para>Takes a boolean. When set, auto negotiation enables the interface to exchange state 875 advertisements with the connected peer so that the two devices can agree on the ethernet 876 PAUSE configuration. When unset, the kernel's default will be used.</para> 877 </listitem> 878 </varlistentry> 879 <varlistentry> 880 <term><varname>GenericSegmentOffloadMaxBytes=</varname></term> 881 <listitem> 882 <para>Specifies the maximum size of a Generic Segment Offload (GSO) packet the 883 device should accept. The usual suffixes K, M, G are supported and are 884 understood to the base of 1024. An unsigned integer in the range 1…65536. 885 Defaults to unset.</para> 886 </listitem> 887 </varlistentry> 888 <varlistentry> 889 <term><varname>GenericSegmentOffloadMaxSegments=</varname></term> 890 <listitem> 891 <para>Specifies the maximum number of Generic Segment Offload (GSO) segments the device should 892 accept. An unsigned integer in the range 1…65535. Defaults to unset.</para> 893 </listitem> 894 </varlistentry> 895 <varlistentry> 896 <term><varname>UseAdaptiveRxCoalesce=</varname></term> 897 <term><varname>UseAdaptiveTxCoalesce=</varname></term> 898 <listitem> 899 <para>Boolean properties that, when set, enable/disable adaptive Rx/Tx coalescing if the hardware 900 supports it. When unset, the kernel's default will be used.</para> 901 </listitem> 902 </varlistentry> 903 <varlistentry> 904 <term><varname>RxCoalesceSec=</varname></term> 905 <term><varname>RxCoalesceIrqSec=</varname></term> 906 <term><varname>RxCoalesceLowSec=</varname></term> 907 <term><varname>RxCoalesceHighSec=</varname></term> 908 <term><varname>TxCoalesceSec=</varname></term> 909 <term><varname>TxCoalesceIrqSec=</varname></term> 910 <term><varname>TxCoalesceLowSec=</varname></term> 911 <term><varname>TxCoalesceHighSec=</varname></term> 912 <listitem> 913 <para>These properties configure the delay before Rx/Tx interrupts are generated after a packet is 914 sent/received. The <literal>Irq</literal> properties come into effect when the host is servicing an 915 IRQ. The <literal>Low</literal> and <literal>High</literal> properties come into effect when the 916 packet rate drops below the low packet rate threshold or exceeds the high packet rate threshold 917 respectively if adaptive Rx/Tx coalescing is enabled. When unset, the kernel's defaults will be 918 used.</para> 919 </listitem> 920 </varlistentry> 921 <varlistentry> 922 <term><varname>RxMaxCoalescedFrames=</varname></term> 923 <term><varname>RxMaxCoalescedIrqFrames=</varname></term> 924 <term><varname>RxMaxCoalescedLowFrames=</varname></term> 925 <term><varname>RxMaxCoalescedHighFrames=</varname></term> 926 <term><varname>TxMaxCoalescedFrames=</varname></term> 927 <term><varname>TxMaxCoalescedIrqFrames=</varname></term> 928 <term><varname>TxMaxCoalescedLowFrames=</varname></term> 929 <term><varname>TxMaxCoalescedHighFrames=</varname></term> 930 <listitem> 931 <para>These properties configure the maximum number of frames that are sent/received before a Rx/Tx 932 interrupt is generated. The <literal>Irq</literal> properties come into effect when the host is 933 servicing an IRQ. The <literal>Low</literal> and <literal>High</literal> properties come into 934 effect when the packet rate drops below the low packet rate threshold or exceeds the high packet 935 rate threshold respectively if adaptive Rx/Tx coalescing is enabled. When unset, the kernel's 936 defaults will be used.</para> 937 </listitem> 938 </varlistentry> 939 <varlistentry> 940 <term><varname>CoalescePacketRateLow=</varname></term> 941 <term><varname>CoalescePacketRateHigh=</varname></term> 942 <listitem> 943 <para>These properties configure the low and high packet rate (expressed in packets per second) 944 threshold respectively and are used to determine when the corresponding coalescing settings for low 945 and high packet rates come into effect if adaptive Rx/Tx coalescing is enabled. If unset, the 946 kernel's defaults will be used.</para> 947 </listitem> 948 </varlistentry> 949 <varlistentry> 950 <term><varname>CoalescePacketRateSampleIntervalSec=</varname></term> 951 <listitem> 952 <para>Configures how often to sample the packet rate used for adaptive Rx/Tx coalescing. This 953 property cannot be zero. This lowest time granularity supported by this property is seconds. 954 Partial seconds will be rounded up before being passed to the kernel. If unset, the kernel's 955 default will be used.</para> 956 </listitem> 957 </varlistentry> 958 <varlistentry> 959 <term><varname>StatisticsBlockCoalesceSec=</varname></term> 960 <listitem> 961 <para>How long to delay driver in-memory statistics block updates. If the driver does not have an 962 in-memory statistic block, this property is ignored. This property cannot be zero. If unset, the 963 kernel's default will be used.</para> 964 </listitem> 965 </varlistentry> 966 967 <varlistentry> 968 <term><varname>MDI=</varname></term> 969 <listitem> 970 <para>Specifies the medium dependent interface (MDI) mode for the interface. A MDI describes 971 the interface from a physical layer implementation to the physical medium used to carry the 972 transmission. Takes one of the following words: <literal>straight</literal> (or equivalently: 973 <literal>mdi</literal>), <literal>crossover</literal> (or equivalently: 974 <literal>mdi-x</literal>, <literal>mdix</literal>), and <literal>auto</literal>. When 975 <literal>straight</literal>, the MDI straight through mode will be used. When 976 <literal>crossover</literal>, the MDI crossover (MDI-X) mode will be used. When 977 <literal>auto</literal>, the MDI status is automatically detected. Defaults to unset, and the 978 kernel's default will be used.</para> 979 </listitem> 980 </varlistentry> 981 982 <varlistentry> 983 <term><varname>SR-IOVVirtualFunctions=</varname></term> 984 <listitem> 985 <para>Specifies the number of SR-IOV virtual functions. Takes an integer in the range 986 0…2147483647. Defaults to unset, and automatically determined from the values specified in 987 the <varname>VirtualFunction=</varname> settings in the [SR-IOV] sections.</para> 988 </listitem> 989 </varlistentry> 990 991 </variablelist> 992 </refsect1> 993 994 <refsect1 id='sr-iov'> 995 <title>[SR-IOV] Section Options</title> 996 <para>The [SR-IOV] section accepts the following keys. Specify several [SR-IOV] sections to 997 configure several SR-IOVs. SR-IOV provides the ability to partition a single physical PCI resource 998 into virtual PCI functions which can then be injected into a VM. In the case of network VFs, SR-IOV 999 improves north-south network performance (that is, traffic with endpoints outside the host machine) 1000 by allowing traffic to bypass the host machine’s network stack.</para> 1001 1002 <variablelist class='network-directives'> 1003 <varlistentry> 1004 <term><varname>VirtualFunction=</varname></term> 1005 <listitem> 1006 <para>Specifies a Virtual Function (VF), lightweight PCIe function designed solely to move 1007 data in and out. Takes an integer in the range 0…2147483646. This option is compulsory. 1008 </para> 1009 </listitem> 1010 </varlistentry> 1011 1012 <varlistentry> 1013 <term><varname>VLANId=</varname></term> 1014 <listitem> 1015 <para>Specifies VLAN ID of the virtual function. Takes an integer in the range 1…4095.</para> 1016 </listitem> 1017 </varlistentry> 1018 1019 <varlistentry> 1020 <term><varname>QualityOfService=</varname></term> 1021 <listitem> 1022 <para>Specifies quality of service of the virtual function. Takes an integer in the range 1023 1…4294967294.</para> 1024 </listitem> 1025 </varlistentry> 1026 1027 <varlistentry> 1028 <term><varname>VLANProtocol=</varname></term> 1029 <listitem> 1030 <para>Specifies VLAN protocol of the virtual function. Takes <literal>802.1Q</literal> or 1031 <literal>802.1ad</literal>.</para> 1032 </listitem> 1033 </varlistentry> 1034 1035 <varlistentry> 1036 <term><varname>MACSpoofCheck=</varname></term> 1037 <listitem> 1038 <para>Takes a boolean. Controls the MAC spoof checking. When unset, the kernel's default will 1039 be used.</para> 1040 </listitem> 1041 </varlistentry> 1042 1043 <varlistentry> 1044 <term><varname>QueryReceiveSideScaling=</varname></term> 1045 <listitem> 1046 <para>Takes a boolean. Toggle the ability of querying the receive side scaling (RSS) 1047 configuration of the virtual function (VF). The VF RSS information like RSS hash key may be 1048 considered sensitive on some devices where this information is shared between VF and the 1049 physical function (PF). When unset, the kernel's default will be used.</para> 1050 </listitem> 1051 </varlistentry> 1052 1053 <varlistentry> 1054 <term><varname>Trust=</varname></term> 1055 <listitem> 1056 <para>Takes a boolean. Allows one to set trust mode of the virtual function (VF). When set, 1057 VF users can set a specific feature which may impact security and/or performance. When unset, 1058 the kernel's default will be used.</para> 1059 </listitem> 1060 </varlistentry> 1061 1062 <varlistentry> 1063 <term><varname>LinkState=</varname></term> 1064 <listitem> 1065 <para>Allows one to set the link state of the virtual function (VF). Takes a boolean or a 1066 special value <literal>auto</literal>. Setting to <literal>auto</literal> means a 1067 reflection of the physical function (PF) link state, <literal>yes</literal> lets the VF to 1068 communicate with other VFs on this host even if the PF link state is down, 1069 <literal>no</literal> causes the hardware to drop any packets sent by the VF. When unset, 1070 the kernel's default will be used.</para> 1071 </listitem> 1072 </varlistentry> 1073 1074 <varlistentry> 1075 <term><varname>MACAddress=</varname></term> 1076 <listitem> 1077 <para>Specifies the MAC address for the virtual function.</para> 1078 </listitem> 1079 </varlistentry> 1080 </variablelist> 1081 </refsect1> 1082 1083 <refsect1> 1084 <title>Examples</title> 1085 1086 <example> 1087 <title>/usr/lib/systemd/network/99-default.link</title> 1088 1089 <para>The link file <filename>99-default.link</filename> that is 1090 shipped with systemd defines the default naming policy for 1091 links.</para> 1092 1093 <programlisting>[Link] 1094NamePolicy=kernel database onboard slot path 1095MACAddressPolicy=persistent</programlisting> 1096 </example> 1097 1098 <example> 1099 <title>/etc/systemd/network/10-dmz.link</title> 1100 1101 <para>This example assigns the fixed name <literal>dmz0</literal> to the interface with the MAC address 1102 00:a0:de:63:7a:e6:</para> 1103 1104 <programlisting>[Match] 1105MACAddress=00:a0:de:63:7a:e6 1106 1107[Link] 1108Name=dmz0</programlisting> 1109 1110 <para><varname>NamePolicy=</varname> is not set, so <varname>Name=</varname> takes effect. We use the 1111 <literal>10-</literal> prefix to order this file early in the list. Note that it needs to be before 1112 <literal>99-link</literal>, i.e. it needs a numerical prefix, to have any effect at all.</para> 1113 </example> 1114 1115 <example> 1116 <title>Debugging <varname>NamePolicy=</varname> assignments</title> 1117 1118 <programlisting>$ sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/hub0 1119… 1120Parsed configuration file /usr/lib/systemd/network/99-default.link 1121Parsed configuration file /etc/systemd/network/10-eth0.link 1122ID_NET_DRIVER=cdc_ether 1123Config file /etc/systemd/network/10-eth0.link applies to device hub0 1124link_config: autonegotiation is unset or enabled, the speed and duplex are not writable. 1125hub0: Device has name_assign_type=4 1126Using default interface naming scheme 'v240'. 1127hub0: Policies didn't yield a name, using specified Name=hub0. 1128ID_NET_LINK_FILE=/etc/systemd/network/10-eth0.link 1129ID_NET_NAME=hub0 1130…</programlisting> 1131 1132 <para>Explicit <varname>Name=</varname> configuration wins in this case.</para> 1133 1134 <programlisting>sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/enp0s31f6 1135… 1136Parsed configuration file /usr/lib/systemd/network/99-default.link 1137Parsed configuration file /etc/systemd/network/10-eth0.link 1138Created link configuration context. 1139ID_NET_DRIVER=e1000e 1140Config file /usr/lib/systemd/network/99-default.link applies to device enp0s31f6 1141link_config: autonegotiation is unset or enabled, the speed and duplex are not writable. 1142enp0s31f6: Device has name_assign_type=4 1143Using default interface naming scheme 'v240'. 1144enp0s31f6: Policy *keep*: keeping existing userspace name 1145enp0s31f6: Device has addr_assign_type=0 1146enp0s31f6: MAC on the device already matches policy *persistent* 1147ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link 1148… 1149</programlisting> 1150 1151 <para>In this case, the interface was already renamed, so the <option>keep</option> policy specified as 1152 the first option in <filename index="false">99-default.link</filename> means that the existing name is 1153 preserved. If <option>keep</option> was removed, or if were in boot before the renaming has happened, 1154 we might get the following instead:</para> 1155 1156 <programlisting>enp0s31f6: Policy *path* yields "enp0s31f6". 1157enp0s31f6: Device has addr_assign_type=0 1158enp0s31f6: MAC on the device already matches policy *persistent* 1159ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link 1160ID_NET_NAME=enp0s31f6 1161… 1162</programlisting> 1163 1164 <para>Please note that the details of output are subject to change.</para> 1165 </example> 1166 1167 <example> 1168 <title>/etc/systemd/network/10-internet.link</title> 1169 1170 <para>This example assigns the fixed name 1171 <literal>internet0</literal> to the interface with the device 1172 path <literal>pci-0000:00:1a.0-*</literal>:</para> 1173 1174 <programlisting>[Match] 1175Path=pci-0000:00:1a.0-* 1176 1177[Link] 1178Name=internet0</programlisting> 1179 </example> 1180 1181 <example> 1182 <title>/etc/systemd/network/25-wireless.link</title> 1183 1184 <para>Here's an overly complex example that shows the use of a large number of [Match] and [Link] settings.</para> 1185 1186 <programlisting>[Match] 1187MACAddress=12:34:56:78:9a:bc 1188Driver=brcmsmac 1189Path=pci-0000:02:00.0-* 1190Type=wlan 1191Virtualization=no 1192Host=my-laptop 1193Architecture=x86-64 1194 1195[Link] 1196Name=wireless0 1197MTUBytes=1450 1198BitsPerSecond=10M 1199WakeOnLan=magic 1200MACAddress=cb:a9:87:65:43:21</programlisting> 1201 </example> 1202 </refsect1> 1203 1204 <refsect1> 1205 <title>See Also</title> 1206 <para> 1207 <citerefentry> 1208 <refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum> 1209 </citerefentry>, 1210 <citerefentry> 1211 <refentrytitle>udevadm</refentrytitle><manvolnum>8</manvolnum> 1212 </citerefentry>, 1213 <citerefentry> 1214 <refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum> 1215 </citerefentry>, 1216 <citerefentry> 1217 <refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum> 1218 </citerefentry>, 1219 <citerefentry> 1220 <refentrytitle>systemd-network-generator.service</refentrytitle><manvolnum>8</manvolnum> 1221 </citerefentry> 1222 </para> 1223 </refsect1> 1224 1225</refentry> 1226