2818N/A<?
xml version='1.0'?>
<!--*-nxml-*--> 2818N/A<!
DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 2818N/A This file is part of systemd. 2818N/A Copyright 2014 Tom Gundersen 2818N/A systemd is free software; you can redistribute it and/or modify it 2818N/A under the terms of the GNU Lesser General Public License as published by 2818N/A the Free Software Foundation; either version 2.1 of the License, or 2818N/A (at your option) any later version. 2818N/A systemd is distributed in the hope that it will be useful, but 2818N/A WITHOUT ANY WARRANTY; without even the implied warranty of 2818N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2818N/A Lesser General Public License for more details. 2818N/A You should have received a copy of the GNU Lesser General Public License 5227N/A <
productname>systemd</
productname>
2818N/A <
contrib>Developer</
contrib>
2818N/A <
surname>Gundersen</
surname>
2818N/A <
refpurpose>Network device configuration</
refpurpose>
2818N/A <
para><
filename><
replaceable>link</
replaceable>.link</
filename></
para>
2818N/A <
para>Network link configuration is performed by the
2818N/A <
command>net_setup_link</
command> udev builtin.</
para>
2818N/A <
para>The link files are read from the files located in the system
2818N/A the volatile runtime network directory
2818N/A administration network directory
2818N/A the extension <
filename>.link</
filename>; other extensions are
2818N/A ignored. All link files are collectively sorted and processed in
2818N/A lexical order, regardless of the directories in which they live.
2818N/A However, files with identical filenames replace each other. Files
2818N/A in <
filename>/etc</
filename> have the highest priority, files in
2818N/A <
filename>/run</
filename> take precedence over files with the same
2818N/A name in <
filename>/
usr/
lib</
filename>. This can be used to
2818N/A override a system-supplied link file with a local file if needed;
2818N/A a symlink in <
filename>/etc</
filename> with the same name as a
4302N/A <
para>The link file contains a <
literal>[Match]</
literal> section,
4302N/A which determines if a given link file may be applied to a given
5934N/A device, as well as a <
literal>[Link]</
literal> section specifying
5934N/A how the device should be configured. The first (in lexical order)
5934N/A of the link files that matches a given device is applied. Note
4302N/A shipped by the system, any user-supplied
4302N/A <
filename>.link</
filename> should hence have a lexically earlier
3633N/A name to be considered at all.</
para>
2818N/A <
title>[Match] Section Options</
title>
2818N/A <
para>A link file is said to match a device if each of the entries
2818N/A in the <
literal>[Match]</
literal> section matches, or if the
2818N/A section is empty. The following keys are accepted:</
para>
2818N/A <
variablelist class='network-directives'>
2818N/A <
term><
varname>MACAddress=</
varname></
term>
2818N/A <
para>The hardware address.</
para>
3693N/A <
term><
varname>OriginalName=</
varname></
term>
3693N/A <
para>A whitespace-separated list of shell-style globs matching
3693N/A the device name, as exposed by the udev property
3693N/A "INTERFACE". This can not be used to match on names that have
3693N/A already been changed from userspace. Caution is advised when matching on
3693N/A kernel-assigned names, as they are known to be unstable
2818N/A <
term><
varname>Path=</
varname></
term>
2818N/A <
para>A whitespace-separated list of shell-style globs matching
2818N/A the persistent path, as exposed by the udev property
3251N/A <
literal>ID_PATH</
literal>.</
para>
2818N/A <
term><
varname>Driver=</
varname></
term>
2818N/A <
para>A whitespace-separated list of shell-style globs matching
2818N/A the driver currently bound to the device,
2818N/A as exposed by the udev property <
literal>DRIVER</
literal>
3693N/A of its parent device, or if that is not set, the
2818N/A driver as exposed by <
literal>ethtool -i</
literal>
2818N/A of the device itself.</
para>
2818N/A <
term><
varname>Type=</
varname></
term>
2818N/A <
para>A whitespace-separated list of shell-style globs matching
2818N/A the device type, as exposed by the udev
2818N/A property <
literal>DEVTYPE</
literal>.</
para>
3497N/A <
term><
varname>Host=</
varname></
term>
3497N/A <
para>Matches against the hostname or machine
3497N/A ID of the host. See <
literal>ConditionHost=</
literal> in
3497N/A <
citerefentry><
refentrytitle>
systemd.unit</
refentrytitle><
manvolnum>5</
manvolnum></
citerefentry>
3497N/A <
term><
varname>Virtualization=</
varname></
term>
3693N/A <
para>Checks whether the system is executed in
3497N/A a virtualized environment and optionally test
3497N/A whether it is a specific implementation. See
4828N/A <
literal>ConditionVirtualization=</
literal> in
4828N/A <
citerefentry><
refentrytitle>
systemd.unit</
refentrytitle><
manvolnum>5</
manvolnum></
citerefentry>
4828N/A <
term><
varname>KernelCommandLine=</
varname></
term>
3497N/A <
para>Checks whether a specific kernel command line option
2818N/A is set (or if prefixed with the exclamation mark unset). See
3477N/A <
literal>ConditionKernelCommandLine=</
literal> in
2818N/A <
citerefentry><
refentrytitle>
systemd.unit</
refentrytitle><
manvolnum>5</
manvolnum></
citerefentry>
2818N/A <
term><
varname>Architecture=</
varname></
term>
2818N/A <
para>Checks whether the system is running on a specific
2818N/A architecture. See <
literal>ConditionArchitecture=</
literal>
2818N/A <
citerefentry><
refentrytitle>
systemd.unit</
refentrytitle><
manvolnum>5</
manvolnum></
citerefentry>
4089N/A <
title>[Link] Section Options</
title>
4089N/A <
para>The <
literal>[Link]</
literal> section accepts the following
3747N/A <
variablelist class='network-directives'>
3747N/A <
term><
varname>Description=</
varname></
term>
3747N/A <
para>A description of the device.</
para>
2818N/A <
term><
varname>Alias=</
varname></
term>
3817N/A <
para>The <
literal>ifalias</
literal> is set to this
3817N/A <
term><
varname>MACAddressPolicy=</
varname></
term>
3817N/A <
para>The policy by which the MAC address should be set. The
<
term><
literal>persistent</
literal></
term>
<
para>If the hardware has a persistent MAC address, as
most hardware should, and if it is used by the kernel,
nothing is done. Otherwise, a new MAC address is
generated which is guaranteed to be the same on every
boot for the given machine and the given device, but
which is otherwise random. This feature depends on ID_NET_NAME_*
properties existing for the link, on hardware where these
properties are not set the generation of a persistent MAC address
<
term><
literal>random</
literal></
term>
<
para>If the kernel is using a random MAC address,
nothing is done. Otherwise, a new address is randomly
generated each time the device appears, typically at
<
term><
varname>MACAddress=</
varname></
term>
<
para>The MAC address to use, if no
<
literal>MACAddressPolicy=</
literal>
<
term><
varname>NamePolicy=</
varname></
term>
<
para>An ordered, space-separated list of policies by which
the interface name should be set.
<
literal>NamePolicy</
literal> may be disabled by specifying
<
literal>
net.ifnames=0</
literal> on the kernel command line.
Each of the policies may fail, and the first successful one
is used. The name is not set directly, but is exported to
udev as the property <
literal>ID_NET_NAME</
literal>, which
is, by default, used by a udev rule to set
<
literal>NAME</
literal>. If the name has already been set by
userspace, no renaming is performed. The available policies
<
term><
literal>kernel</
literal></
term>
<
para>If the kernel claims that the name it has set
for a device is predictable, then no renaming is
<
term><
literal>database</
literal></
term>
<
para>The name is set based on entries in the udev's
Hardware Database with the key
<
literal>ID_NET_NAME_FROM_DATABASE</
literal>.
<
term><
literal>onboard</
literal></
term>
<
para>The name is set based on information given by
the firmware for on-board devices, as exported by the
udev property <
literal>ID_NET_NAME_ONBOARD</
literal>.
<
term><
literal>slot</
literal></
term>
<
para>The name is set based on information given by
the firmware for hot-plug devices, as exported by the
udev property <
literal>ID_NET_NAME_SLOT</
literal>.
<
term><
literal>path</
literal></
term>
<
para>The name is set based on the device's physical
location, as exported by the udev property
<
literal>ID_NET_NAME_PATH</
literal>.</
para>
<
term><
literal>mac</
literal></
term>
<
para>The name is set based on the device's persistent
MAC address, as exported by the udev property
<
literal>ID_NET_NAME_MAC</
literal>.</
para>
<
term><
varname>Name=</
varname></
term>
<
para>The interface name to use in case all the
<
varname>NamePolicy=</
varname> fail, or in case
<
varname>NamePolicy=</
varname> is missing or
<
term><
varname>MTUBytes=</
varname></
term>
<
para>The maximum transmission unit in bytes to set for the
device. The usual suffixes K, M, G, are supported and are
understood to the base of 1024.</
para>
<
term><
varname>BitsPerSecond=</
varname></
term>
<
para>The speed to set for the device, the value is rounded
down to the nearest Mbps. The usual suffixes K, M, G, are
supported and are understood to the base of 1000.</
para>
<
term><
varname>Duplex=</
varname></
term>
<
para>The duplex mode to set for the device. The accepted
values are <
literal>half</
literal> and
<
literal>full</
literal>.</
para>
<
term><
varname>WakeOnLan=</
varname></
term>
<
para>The Wake-on-LAN policy to set for the device. The
supported values are:</
para>
<
term><
literal>phy</
literal></
term>
<
para>Wake on PHY activity.</
para>
<
term><
literal>magic</
literal></
term>
<
para>Wake on receipt of a magic packet.
<
term><
literal>off</
literal></
term>
MACAddress=12:34:56:78:9a:bc
MACAddress=cb:a9:87:65:43:21</
programlisting>
<
refentrytitle>udevadm</
refentrytitle><
manvolnum>8</
manvolnum>