]> git.proxmox.com Git - systemd.git/blame - man/systemd.network.html
Imported Upstream version 217
[systemd.git] / man / systemd.network.html
CommitLineData
60f067b4
JS
1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>systemd.network</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
2 a.headerlink {
3 color: #c60f0f;
4 font-size: 0.8em;
5 padding: 0 4px 0 4px;
6 text-decoration: none;
7 visibility: hidden;
8 }
9
10 a.headerlink:hover {
11 background-color: #c60f0f;
12 color: white;
13 }
14
15 h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
16 visibility: visible;
17 }
18 </style><a href="index.html">Index </a>·
19 <a href="systemd.directives.html">Directives </a>·
20 <a href="../python-systemd/index.html">Python </a>·
21 <a href="../libudev/index.html">libudev </a>·
5eef597e 22 <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 217</span><hr><div class="refentry"><a name="systemd.network"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemd.network — Network configuration</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><p><code class="filename"><em class="replaceable"><code>network</code></em>.network</code></p></div><div class="refsect1"><a name="idm214174099744"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description">¶</a></h2><p>Network setup is performed by
60f067b4
JS
23 <a href="systemd-networkd.html"><span class="citerefentry"><span class="refentrytitle">systemd-networkd</span>(8)</span></a>.
24 </p><p>Network files must have the extension <code class="filename">.network</code>;
25 other extensions are ignored. Networks are applied to links whenever the links
26 appear.</p><p>The <code class="filename">.network</code> files are read from the files located in the
27 system network directory <code class="filename">/usr/lib/systemd/network</code>,
28 the volatile runtime network directory
29 <code class="filename">/run/systemd/network</code> and the local administration
30 network directory <code class="filename">/etc/systemd/network</code>.
31 All configuration files are collectively sorted and processed in lexical order,
32 regardless of the directories in which they live. However, files with
33 identical filenames replace each other. Files in
34 <code class="filename">/etc</code> have the highest priority, files in
35 <code class="filename">/run</code> take precedence over files with the same
36 name in <code class="filename">/usr/lib</code>. This can be used to override a
37 system-supplied configuration file with a local file if needed; a symlink in
38 <code class="filename">/etc</code> with the same name as a configuration file in
39 <code class="filename">/usr/lib</code>, pointing to <code class="filename">/dev/null</code>,
5eef597e 40 disables the configuration file entirely.</p></div><div class="refsect1"><a name="idm214177924016"></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>The network file contains a "<code class="literal">[Match]</code>" section,
60f067b4
JS
41 which determines if a given network file may be applied to a given device;
42 and a "<code class="literal">[Network]</code>" section specifying how the device should
43 be configured. The first (in lexical order) of the network files that
44 matches a given device is applied.</p><p>A network file is said to match a device if each of the entries in the
45 "<code class="literal">[Match]</code>" section matches, or if the section is empty.
46 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
47 property "<code class="literal">ID_PATH</code>". May contain shell
48 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
49 exposed by the udev property "<code class="literal">DRIVER</code>"
50 of its parent device, or if that is not set the driver
51 as exposed by "<code class="literal">ethtool -i</code>" of the
52 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
53 "<code class="literal">DEVTYPE</code>".</p></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 device name, as exposed by the udev property
54 "<code class="literal">INTERFACE</code>". May contain shell style
55 globs.</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
56 host. See "<code class="literal">ConditionHost=</code>" in
57 <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>
58 for details.
59 </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
60 environment and optionally test whether it is a specific
61 implementation. See "<code class="literal">ConditionVirtualization=</code>" in
62 <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>
63 for details.
64 </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
65 set (or if prefixed with the exclamation mark unset). See
66 "<code class="literal">ConditionKernelCommandLine=</code>" in
67 <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>
68 for details.
69 </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
70 architecture. See "<code class="literal">ConditionArchitecture=</code>" in
71 <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>
72 for details.
5eef597e 73 </p></dd></dl></div></div><div class="refsect1"><a name="idm214177961488"></a><h2 id="[Network] Section Options">[Network] Section Options<a class="headerlink" title="Permalink to this headline" href="#%5BNetwork%5D%20Section%20Options">¶</a></h2><p>The "<code class="literal">[Network]</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. This is only used for
e842803a
MB
74 presentation purposes.</p></dd><dt id="DHCP="><span class="term"><code class="varname">DHCP=</code></span><a class="headerlink" title="Permalink to this term" href="#DHCP=">¶</a></dt><dd><p>Enables DHCPv4 and/or DHCPv6 support. Accepts
75 "<code class="literal">both</code>", "<code class="literal">none</code>",
76 "<code class="literal">v4</code>" or "<code class="literal">v6</code>".</p></dd><dt id="DHCPServer="><span class="term"><code class="varname">DHCPServer=</code></span><a class="headerlink" title="Permalink to this term" href="#DHCPServer=">¶</a></dt><dd><p>A boolean. Enables a basic DHCPv4 server on the
77 device. Mostly useful for handing out leases to container
78 instances.</p></dd><dt id="IPv4LL="><span class="term"><code class="varname">IPv4LL=</code></span><a class="headerlink" title="Permalink to this term" href="#IPv4LL=">¶</a></dt><dd><p>A boolean. When true, enables IPv4 link-local support.
5eef597e
MP
79 </p></dd><dt id="IPv4LLRoute="><span class="term"><code class="varname">IPv4LLRoute=</code></span><a class="headerlink" title="Permalink to this term" href="#IPv4LLRoute=">¶</a></dt><dd><p>A boolean. When true, sets up the route needed for
80 non-IPv4LL hosts to communicate with IPv4LL-only hosts. Defaults
81 to false.
82 </p></dd><dt id="LLMNR="><span class="term"><code class="varname">LLMNR=</code></span><a class="headerlink" title="Permalink to this term" href="#LLMNR=">¶</a></dt><dd><p>A boolean or "<code class="literal">resolve</code>". When true, enables
83 Link-Local Multicast Name Resolution on the link, when set to
84 "<code class="literal">resolve</code>" only resolution is enabled, but not
85 announcement. Defaults to true.</p></dd><dt id="Address="><span class="term"><code class="varname">Address=</code></span><a class="headerlink" title="Permalink to this term" href="#Address=">¶</a></dt><dd><p>A static IPv4 or IPv6 address and its prefix length,
60f067b4
JS
86 separated by a "<code class="literal">/</code>" character. Specify this
87 key more than once to configure several addresses.
88 The format of the address must be as described in
89 <a href="inet_pton.html"><span class="citerefentry"><span class="refentrytitle">inet_pton</span>(3)</span></a>.
90 This is a short-hand for an [Address] section only containing
91 an Address key (see below). This option may be specified
92 more than once.
e842803a
MB
93 </p><p>If the specified
94 address is 0.0.0.0
95 (for IPv4) or [::]
96 (for IPv6), a new
97 address range of the
98 requested size is
99 automatically
100 allocated from a
101 system-wide pool of
102 unused ranges. The
103 allocated range is
104 checked against all
105 current network
106 interfaces and all
107 known network
108 configuration files to
109 avoid address range
110 conflicts. The default
111 system-wide pool
112 consists of
113 192.168.0.0/16,
114 172.16.0.0/12 and
115 10.0.0.0/8 for IPv4,
116 and fc00::/7 for
117 IPv6. This
118 functionality is
119 useful to manage a
120 large number of
121 dynamically created
122 network interfaces
123 with the same network
124 configuration and
125 automatic address
126 range
127 assignment.</p></dd><dt id="Gateway="><span class="term"><code class="varname">Gateway=</code></span><a class="headerlink" title="Permalink to this term" href="#Gateway=">¶</a></dt><dd><p>The gateway address, which must be in the format described in
60f067b4
JS
128 <a href="inet_pton.html"><span class="citerefentry"><span class="refentrytitle">inet_pton</span>(3)</span></a>.
129 This is a short-hand for a [Route] section only containing a Gateway
130 key. This option may be specified more than once.</p></dd><dt id="DNS="><span class="term"><code class="varname">DNS=</code></span><a class="headerlink" title="Permalink to this term" href="#DNS=">¶</a></dt><dd><p>A DNS server address, which must be in the format described in
131 <a href="inet_pton.html"><span class="citerefentry"><span class="refentrytitle">inet_pton</span>(3)</span></a>.
5eef597e 132 This option may be specified more than once.</p></dd><dt id="Domains="><span class="term"><code class="varname">Domains=</code></span><a class="headerlink" title="Permalink to this term" href="#Domains=">¶</a></dt><dd><p>The domains used for DNS resolution over this link.</p></dd><dt id="NTP="><span class="term"><code class="varname">NTP=</code></span><a class="headerlink" title="Permalink to this term" href="#NTP=">¶</a></dt><dd><p>An NTP server address. This option may be specified more than once.</p></dd><dt id="Bridge="><span class="term"><code class="varname">Bridge=</code></span><a class="headerlink" title="Permalink to this term" href="#Bridge=">¶</a></dt><dd><p>The name of the bridge to add the link to.</p></dd><dt id="Bond="><span class="term"><code class="varname">Bond=</code></span><a class="headerlink" title="Permalink to this term" href="#Bond=">¶</a></dt><dd><p>The name of the bond to add the link to.</p></dd><dt id="VLAN="><span class="term"><code class="varname">VLAN=</code></span><a class="headerlink" title="Permalink to this term" href="#VLAN=">¶</a></dt><dd><p>The name of a VLAN to create on the link. This option
60f067b4 133 may be specified more than once.</p></dd><dt id="MACVLAN="><span class="term"><code class="varname">MACVLAN=</code></span><a class="headerlink" title="Permalink to this term" href="#MACVLAN=">¶</a></dt><dd><p>The name of a MACVLAN to create on the link. This option
e842803a
MB
134 may be specified more than once.</p></dd><dt id="VXLAN="><span class="term"><code class="varname">VXLAN=</code></span><a class="headerlink" title="Permalink to this term" href="#VXLAN=">¶</a></dt><dd><p>The name of a VXLAN to create on the link. This option
135 may be specified more than once.</p></dd><dt id="Tunnel="><span class="term"><code class="varname">Tunnel=</code></span><a class="headerlink" title="Permalink to this term" href="#Tunnel=">¶</a></dt><dd><p>The name of a Tunnel to create on the link. This option
5eef597e 136 may be specified more than once.</p></dd></dl></div></div><div class="refsect1"><a name="idm214173296032"></a><h2 id="[Address] Section Options">[Address] Section Options<a class="headerlink" title="Permalink to this headline" href="#%5BAddress%5D%20Section%20Options">¶</a></h2><p>An "<code class="literal">[Address]</code>" section accepts the following keys.
60f067b4 137 Specify several "<code class="literal">[Address]</code>" sections to configure several
5eef597e
MP
138 addresses.</p><div class="variablelist"><dl class="variablelist"><dt id="Address="><span class="term"><code class="varname">Address=</code></span><a class="headerlink" title="Permalink to this term" href="#Address=">¶</a></dt><dd><p>As in the "<code class="literal">[Network]</code>" section. This key is mandatory.</p></dd><dt id="Peer="><span class="term"><code class="varname">Peer=</code></span><a class="headerlink" title="Permalink to this term" href="#Peer=">¶</a></dt><dd><p>The peer address in a point-to-point connection. Accepts the same format as
139 the "<code class="literal">Address</code>" key.</p></dd><dt id="Broadcast="><span class="term"><code class="varname">Broadcast=</code></span><a class="headerlink" title="Permalink to this term" href="#Broadcast=">¶</a></dt><dd><p>The broadcast address, which must be in the format described in
60f067b4
JS
140 <a href="inet_pton.html"><span class="citerefentry"><span class="refentrytitle">inet_pton</span>(3)</span></a>.
141 This key only applies to IPv4 addresses. If it is not given, it is
5eef597e 142 derived from the "<code class="literal">Address</code>" key.</p></dd><dt id="Label="><span class="term"><code class="varname">Label=</code></span><a class="headerlink" title="Permalink to this term" href="#Label=">¶</a></dt><dd><p>An address label.</p></dd></dl></div></div><div class="refsect1"><a name="idm214173283248"></a><h2 id="[Route] Section Options">[Route] Section Options<a class="headerlink" title="Permalink to this headline" href="#%5BRoute%5D%20Section%20Options">¶</a></h2><p>The "<code class="literal">[Route]</code>" section accepts the following keys. Specify
60f067b4 143 several "<code class="literal">[Route]</code>" sections to configure several routes.</p><div class="variablelist"><dl class="variablelist"><dt id="Gateway="><span class="term"><code class="varname">Gateway=</code></span><a class="headerlink" title="Permalink to this term" href="#Gateway=">¶</a></dt><dd><p>As in the "<code class="literal">[Network]</code>" section. This key is mandatory.</p></dd><dt id="Destination="><span class="term"><code class="varname">Destination=</code></span><a class="headerlink" title="Permalink to this term" href="#Destination=">¶</a></dt><dd><p>The destination prefix of the route. Possibly followed by a slash and the
5eef597e 144 prefixlength. If omitted, a full-length host route is assumed.</p></dd><dt id="Metric="><span class="term"><code class="varname">Metric=</code></span><a class="headerlink" title="Permalink to this term" href="#Metric=">¶</a></dt><dd><p>The metric of the route. An unsigned integer</p></dd></dl></div></div><div class="refsect1"><a name="idm214173274400"></a><h2 id="[DHCP] Section Options">[DHCP] Section Options<a class="headerlink" title="Permalink to this headline" href="#%5BDHCP%5D%20Section%20Options">¶</a></h2><p>The "<code class="literal">[DHCP]</code>" section accepts the following keys:</p><div class="variablelist"><dl class="variablelist"><dt id="UseDNS="><span class="term"><code class="varname">UseDNS=</code></span><a class="headerlink" title="Permalink to this term" href="#UseDNS=">¶</a></dt><dd><p>When true (the default), the DNS servers received from the DHCP server will
60f067b4 145 be used and take precedence over any statically configured ones.</p></dd><dt id="UseMTU="><span class="term"><code class="varname">UseMTU=</code></span><a class="headerlink" title="Permalink to this term" href="#UseMTU=">¶</a></dt><dd><p>When true, the interface maximum transmission unit from the DHCP server will
e842803a
MB
146 be used on the current link. Defaults to false.</p></dd><dt id="SendHostname="><span class="term"><code class="varname">SendHostname=</code></span><a class="headerlink" title="Permalink to this term" href="#SendHostname=">¶</a></dt><dd><p>When true (the default), the machine's hostname will be sent to the DHCP
147 server</p></dd><dt id="UseHostname="><span class="term"><code class="varname">UseHostname=</code></span><a class="headerlink" title="Permalink to this term" href="#UseHostname=">¶</a></dt><dd><p>When true (the default), the hostname received from the DHCP server
5eef597e
MP
148 will be used as the transient hostname.</p></dd><dt id="UseDomains="><span class="term"><code class="varname">UseDomains=</code></span><a class="headerlink" title="Permalink to this term" href="#UseDomains=">¶</a></dt><dd><p>When true (not the default), the domain name received from the DHCP server
149 will be used for DNS resolution over this link.</p></dd><dt id="UseRoutes="><span class="term"><code class="varname">UseRoutes=</code></span><a class="headerlink" title="Permalink to this term" href="#UseRoutes=">¶</a></dt><dd><p>When true (the default), the static routes will be requested from the DHCP server
e842803a 150 and added to the routing table with metric of 1024.</p></dd><dt id="CriticalConnection="><span class="term"><code class="varname">CriticalConnection=</code></span><a class="headerlink" title="Permalink to this term" href="#CriticalConnection=">¶</a></dt><dd><p>When true, the connection will never be torn down even if the DHCP lease
60f067b4 151 expires. This is contrary to the DHCP specification, but may be the best choice
5eef597e
MP
152 if, say, the root filesystem relies on this connection. Defaults to false.</p></dd><dt id="VendorClassIdentifier="><span class="term"><code class="varname">VendorClassIdentifier=</code></span><a class="headerlink" title="Permalink to this term" href="#VendorClassIdentifier=">¶</a></dt><dd><p>The vendor class identifier used to identify vendor type and configuration.</p></dd><dt id="RequestBroadcast="><span class="term"><code class="varname">RequestBroadcast=</code></span><a class="headerlink" title="Permalink to this term" href="#RequestBroadcast=">¶</a></dt><dd><p>Request the server to use broadcast messages before the IP address has been
153 configured. This is necessary for devices that cannot receive RAW packets, or that
154 cannot receive packets at all before an IP address has been configured. On the other
155 hand, this must not be enabled on networks where broadcasts are filtered out.</p></dd><dt id="RouteMetric="><span class="term"><code class="varname">RouteMetric=</code></span><a class="headerlink" title="Permalink to this term" href="#RouteMetric=">¶</a></dt><dd><p>Set the routing metric for routes specified by the DHCP server.</p></dd></dl></div></div><div class="refsect1"><a name="idm214173253344"></a><h2 id="Example">Example<a class="headerlink" title="Permalink to this headline" href="#Example">¶</a></h2><div class="example"><a name="idm214173252704"></a><p class="title"><b>Example 1. /etc/systemd/network/50-static.network</b></p><div class="example-contents"><pre class="programlisting">[Match]
60f067b4
JS
156Name=enp2s0
157
158[Network]
159Address=192.168.0.15/24
5eef597e 160Gateway=192.168.0.1</pre></div></div><br class="example-break"><div class="example"><a name="idm214173251216"></a><p class="title"><b>Example 2. /etc/systemd/network/80-dhcp.network</b></p><div class="example-contents"><pre class="programlisting">[Match]
60f067b4
JS
161Name=en*
162
163[Network]
5eef597e 164DHCP=both</pre></div></div><br class="example-break"><div class="example"><a name="idm214173249824"></a><p class="title"><b>Example 3. /etc/systemd/network/bridge-static.network</b></p><div class="example-contents"><pre class="programlisting">[Match]
60f067b4
JS
165Name=bridge0
166
167[Network]
168Address=192.168.0.15/24
169Gateway=192.168.0.1
5eef597e 170DNS=192.168.0.1</pre></div></div><br class="example-break"><div class="example"><a name="idm214173248320"></a><p class="title"><b>Example 4. /etc/systemd/network/bridge-slave-interface.network</b></p><div class="example-contents"><pre class="programlisting">[Match]
60f067b4
JS
171Name=enp2s0
172
173[Network]
5eef597e 174Bridge=bridge0</pre></div></div><br class="example-break"><div class="example"><a name="idm214173246928"></a><p class="title"><b>Example 5. /etc/systemd/network/ipip.network</b></p><div class="example-contents"><pre class="programlisting">[Match]
e842803a
MB
175Name=em1
176
177[Network]
5eef597e 178Tunnel=ipip-tun</pre></div></div><br class="example-break"><div class="example"><a name="idm214173245536"></a><p class="title"><b>Example 6. /etc/systemd/network/sit.network</b></p><div class="example-contents"><pre class="programlisting">[Match]
e842803a
MB
179Name=em1
180
181[Network]
5eef597e 182Tunnel=sit-tun</pre></div></div><br class="example-break"><div class="example"><a name="idm214173244144"></a><p class="title"><b>Example 7. /etc/systemd/network/gre.network</b></p><div class="example-contents"><pre class="programlisting">[Match]
e842803a
MB
183Name=em1
184
185[Network]
5eef597e 186Tunnel=gre-tun</pre></div></div><br class="example-break"><div class="example"><a name="idm214173242752"></a><p class="title"><b>Example 8. /etc/systemd/network/vti.network</b></p><div class="example-contents"><pre class="programlisting">[Match]
e842803a
MB
187Name=em1
188
189[Network]
5eef597e 190Tunnel=vti-tun</pre></div></div><br class="example-break"></div><div class="refsect1"><a name="idm214173241232"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p>
60f067b4
JS
191 <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
192 <a href="systemd-networkd.html"><span class="citerefentry"><span class="refentrytitle">systemd-networkd</span>(8)</span></a>,
193 <a href="systemd.netdev.html"><span class="citerefentry"><span class="refentrytitle">systemd.netdev</span>(5)</span></a>
194 </p></div></div></body></html>