chiark / gitweb /
3e6fddc7165ce70e35cc6dc57b74ad48725bc178
[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>Network configurations applied before networkd is started
65                 are not removed, and configuration applied by networkd are not
66                 removed when networkd exits. This ensures restarting networkd
67                 does not cut the network connection, and, in particular, that
68                 it is safe to transition between the initrd and the real root,
69                 and back.</para>
70         </refsect1>
71
72         <refsect1><title>Configuration Files</title>
73                 <para>The configuration files are read from the files located in the
74                 system network directory <filename>/usr/lib/systemd/network</filename>,
75                 the volatile runtime network directory
76                 <filename>/run/systemd/network</filename> and the local administration
77                 network directory <filename>/etc/systemd/network</filename>.
78                 All configuration files are collectively sorted and processed in lexical order,
79                 regardless of the directories in which they live. However, files with
80                 identical filenames replace each other. Files in
81                 <filename>/etc</filename> have the highest priority, files in
82                 <filename>/run</filename> take precedence over files with the same
83                 name in <filename>/usr/lib</filename>. This can be used to override a
84                 system-supplied configuration file with a local file if needed; a symlink in
85                 <filename>/etc</filename> with the same name as a configuration file in
86                 <filename>/usr/lib</filename>, pointing to <filename>/dev/null</filename>,
87                 disables the configuration file entirely.</para>
88
89                 <refsect2><title>Virtual Network Devices</title>
90                         <para>Netdev files must have the extension <filename>.netdev</filename>;
91                         other extensions are ignored. Virtual network devices are created as soon
92                         as networkd is started.</para>
93
94                         <para>The <literal>[Netdev]</literal> section accepts the following
95                         keys:</para>
96
97                         <variablelist class='network-directives'>
98                                 <varlistentry>
99                                         <term><varname>Name</varname></term>
100                                         <listitem>
101                                                 <para>The interface name used when creating the
102                                                 bridge. This option is compulsory.</para>
103                                         </listitem>
104                                 </varlistentry>
105                                 <varlistentry>
106                                         <term><varname>Kind</varname></term>
107                                         <listitem>
108                                                 <para>The netdev kind. Currently, 'bridge', 'bond' and 'vlan'
109                                                 are supported. This option is compulsory.</para>
110                                         </listitem>
111                                 </varlistentry>
112                         </variablelist>
113
114                         <para>The <literal>[VLAN]</literal> section only applies for netdevs of kind 'vlan',
115                         and accepts the following keys:</para>
116
117                         <variablelist class='network-directives'>
118                                 <varlistentry>
119                                         <term><varname>Id</varname></term>
120                                         <listitem>
121                                                 <para>The VLAN ID to use. This option is compulsory.</para>
122                                         </listitem>
123                                 </varlistentry>
124                         </variablelist>
125
126                 </refsect2>
127
128                 <refsect2><title>Networks</title>
129                         <para>Network files must have the extension <filename>.network</filename>;
130                         other extensions are ignored. Networks are applied to links whenever the links
131                         appear.</para>
132
133                         <para>The network file contains a <literal>[Match]</literal> section,
134                         which determines if a given network file may be applied to a given device;
135                         and a <literal>[Network]</literal> section specifying how the device should
136                         be configured. The first (in lexical order) of the network files that
137                         matches a given device is applied.</para>
138
139                         <para>A network file is said to match a device if each of the entries in the
140                         <literal>[Match]</literal> section matches, or if the section is empty.
141                         The following keys are accepted:</para>
142
143                         <variablelist class='network-directives'>
144                                 <varlistentry>
145                                         <term><varname>MACAddress</varname></term>
146                                         <listitem>
147                                                 <para>The hardware address.</para>
148                                         </listitem>
149                                 </varlistentry>
150                                 <varlistentry>
151                                         <term><varname>Path</varname></term>
152                                         <listitem>
153                                                 <para>The persistent path, as exposed by the udev
154                                                 property <literal>ID_PATH</literal>.</para>
155                                         </listitem>
156                                 </varlistentry>
157                                 <varlistentry>
158                                         <term><varname>Driver</varname></term>
159                                         <listitem>
160                                                 <para>The driver currently bound to the device, as
161                                                 exposed by the udev property <literal>DRIVER</literal>.
162                                                 </para>
163                                         </listitem>
164                                 </varlistentry>
165                                 <varlistentry>
166                                         <term><varname>Type</varname></term>
167                                         <listitem>
168                                                 <para>The device type, as exposed by the udev property
169                                                 <literal>DEVTYPE</literal>.</para>
170                                         </listitem>
171                                 </varlistentry>
172                                 <varlistentry>
173                                         <term><varname>Name</varname></term>
174                                         <listitem>
175                                                 <para>The device name, as exposed by the udev property
176                                                 <literal>INTERFACE</literal>.</para>
177                                         </listitem>
178                                 </varlistentry>
179                         </variablelist>
180
181                         <para>The <literal>[Network]</literal> section accepts the following keys:</para>
182
183                         <variablelist class='network-directives'>
184                                 <varlistentry>
185                                         <term><varname>Description</varname></term>
186                                         <listitem>
187                                                 <para>A description of the device. This is only used for
188                                                 presentation purposes.</para>
189                                         </listitem>
190                                 </varlistentry>
191                                 <varlistentry>
192                                         <term><varname>DHCP</varname></term>
193                                         <listitem>
194                                                 <para>A boolean. When true enables basic DHCPv4 support.</para>
195                                         </listitem>
196                                 </varlistentry>
197                                 <varlistentry>
198                                         <term><varname>Address</varname></term>
199                                         <listitem>
200                                                 <para>A static IPv4 or IPv6 address and its prefix length,
201                                                 separated by a '/' character. The format of the address must
202                                                 be as described in
203                                                 <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>
204                                                 . This is a short-hand for an [Address] section only containing an Address key (see below).</para>
205                                         </listitem>
206                                 </varlistentry>
207                                 <varlistentry>
208                                         <term><varname>Gateway</varname></term>
209                                         <listitem>
210                                                 <para>The gateway address, which must be in the format described in
211                                                 <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>
212                                                 . This is a short-hand for a [Route] section only containing a Gateway key.</para>
213                                         </listitem>
214                                 </varlistentry>
215                                 <varlistentry>
216                                         <term><varname>DNS</varname></term>
217                                         <listitem>
218                                                 <para>A DNS server address, which must be in the format described in
219                                                 <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>
220                                                 .</para>
221                                         </listitem>
222                                 </varlistentry>
223                                 <varlistentry>
224                                         <term><varname>Bridge</varname></term>
225                                         <listitem>
226                                                 <para>The name of the bridge to add the configured link to.</para>
227                                         </listitem>
228                                 </varlistentry>
229                                 <varlistentry>
230                                         <term><varname>Bond</varname></term>
231                                         <listitem>
232                                                 <para>The name of the bond to add the configured link to.</para>
233                                         </listitem>
234                                 </varlistentry>
235                         </variablelist>
236
237                         <para>The <literal>[Address]</literal> section accepts the following keys:</para>
238
239                         <variablelist class='network-directives'>
240                                 <varlistentry>
241                                         <term><varname>Address</varname></term>
242                                         <listitem>
243                                                 <para>As in the <literal>[Network]</literal> section. This key is mandatory.</para>
244                                         </listitem>
245                                 </varlistentry>
246                                 <varlistentry>
247                                         <term><varname>Label</varname></term>
248                                         <listitem>
249                                                 <para>An address label.</para>
250                                         </listitem>
251                                 </varlistentry>
252                         </variablelist>
253
254                         <para>The <literal>[Route]</literal> section accepts the following keys:</para>
255
256                         <variablelist class='network-directives'>
257                                 <varlistentry>
258                                         <term><varname>Gateway</varname></term>
259                                         <listitem>
260                                                 <para>As in the <literal>[Network]</literal> section. This key is mandatory.</para>
261                                         </listitem>
262                                 </varlistentry>
263                                 <varlistentry>
264                                         <term><varname>Destination</varname></term>
265                                         <listitem>
266                                                 <para>The destination prefix of the route. Possibly followed by a slash and the
267                                                 prefixlength, if ommitted a full-length host route is assumed.</para>
268                                         </listitem>
269                                 </varlistentry>
270                         </variablelist>
271
272                         <para>The <literal>[DHCPv4]</literal> section accepts the following keys:</para>
273
274                         <variablelist class='network-directives'>
275                                 <varlistentry>
276                                         <term><varname>UseDNS</varname></term>
277                                         <listitem>
278                                                 <para>When true (the default) the DNS servers received from the DHCP server will
279                                                 be used, and take precedence over any statically configured ones.</para>
280                                         </listitem>
281                                 </varlistentry>
282                                 <varlistentry>
283                                         <term><varname>UseMTU</varname></term>
284                                         <listitem>
285                                                 <para>When true the interface maximum transmission unit from the DHCP server will
286                                                 be used on the current link. Defaults to false.</para>
287                                         </listitem>
288                                 </varlistentry>
289                                 <varlistentry>
290                                         <term><varname>UseHostname</varname></term>
291                                         <listitem>
292                                                 <para>When true (the default) the hostname received from the DHCP server
293                                                 will be used as the transient hostname.</para>
294                                         </listitem>
295                                 </varlistentry>
296                                 <varlistentry>
297                                         <term><varname>CriticalConnection</varname></term>
298                                         <listitem>
299                                                 <para>When true the connection will never be torn down even if the DHCP lease
300                                                 expires. This is contrary to the DHCP specification, but may be the best choice
301                                                 if, say, the root filesystem relies on this connection. Defaults to false.</para>
302                                         </listitem>
303                                 </varlistentry>
304                        </variablelist>
305
306                 </refsect2>
307         </refsect1>
308
309         <refsect1>
310                 <title>See Also</title>
311                 <para>
312                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
313                         <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
314                 </para>
315         </refsect1>
316
317 </refentry>