chiark / gitweb /
man: busctl typo fix
[elogind.git] / man / systemd-networkd.service.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3         "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5 <!--
6   This file is part of systemd.
7
8   Copyright 2013 Tom Gundersen
9
10   systemd is free software; you can redistribute it and/or modify it
11   under the terms of the GNU Lesser General Public License as published by
12   the Free Software Foundation; either version 2.1 of the License, or
13   (at your option) any later version.
14
15   systemd is distributed in the hope that it will be useful, but
16   WITHOUT ANY WARRANTY; without even the implied warranty of
17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18   Lesser General Public License for more details.
19
20   You should have received a copy of the GNU Lesser General Public License
21   along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 -->
23
24 <refentry id="systemd-networkd.service" conditional='ENABLE_NETWORKD'>
25
26         <refentryinfo>
27                 <title>systemd-networkd.service</title>
28                 <productname>systemd</productname>
29
30                 <authorgroup>
31                         <author>
32                                 <contrib>Developer</contrib>
33                                 <firstname>Tom</firstname>
34                                 <surname>Gundersen</surname>
35                                 <email>teg@jklm.no</email>
36                         </author>
37                 </authorgroup>
38         </refentryinfo>
39
40         <refmeta>
41                 <refentrytitle>systemd-networkd.service</refentrytitle>
42                 <manvolnum>8</manvolnum>
43         </refmeta>
44
45         <refnamediv>
46                 <refname>systemd-networkd.service</refname>
47                 <refname>systemd-networkd</refname>
48                 <refpurpose>Network manager</refpurpose>
49         </refnamediv>
50
51         <refsynopsisdiv>
52                 <para><filename>systemd-networkd.service</filename></para>
53                 <para><filename>/usr/lib/systemd/systemd-networkd</filename></para>
54         </refsynopsisdiv>
55
56         <refsect1>
57                 <title>Description</title>
58
59                 <para><command>systemd-networkd</command> is a system
60                 service that manages networks. It detects and configures
61                 network devices as they appear, as well as creating virtual
62                 network devices.</para>
63
64                 <para>To configure low-level link settings independently of
65                 networks, see
66                 <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>
67                 .</para>
68
69                 <para>Network configurations applied before networkd is started
70                 are not removed, and static configuration applied by networkd
71                 are not removed when networkd exits. This ensures restarting
72                 networkd does not cut the network connection, and, in particular,
73                 that it is safe to transition between the initrd and the real root,
74                 and back.</para>
75         </refsect1>
76
77         <refsect1><title>Configuration Files</title>
78                 <para>The configuration files are read from the files located in the
79                 system network directory <filename>/usr/lib/systemd/network</filename>,
80                 the volatile runtime network directory
81                 <filename>/run/systemd/network</filename> and the local administration
82                 network directory <filename>/etc/systemd/network</filename>.
83                 All configuration files are collectively sorted and processed in lexical order,
84                 regardless of the directories in which they live. However, files with
85                 identical filenames replace each other. Files in
86                 <filename>/etc</filename> have the highest priority, files in
87                 <filename>/run</filename> take precedence over files with the same
88                 name in <filename>/usr/lib</filename>. This can be used to override a
89                 system-supplied configuration file with a local file if needed; a symlink in
90                 <filename>/etc</filename> with the same name as a configuration file in
91                 <filename>/usr/lib</filename>, pointing to <filename>/dev/null</filename>,
92                 disables the configuration file entirely.</para>
93
94                 <refsect2><title>Virtual Network Devices</title>
95                         <para>Virtual Network Device files must have the extension
96                         <filename>.netdev</filename>; other extensions are ignored. Virtual
97                         network devices are created as soon as networkd is started.</para>
98
99                         <para>The <literal>[NetDev]</literal> section accepts the following
100                         keys:</para>
101
102                         <variablelist class='network-directives'>
103                                 <varlistentry>
104                                         <term><varname>Name</varname></term>
105                                         <listitem>
106                                                 <para>The interface name used when creating the
107                                                 bridge. This option is compulsory.</para>
108                                         </listitem>
109                                 </varlistentry>
110                                 <varlistentry>
111                                         <term><varname>Kind</varname></term>
112                                         <listitem>
113                                                 <para>The netdev kind. Currently, <literal>bridge</literal>,
114                                                 <literal>bond</literal> and <literal>vlan</literal>
115                                                 are supported. This option is compulsory.</para>
116                                         </listitem>
117                                 </varlistentry>
118                         </variablelist>
119
120                         <para>The <literal>[VLAN]</literal> section only applies for netdevs of kind <literal>vlan</literal>,
121                         and accepts the following key:</para>
122
123                         <variablelist class='network-directives'>
124                                 <varlistentry>
125                                         <term><varname>Id</varname></term>
126                                         <listitem>
127                                                 <para>The VLAN ID to use. An integer in the range 0–4094.
128                                                 This option is compulsory.</para>
129                                         </listitem>
130                                 </varlistentry>
131                         </variablelist>
132
133                 </refsect2>
134
135                 <refsect2><title>Networks</title>
136                         <para>Network files must have the extension <filename>.network</filename>;
137                         other extensions are ignored. Networks are applied to links whenever the links
138                         appear.</para>
139
140                         <para>The network file contains a <literal>[Match]</literal> section,
141                         which determines if a given network file may be applied to a given device;
142                         and a <literal>[Network]</literal> section specifying how the device should
143                         be configured. The first (in lexical order) of the network files that
144                         matches a given device is applied.</para>
145
146                         <para>A network file is said to match a device if each of the entries in the
147                         <literal>[Match]</literal> section matches, or if the section is empty.
148                         The following keys are accepted:</para>
149
150                         <variablelist class='network-directives'>
151                                 <varlistentry>
152                                         <term><varname>MACAddress</varname></term>
153                                         <listitem>
154                                                 <para>The hardware address.</para>
155                                         </listitem>
156                                 </varlistentry>
157                                 <varlistentry>
158                                         <term><varname>Path</varname></term>
159                                         <listitem>
160                                                 <para>The persistent path, as exposed by the udev
161                                                 property <literal>ID_PATH</literal>.</para>
162                                         </listitem>
163                                 </varlistentry>
164                                 <varlistentry>
165                                         <term><varname>Driver</varname></term>
166                                         <listitem>
167                                                 <para>The driver currently bound to the device, as
168                                                 exposed by the udev property <literal>DRIVER</literal>
169                                                 of its parent device.
170                                                 </para>
171                                         </listitem>
172                                 </varlistentry>
173                                 <varlistentry>
174                                         <term><varname>Type</varname></term>
175                                         <listitem>
176                                                 <para>The device type, as exposed by the udev property
177                                                 <literal>DEVTYPE</literal>.</para>
178                                         </listitem>
179                                 </varlistentry>
180                                 <varlistentry>
181                                         <term><varname>Name</varname></term>
182                                         <listitem>
183                                                 <para>The device name, as exposed by the udev property
184                                                 <literal>INTERFACE</literal>.</para>
185                                         </listitem>
186                                 </varlistentry>
187                         </variablelist>
188
189                         <para>The <literal>[Network]</literal> section accepts the following keys:</para>
190
191                         <variablelist class='network-directives'>
192                                 <varlistentry>
193                                         <term><varname>Description</varname></term>
194                                         <listitem>
195                                                 <para>A description of the device. This is only used for
196                                                 presentation purposes.</para>
197                                         </listitem>
198                                 </varlistentry>
199                                 <varlistentry>
200                                         <term><varname>DHCP</varname></term>
201                                         <listitem>
202                                                 <para>A boolean. When true, enables basic DHCPv4 support.</para>
203                                         </listitem>
204                                 </varlistentry>
205                                 <varlistentry>
206                                         <term><varname>Address</varname></term>
207                                         <listitem>
208                                                 <para>A static IPv4 or IPv6 address and its prefix length,
209                                                 separated by a <literal>/</literal> character. The format of the address must
210                                                 be as described in
211                                                 <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>
212                                                 . This is a short-hand for an [Address] section only containing an Address key (see below).</para>
213                                         </listitem>
214                                 </varlistentry>
215                                 <varlistentry>
216                                         <term><varname>Gateway</varname></term>
217                                         <listitem>
218                                                 <para>The gateway address, which must be in the format described in
219                                                 <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>
220                                                 . This is a short-hand for a [Route] section only containing a Gateway key.</para>
221                                         </listitem>
222                                 </varlistentry>
223                                 <varlistentry>
224                                         <term><varname>DNS</varname></term>
225                                         <listitem>
226                                                 <para>A DNS server address, which must be in the format described in
227                                                 <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>
228                                                 .</para>
229                                         </listitem>
230                                 </varlistentry>
231                                 <varlistentry>
232                                         <term><varname>Bridge</varname></term>
233                                         <listitem>
234                                                 <para>The name of the bridge to add the link to.</para>
235                                         </listitem>
236                                 </varlistentry>
237                                 <varlistentry>
238                                         <term><varname>Bond</varname></term>
239                                         <listitem>
240                                                 <para>The name of the bond to add the link to.</para>
241                                         </listitem>
242                                 </varlistentry>
243                                 <varlistentry>
244                                         <term><varname>VLAN</varname></term>
245                                         <listitem>
246                                                 <para>The name of a VLAN to create on the link. This option
247                                                 may be specified more than once.</para>
248                                         </listitem>
249                                 </varlistentry>
250                         </variablelist>
251
252                         <para>The <literal>[Address]</literal> section accepts the following keys:</para>
253
254                         <variablelist class='network-directives'>
255                                 <varlistentry>
256                                         <term><varname>Address</varname></term>
257                                         <listitem>
258                                                 <para>As in the <literal>[Network]</literal> section. This key is mandatory.</para>
259                                         </listitem>
260                                 </varlistentry>
261                                 <varlistentry>
262                                         <term><varname>Broadcast</varname></term>
263                                         <listitem>
264                                                 <para>The broadcast address, which must be in the format described in
265                                                 <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>
266                                                 . This key only applies to IPv4 addresses. If it is not given, it is
267                                                 derived from the <literal>Address</literal> key.</para>
268                                         </listitem>
269                                 </varlistentry>
270                                 <varlistentry>
271                                         <term><varname>Label</varname></term>
272                                         <listitem>
273                                                 <para>An address label.</para>
274                                         </listitem>
275                                 </varlistentry>
276                         </variablelist>
277
278                         <para>The <literal>[Route]</literal> section accepts the following keys:</para>
279
280                         <variablelist class='network-directives'>
281                                 <varlistentry>
282                                         <term><varname>Gateway</varname></term>
283                                         <listitem>
284                                                 <para>As in the <literal>[Network]</literal> section. This key is mandatory.</para>
285                                         </listitem>
286                                 </varlistentry>
287                                 <varlistentry>
288                                         <term><varname>Destination</varname></term>
289                                         <listitem>
290                                                 <para>The destination prefix of the route. Possibly followed by a slash and the
291                                                 prefixlength, if ommitted a full-length host route is assumed.</para>
292                                         </listitem>
293                                 </varlistentry>
294                         </variablelist>
295
296                         <para>The <literal>[DHCPv4]</literal> section accepts the following keys:</para>
297
298                         <variablelist class='network-directives'>
299                                 <varlistentry>
300                                         <term><varname>UseDNS</varname></term>
301                                         <listitem>
302                                                 <para>When true (the default), the DNS servers received from the DHCP server will
303                                                 be used and take precedence over any statically configured ones.</para>
304                                         </listitem>
305                                 </varlistentry>
306                                 <varlistentry>
307                                         <term><varname>UseMTU</varname></term>
308                                         <listitem>
309                                                 <para>When true, the interface maximum transmission unit from the DHCP server will
310                                                 be used on the current link. Defaults to false.</para>
311                                         </listitem>
312                                 </varlistentry>
313                                 <varlistentry>
314                                         <term><varname>UseHostname</varname></term>
315                                         <listitem>
316                                                 <para>When true (the default), the hostname received from the DHCP server
317                                                 will be used as the transient hostname.</para>
318                                         </listitem>
319                                 </varlistentry>
320                                 <varlistentry>
321                                         <term><varname>CriticalConnection</varname></term>
322                                         <listitem>
323                                                 <para>When true, the connection will never be torn down even if the DHCP lease
324                                                 expires. This is contrary to the DHCP specification, but may be the best choice
325                                                 if, say, the root filesystem relies on this connection. Defaults to false.</para>
326                                         </listitem>
327                                 </varlistentry>
328                        </variablelist>
329
330                 </refsect2>
331         </refsect1>
332
333         <refsect1>
334                 <title>See Also</title>
335                 <para>
336                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
337                         <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
338                 </para>
339         </refsect1>
340
341 </refentry>