chiark / gitweb /
man: xinclude --help/--version/--no-pager
[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>A virtual network device is only created if the
100                         <literal>[Match]</literal> section matches the current
101                         environment, or if the section is empty. The following keys are accepted:</para>
102
103                         <variablelist class='network-directives'>
104                                 <varlistentry>
105                                         <term><varname>Host</varname></term>
106                                         <listitem>
107                                                 <para>Matches against the hostname or machine ID of the
108                                                 host. See <literal>ConditionHost=</literal> in
109                                                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
110                                                 for details.
111                                                 </para>
112                                         </listitem>
113                                 </varlistentry>
114                                 <varlistentry>
115                                         <term><varname>Virtualization</varname></term>
116                                         <listitem>
117                                                 <para>Checks whether the system is executed in a virtualized
118                                                 environment and optionally test whether it is a specific
119                                                 implementation. See <literal>ConditionVirtualization=</literal> in
120                                                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
121                                                 for details.
122                                                 </para>
123                                         </listitem>
124                                 </varlistentry>
125                                 <varlistentry>
126                                         <term><varname>KernelCommandLine</varname></term>
127                                         <listitem>
128                                                 <para>Checks whether a specific kernel command line option is
129                                                 set (or if prefixed with the exclamation mark unset). See
130                                                 <literal>ConditionKernelCommandLine=</literal> in
131                                                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
132                                                 for details.
133                                                 </para>
134                                         </listitem>
135                                 </varlistentry>
136                         </variablelist>
137
138                         <para>The <literal>[NetDev]</literal> section accepts the following
139                         keys:</para>
140
141                         <variablelist class='network-directives'>
142                                 <varlistentry>
143                                         <term><varname>Name</varname></term>
144                                         <listitem>
145                                                 <para>The interface name used when creating the
146                                                 bridge. This option is compulsory.</para>
147                                         </listitem>
148                                 </varlistentry>
149                                 <varlistentry>
150                                         <term><varname>Kind</varname></term>
151                                         <listitem>
152                                                 <para>The netdev kind. Currently, <literal>bridge</literal>,
153                                                 <literal>bond</literal> and <literal>vlan</literal>
154                                                 are supported. This option is compulsory.</para>
155                                         </listitem>
156                                 </varlistentry>
157                         </variablelist>
158
159                         <para>The <literal>[VLAN]</literal> section only applies for netdevs of kind <literal>vlan</literal>,
160                         and accepts the following key:</para>
161
162                         <variablelist class='network-directives'>
163                                 <varlistentry>
164                                         <term><varname>Id</varname></term>
165                                         <listitem>
166                                                 <para>The VLAN ID to use. An integer in the range 0–4094.
167                                                 This option is compulsory.</para>
168                                         </listitem>
169                                 </varlistentry>
170                         </variablelist>
171
172                 </refsect2>
173
174                 <refsect2><title>Networks</title>
175                         <para>Network files must have the extension <filename>.network</filename>;
176                         other extensions are ignored. Networks are applied to links whenever the links
177                         appear.</para>
178
179                         <para>The network file contains a <literal>[Match]</literal> section,
180                         which determines if a given network file may be applied to a given device;
181                         and a <literal>[Network]</literal> section specifying how the device should
182                         be configured. The first (in lexical order) of the network files that
183                         matches a given device is applied.</para>
184
185                         <para>A network file is said to match a device if each of the entries in the
186                         <literal>[Match]</literal> section matches, or if the section is empty.
187                         The following keys are accepted:</para>
188
189                         <variablelist class='network-directives'>
190                                 <varlistentry>
191                                         <term><varname>MACAddress</varname></term>
192                                         <listitem>
193                                                 <para>The hardware address.</para>
194                                         </listitem>
195                                 </varlistentry>
196                                 <varlistentry>
197                                         <term><varname>Path</varname></term>
198                                         <listitem>
199                                                 <para>The persistent path, as exposed by the udev
200                                                 property <literal>ID_PATH</literal>. May contain shell
201                                                 style globs.</para>
202                                         </listitem>
203                                 </varlistentry>
204                                 <varlistentry>
205                                         <term><varname>Driver</varname></term>
206                                         <listitem>
207                                                 <para>The driver currently bound to the device, as
208                                                 exposed by the udev property <literal>DRIVER</literal>
209                                                 of its parent device.
210                                                 </para>
211                                         </listitem>
212                                 </varlistentry>
213                                 <varlistentry>
214                                         <term><varname>Type</varname></term>
215                                         <listitem>
216                                                 <para>The device type, as exposed by the udev property
217                                                 <literal>DEVTYPE</literal>.</para>
218                                         </listitem>
219                                 </varlistentry>
220                                 <varlistentry>
221                                         <term><varname>Name</varname></term>
222                                         <listitem>
223                                                 <para>The device name, as exposed by the udev property
224                                                 <literal>INTERFACE</literal>. May contain shell style
225                                                 globs.</para>
226                                         </listitem>
227                                 </varlistentry>
228                                 <varlistentry>
229                                         <term><varname>Host</varname></term>
230                                         <listitem>
231                                                 <para>Matches against the hostname or machine ID of the
232                                                 host. See <literal>ConditionHost=</literal> in
233                                                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
234                                                 for details.
235                                                 </para>
236                                         </listitem>
237                                 </varlistentry>
238                                 <varlistentry>
239                                         <term><varname>Virtualization</varname></term>
240                                         <listitem>
241                                                 <para>Checks whether the system is executed in a virtualized
242                                                 environment and optionally test whether it is a specific
243                                                 implementation. See <literal>ConditionVirtualization=</literal> in
244                                                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
245                                                 for details.
246                                                 </para>
247                                         </listitem>
248                                 </varlistentry>
249                                 <varlistentry>
250                                         <term><varname>KernelCommandLine</varname></term>
251                                         <listitem>
252                                                 <para>Checks whether a specific kernel command line option is
253                                                 set (or if prefixed with the exclamation mark unset). See
254                                                 <literal>ConditionKernelCommandLine=</literal> in
255                                                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
256                                                 for details.
257                                                 </para>
258                                         </listitem>
259                                 </varlistentry>
260                         </variablelist>
261
262                         <para>The <literal>[Network]</literal> section accepts the following keys:</para>
263
264                         <variablelist class='network-directives'>
265                                 <varlistentry>
266                                         <term><varname>Description</varname></term>
267                                         <listitem>
268                                                 <para>A description of the device. This is only used for
269                                                 presentation purposes.</para>
270                                         </listitem>
271                                 </varlistentry>
272                                 <varlistentry>
273                                         <term><varname>DHCP</varname></term>
274                                         <listitem>
275                                                 <para>A boolean. When true, enables basic DHCPv4 support.</para>
276                                         </listitem>
277                                 </varlistentry>
278                                 <varlistentry>
279                                         <term><varname>Address</varname></term>
280                                         <listitem>
281                                                 <para>A static IPv4 or IPv6 address and its prefix length,
282                                                 separated by a <literal>/</literal> character. The format of the address must
283                                                 be as described in
284                                                 <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>
285                                                 . This is a short-hand for an [Address] section only containing an Address key (see below).</para>
286                                         </listitem>
287                                 </varlistentry>
288                                 <varlistentry>
289                                         <term><varname>Gateway</varname></term>
290                                         <listitem>
291                                                 <para>The gateway address, which must be in the format described in
292                                                 <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>
293                                                 . This is a short-hand for a [Route] section only containing a Gateway key.</para>
294                                         </listitem>
295                                 </varlistentry>
296                                 <varlistentry>
297                                         <term><varname>DNS</varname></term>
298                                         <listitem>
299                                                 <para>A DNS server address, which must be in the format described in
300                                                 <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>
301                                                 .</para>
302                                         </listitem>
303                                 </varlistentry>
304                                 <varlistentry>
305                                         <term><varname>Bridge</varname></term>
306                                         <listitem>
307                                                 <para>The name of the bridge to add the link to.</para>
308                                         </listitem>
309                                 </varlistentry>
310                                 <varlistentry>
311                                         <term><varname>Bond</varname></term>
312                                         <listitem>
313                                                 <para>The name of the bond to add the link to.</para>
314                                         </listitem>
315                                 </varlistentry>
316                                 <varlistentry>
317                                         <term><varname>VLAN</varname></term>
318                                         <listitem>
319                                                 <para>The name of a VLAN to create on the link. This option
320                                                 may be specified more than once.</para>
321                                         </listitem>
322                                 </varlistentry>
323                         </variablelist>
324
325                         <para>The <literal>[Address]</literal> section accepts the following keys:</para>
326
327                         <variablelist class='network-directives'>
328                                 <varlistentry>
329                                         <term><varname>Address</varname></term>
330                                         <listitem>
331                                                 <para>As in the <literal>[Network]</literal> section. This key is mandatory.</para>
332                                         </listitem>
333                                 </varlistentry>
334                                 <varlistentry>
335                                         <term><varname>Broadcast</varname></term>
336                                         <listitem>
337                                                 <para>The broadcast address, which must be in the format described in
338                                                 <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>
339                                                 . This key only applies to IPv4 addresses. If it is not given, it is
340                                                 derived from the <literal>Address</literal> key.</para>
341                                         </listitem>
342                                 </varlistentry>
343                                 <varlistentry>
344                                         <term><varname>Label</varname></term>
345                                         <listitem>
346                                                 <para>An address label.</para>
347                                         </listitem>
348                                 </varlistentry>
349                         </variablelist>
350
351                         <para>The <literal>[Route]</literal> section accepts the following keys:</para>
352
353                         <variablelist class='network-directives'>
354                                 <varlistentry>
355                                         <term><varname>Gateway</varname></term>
356                                         <listitem>
357                                                 <para>As in the <literal>[Network]</literal> section. This key is mandatory.</para>
358                                         </listitem>
359                                 </varlistentry>
360                                 <varlistentry>
361                                         <term><varname>Destination</varname></term>
362                                         <listitem>
363                                                 <para>The destination prefix of the route. Possibly followed by a slash and the
364                                                 prefixlength, if ommitted a full-length host route is assumed.</para>
365                                         </listitem>
366                                 </varlistentry>
367                         </variablelist>
368
369                         <para>The <literal>[DHCPv4]</literal> section accepts the following keys:</para>
370
371                         <variablelist class='network-directives'>
372                                 <varlistentry>
373                                         <term><varname>UseDNS</varname></term>
374                                         <listitem>
375                                                 <para>When true (the default), the DNS servers received from the DHCP server will
376                                                 be used and take precedence over any statically configured ones.</para>
377                                         </listitem>
378                                 </varlistentry>
379                                 <varlistentry>
380                                         <term><varname>UseMTU</varname></term>
381                                         <listitem>
382                                                 <para>When true, the interface maximum transmission unit from the DHCP server will
383                                                 be used on the current link. Defaults to false.</para>
384                                         </listitem>
385                                 </varlistentry>
386                                 <varlistentry>
387                                         <term><varname>UseHostname</varname></term>
388                                         <listitem>
389                                                 <para>When true (the default), the hostname received from the DHCP server
390                                                 will be used as the transient hostname.</para>
391                                         </listitem>
392                                 </varlistentry>
393                                 <varlistentry>
394                                         <term><varname>CriticalConnection</varname></term>
395                                         <listitem>
396                                                 <para>When true, the connection will never be torn down even if the DHCP lease
397                                                 expires. This is contrary to the DHCP specification, but may be the best choice
398                                                 if, say, the root filesystem relies on this connection. Defaults to false.</para>
399                                         </listitem>
400                                 </varlistentry>
401                        </variablelist>
402
403                 </refsect2>
404         </refsect1>
405
406         <refsect1>
407                 <title>See Also</title>
408                 <para>
409                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
410                         <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
411                 </para>
412         </refsect1>
413
414 </refentry>