File: systemd.link.html

package info (click to toggle)
systemd 215-17
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 49,568 kB
  • sloc: ansic: 192,789; xml: 39,586; sh: 13,002; makefile: 4,700; perl: 1,461; python: 1,355
file content (137 lines) | stat: -rw-r--r-- 18,528 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>systemd.link</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
    a.headerlink {
      color: #c60f0f;
      font-size: 0.8em;
      padding: 0 4px 0 4px;
      text-decoration: none;
      visibility: hidden;
    }

    a.headerlink:hover {
      background-color: #c60f0f;
      color: white;
    }

    h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
      visibility: visible;
    }
  </style><a href="index.html">Index </a>·
  <a href="systemd.directives.html">Directives </a>·
  <a href="../python-systemd/index.html">Python </a>·
  <a href="../libudev/index.html">libudev </a>·
  <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 215</span><hr><div class="refentry"><a name="systemd.link"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemd.link — Network device configuration</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><p><code class="filename"><em class="replaceable"><code>link</code></em>.link</code></p></div><div class="refsect1"><a name="idm214167301024"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description">¶</a></h2><p>Network link configuration is performed by the <span class="command"><strong>net_setup_link</strong></span>
                udev builtin.</p><p>The link files are read from the files located in the
                system network directory <code class="filename">/usr/lib/systemd/network</code>,
                the volatile runtime network directory <code class="filename">/run/systemd/network</code>,
                and the local administration network directory <code class="filename">/etc/systemd/network</code>.
                Link files must have the extension <code class="filename">.link</code>; other extensions are ignored.
                All link files are collectively sorted and processed in lexical order,
                regardless of the directories in which they live. However, files with
                identical filenames replace each other. Files in <code class="filename">/etc</code>
                have the highest priority, files in <code class="filename">/run</code> take precedence
                over files with the same name in <code class="filename">/usr/lib</code>. This can be
                used to override a system-supplied link file with a local file if needed;
                a symlink in <code class="filename">/etc</code> with the same name as a link file in
                <code class="filename">/usr/lib</code>, pointing to <code class="filename">/dev/null</code>,
                disables the link file entirely.</p><p>The link file contains a "<code class="literal">[Match]</code>" section, which
                determines if a given link file may be applied to a given device; and a
                "<code class="literal">[Link]</code>" section specifying how the device should be
                configured. The first (in lexical order) of the link files that matches
                a given device is applied.</p></div><div class="refsect1"><a name="idm214167231168"></a><h2 id="[Match] Section Options">[Match] Section Options<a class="headerlink" title="Permalink to this headline" href="#%5BMatch%5D%20Section%20Options">¶</a></h2><p>A link file is said to match a device if each of the entries in the
                "<code class="literal">[Match]</code>" section matches, or if the section is empty.
                The following keys are accepted:</p><div class="variablelist"><dl class="variablelist"><dt id="MACAddress="><span class="term"><code class="varname">MACAddress=</code></span><a class="headerlink" title="Permalink to this term" href="#MACAddress=">¶</a></dt><dd><p>The hardware address.</p></dd><dt id="Path="><span class="term"><code class="varname">Path=</code></span><a class="headerlink" title="Permalink to this term" href="#Path=">¶</a></dt><dd><p>The persistent path, as exposed by the
                                udev property "<code class="literal">ID_PATH</code>". May
                                contain shell style globs.</p></dd><dt id="Driver="><span class="term"><code class="varname">Driver=</code></span><a class="headerlink" title="Permalink to this term" href="#Driver=">¶</a></dt><dd><p>The driver currently bound to the device,
                                        as exposed by the udev property "<code class="literal">DRIVER</code>"
                                        of its parent device, or if that is not set, the
                                        driver as exposed by "<code class="literal">ethtool -i</code>"
                                        of the device itself.</p></dd><dt id="Type="><span class="term"><code class="varname">Type=</code></span><a class="headerlink" title="Permalink to this term" href="#Type=">¶</a></dt><dd><p>The device type, as exposed by the udev
                                        property "<code class="literal">DEVTYPE</code>".</p></dd><dt id="Host="><span class="term"><code class="varname">Host=</code></span><a class="headerlink" title="Permalink to this term" href="#Host=">¶</a></dt><dd><p>Matches against the hostname or machine
                                        ID of the host. See "<code class="literal">ConditionHost=</code>" in
                                        <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>
                                        for details.</p></dd><dt id="Virtualization="><span class="term"><code class="varname">Virtualization=</code></span><a class="headerlink" title="Permalink to this term" href="#Virtualization=">¶</a></dt><dd><p>Checks whether the system is executed in
                                        a virtualized environment and optionally test
                                        whether it is a specific implementation. See
                                        "<code class="literal">ConditionVirtualization=</code>" in
                                        <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>
                                        for details.</p></dd><dt id="KernelCommandLine="><span class="term"><code class="varname">KernelCommandLine=</code></span><a class="headerlink" title="Permalink to this term" href="#KernelCommandLine=">¶</a></dt><dd><p>Checks whether a specific kernel command
                                        line option is set (or if prefixed with the
                                        exclamation mark unset). See
                                        "<code class="literal">ConditionKernelCommandLine=</code>" in
                                        <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>
                                        for details.</p></dd><dt id="Architecture="><span class="term"><code class="varname">Architecture=</code></span><a class="headerlink" title="Permalink to this term" href="#Architecture=">¶</a></dt><dd><p>Checks whether the system is running on a
                                        specific architecture. See
                                        "<code class="literal">ConditionArchitecture=</code>" in
                                        <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>
                                        for details.</p></dd></dl></div></div><div class="refsect1"><a name="idm214169589552"></a><h2 id="[Link] Section Options">[Link] Section Options<a class="headerlink" title="Permalink to this headline" href="#%5BLink%5D%20Section%20Options">¶</a></h2><p>The "<code class="literal">[Link]</code>" section accepts the following
                keys:</p><div class="variablelist"><dl class="variablelist"><dt id="Description="><span class="term"><code class="varname">Description=</code></span><a class="headerlink" title="Permalink to this term" href="#Description=">¶</a></dt><dd><p>A description of the device.</p></dd><dt id="Alias="><span class="term"><code class="varname">Alias=</code></span><a class="headerlink" title="Permalink to this term" href="#Alias=">¶</a></dt><dd><p>The "<code class="literal">ifalias</code>" is set to
                                        this value.</p></dd><dt id="MACAddressPolicy="><span class="term"><code class="varname">MACAddressPolicy=</code></span><a class="headerlink" title="Permalink to this term" href="#MACAddressPolicy=">¶</a></dt><dd><p>The policy by which the MAC address
                                        should be set. The available policies are:
                                        </p><div class="variablelist"><dl class="variablelist"><dt id="persistent"><span class="term">"<code class="literal">persistent</code>"</span><a class="headerlink" title="Permalink to this term" href="#persistent">¶</a></dt><dd><p>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.</p></dd><dt id="random"><span class="term">"<code class="literal">random</code>"</span><a class="headerlink" title="Permalink to this term" href="#random">¶</a></dt><dd><p>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 boot.</p></dd></dl></div></dd><dt id="MACAddress="><span class="term"><code class="varname">MACAddress=</code></span><a class="headerlink" title="Permalink to this term" href="#MACAddress=">¶</a></dt><dd><p>The MAC address to use, if no
                                        "<code class="literal">MACAddressPolicy=</code>"
                                        is specified.</p></dd><dt id="NamePolicy="><span class="term"><code class="varname">NamePolicy=</code></span><a class="headerlink" title="Permalink to this term" href="#NamePolicy=">¶</a></dt><dd><p>An ordered, space-separated list of
                                        policies by which the interface name should
                                        be set. "<code class="literal">NamePolicy</code>" may be
                                        disabled by specifying
                                        "<code class="literal">net.ifnames=0</code>" on the kernel
                                        commandline. 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 "<code class="literal">ID_NET_NAME</code>",
                                        which is, by default, used by a udev rule to set
                                        "<code class="literal">NAME</code>". The available policies
                                        are:</p><div class="variablelist"><dl class="variablelist"><dt id="database"><span class="term">"<code class="literal">database</code>"</span><a class="headerlink" title="Permalink to this term" href="#database">¶</a></dt><dd><p>The name is set based on entries in
                                                                the udev's Hardware Database with the key
                                                                "<code class="literal">ID_NET_NAME_FROM_DATABASE</code>".
                                                                </p></dd><dt id="onboard"><span class="term">"<code class="literal">onboard</code>"</span><a class="headerlink" title="Permalink to this term" href="#onboard">¶</a></dt><dd><p>The name is set based on information given by
                                                                the firmware for on-board devices, as exported by
                                                                the udev property "<code class="literal">ID_NET_NAME_ONBOARD</code>".
                                                                </p></dd><dt id="slot"><span class="term">"<code class="literal">slot</code>"</span><a class="headerlink" title="Permalink to this term" href="#slot">¶</a></dt><dd><p>The name is set based on information given by
                                                                the firmware for hot-plug devices, as exported by
                                                                the udev property "<code class="literal">ID_NET_NAME_SLOT</code>".
                                                                </p></dd><dt id="path"><span class="term">"<code class="literal">path</code>"</span><a class="headerlink" title="Permalink to this term" href="#path">¶</a></dt><dd><p>The name is set based on the device's physical
                                                                location, as exported by the udev property
                                                                "<code class="literal">ID_NET_NAME_PATH</code>".</p></dd><dt id="mac"><span class="term">"<code class="literal">mac</code>"</span><a class="headerlink" title="Permalink to this term" href="#mac">¶</a></dt><dd><p>The name is set based on the device's
                                                                persistent MAC address, as exported by the udev
                                                                property "<code class="literal">ID_NET_NAME_MAC</code>".</p></dd></dl></div></dd><dt id="Name="><span class="term"><code class="varname">Name=</code></span><a class="headerlink" title="Permalink to this term" href="#Name=">¶</a></dt><dd><p>The interface name to use in case all the
                                        policies specified in
                                        <code class="varname">NamePolicy=</code> fail, or in case
                                        <code class="varname">NamePolicy=</code> is missing or
                                        disabled.</p></dd><dt id="MTUBytes="><span class="term"><code class="varname">MTUBytes=</code></span><a class="headerlink" title="Permalink to this term" href="#MTUBytes=">¶</a></dt><dd><p>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.</p></dd><dt id="BitsPerSecond="><span class="term"><code class="varname">BitsPerSecond=</code></span><a class="headerlink" title="Permalink to this term" href="#BitsPerSecond=">¶</a></dt><dd><p>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.</p></dd><dt id="Duplex="><span class="term"><code class="varname">Duplex=</code></span><a class="headerlink" title="Permalink to this term" href="#Duplex=">¶</a></dt><dd><p>The duplex mode to set for the device.
                                        The accepted values are "<code class="literal">half</code>"
                                        and "<code class="literal">full</code>".</p></dd><dt id="WakeOnLan="><span class="term"><code class="varname">WakeOnLan=</code></span><a class="headerlink" title="Permalink to this term" href="#WakeOnLan=">¶</a></dt><dd><p>The Wake-on-LAN policy to set for the
                                        device. The supported values are:</p><div class="variablelist"><dl class="variablelist"><dt id="phy"><span class="term">"<code class="literal">phy</code>"</span><a class="headerlink" title="Permalink to this term" href="#phy">¶</a></dt><dd><p>Wake on PHY activity.</p></dd><dt id="magic"><span class="term">"<code class="literal">magic</code>"</span><a class="headerlink" title="Permalink to this term" href="#magic">¶</a></dt><dd><p>Wake on receipt of a magic packet.
                                                                </p></dd><dt id="off"><span class="term">"<code class="literal">off</code>"</span><a class="headerlink" title="Permalink to this term" href="#off">¶</a></dt><dd><p>Never wake.</p></dd></dl></div></dd></dl></div></div><div class="refsect1"><a name="idm214167421376"></a><h2 id="Example">Example<a class="headerlink" title="Permalink to this headline" href="#Example">¶</a></h2><div class="example"><a name="idm214168941088"></a><p class="title"><b>Example 1. /etc/systemd/network/wireless.link</b></p><div class="example-contents"><pre class="programlisting">[Match]
MACAddress=12:34:56:78:9a:bc
Driver=brcmsmac
Path=pci-0000:02:00.0-*
Type=wlan
Virtualization=no
Host=my-laptop
Architecture=x86-64

[Link]
Name=wireless0
MTUBytes=1450
BitsPerSecond=10M
WakeOnLan=magic
MACAddress=cb:a9:87:65:43:21</pre></div></div><br class="example-break"></div><div class="refsect1"><a name="idm214168063536"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p>
                        <a href="systemd-udevd.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-udevd.service</span>(8)</span></a>,
                        <a href="udevadm.html"><span class="citerefentry"><span class="refentrytitle">udevadm</span>(8)</span></a>
                </p></div></div></body></html>