chiark / gitweb /
networkd: add basic bonding support
[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' and 'bond' are
109                                                 supported. This option is compulsory.</para>
110                                         </listitem>
111                                 </varlistentry>
112                         </variablelist>
113                 </refsect2>
114
115                 <refsect2><title>Networks</title>
116                         <para>Network files must have the extension <filename>.network</filename>;
117                         other extensions are ignored. Networks are applied to links whenever the links
118                         appear.</para>
119
120                         <para>The network file contains a <literal>[Match]</literal> section,
121                         which determines if a given network file may be applied to a given device;
122                         and a <literal>[Network]</literal> section specifying how the device should
123                         be configured. The first (in lexical order) of the network files that
124                         matches a given device is applied.</para>
125
126                         <para>A network file is said to match a device if each of the entries in the
127                         <literal>[Match]</literal> section matches, or if the section is empty.
128                         The following keys are accepted:</para>
129
130                         <variablelist class='network-directives'>
131                                 <varlistentry>
132                                         <term><varname>MACAddress</varname></term>
133                                         <listitem>
134                                                 <para>The hardware address.</para>
135                                         </listitem>
136                                 </varlistentry>
137                                 <varlistentry>
138                                         <term><varname>Path</varname></term>
139                                         <listitem>
140                                                 <para>The persistent path, as exposed by the udev
141                                                 property <literal>ID_PATH</literal>.</para>
142                                         </listitem>
143                                 </varlistentry>
144                                 <varlistentry>
145                                         <term><varname>Driver</varname></term>
146                                         <listitem>
147                                                 <para>The driver currently bound to the device, as
148                                                 exposed by the udev property <literal>DRIVER</literal>.
149                                                 </para>
150                                         </listitem>
151                                 </varlistentry>
152                                 <varlistentry>
153                                         <term><varname>Type</varname></term>
154                                         <listitem>
155                                                 <para>The device type, as exposed by the udev property
156                                                 <literal>DEVTYPE</literal>.</para>
157                                         </listitem>
158                                 </varlistentry>
159                                 <varlistentry>
160                                         <term><varname>Name</varname></term>
161                                         <listitem>
162                                                 <para>The device name, as exposed by the udev property
163                                                 <literal>INTERFACE</literal>.</para>
164                                         </listitem>
165                                 </varlistentry>
166                         </variablelist>
167
168                         <para>The <literal>[Network]</literal> section accepts the following keys:</para>
169
170                         <variablelist class='network-directives'>
171                                 <varlistentry>
172                                         <term><varname>Description</varname></term>
173                                         <listitem>
174                                                 <para>A description of the device. This is only used for
175                                                 presentation purposes.</para>
176                                         </listitem>
177                                 </varlistentry>
178                                 <varlistentry>
179                                         <term><varname>DHCP</varname></term>
180                                         <listitem>
181                                                 <para>A boolean. When true enables basic DHCPv4 support.</para>
182                                         </listitem>
183                                 </varlistentry>
184                                 <varlistentry>
185                                         <term><varname>Address</varname></term>
186                                         <listitem>
187                                                 <para>A static IPv4 or IPv6 address and its prefix length,
188                                                 separated by a '/' character. The format of the address must
189                                                 be as described in
190                                                 <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>
191                                                 . This is a short-hand for an [Address] section only containing an Address key (see below).</para>
192                                         </listitem>
193                                 </varlistentry>
194                                 <varlistentry>
195                                         <term><varname>Gateway</varname></term>
196                                         <listitem>
197                                                 <para>The gateway address, which must be in the format described in
198                                                 <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>
199                                                 . This is a short-hand for a [Route] section only containing a Gateway key.</para>
200                                         </listitem>
201                                 </varlistentry>
202                                 <varlistentry>
203                                         <term><varname>DNS</varname></term>
204                                         <listitem>
205                                                 <para>A DNS server address, which must be in the format described in
206                                                 <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>
207                                                 .</para>
208                                         </listitem>
209                                 </varlistentry>
210                                 <varlistentry>
211                                         <term><varname>Bridge</varname></term>
212                                         <listitem>
213                                                 <para>The name of the bridge to add the configured link to.</para>
214                                         </listitem>
215                                 </varlistentry>
216                                 <varlistentry>
217                                         <term><varname>Bond</varname></term>
218                                         <listitem>
219                                                 <para>The name of the bond to add the configured link to.</para>
220                                         </listitem>
221                                 </varlistentry>
222                         </variablelist>
223
224                         <para>The <literal>[Address]</literal> section accepts the following keys:</para>
225
226                         <variablelist class='network-directives'>
227                                 <varlistentry>
228                                         <term><varname>Address</varname></term>
229                                         <listitem>
230                                                 <para>As in the <literal>[Network]</literal> section. This key is mandatory.</para>
231                                         </listitem>
232                                 </varlistentry>
233                                 <varlistentry>
234                                         <term><varname>Label</varname></term>
235                                         <listitem>
236                                                 <para>An address label.</para>
237                                         </listitem>
238                                 </varlistentry>
239                         </variablelist>
240
241                         <para>The <literal>[Route]</literal> section accepts the following keys:</para>
242
243                         <variablelist class='network-directives'>
244                                 <varlistentry>
245                                         <term><varname>Gateway</varname></term>
246                                         <listitem>
247                                                 <para>As in the <literal>[Network]</literal> section. This key is mandatory.</para>
248                                         </listitem>
249                                 </varlistentry>
250                                 <varlistentry>
251                                         <term><varname>Destination</varname></term>
252                                         <listitem>
253                                                 <para>The destination prefix of the route. Possibly followed by a slash and the
254                                                 prefixlength, if ommitted a full-length host route is assumed.</para>
255                                         </listitem>
256                                 </varlistentry>
257                         </variablelist>
258
259                         <para>The <literal>[DHCPv4]</literal> section accepts the following keys:</para>
260
261                         <variablelist class='network-directives'>
262                                 <varlistentry>
263                                         <term><varname>UseDNS</varname></term>
264                                         <listitem>
265                                                 <para>When true (the default) the DNS servers received from the DHCP server will
266                                                 be used, and take precedence over any statically configured ones.</para>
267                                         </listitem>
268                                 </varlistentry>
269                                 <varlistentry>
270                                         <term><varname>UseMTU</varname></term>
271                                         <listitem>
272                                                 <para>When true the interface maximum transmission unit from the DHCP server will
273                                                 be used on the current link. Defaults to false.</para>
274                                         </listitem>
275                                 </varlistentry>
276                                 <varlistentry>
277                                         <term><varname>UseHostname</varname></term>
278                                         <listitem>
279                                                 <para>When true (the default) the hostname received from the DHCP server
280                                                 will be used as the transient hostname.</para>
281                                         </listitem>
282                                 </varlistentry>
283                        </variablelist>
284
285                 </refsect2>
286         </refsect1>
287
288         <refsect1>
289                 <title>See Also</title>
290                 <para>
291                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
292                         <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
293                 </para>
294         </refsect1>
295
296 </refentry>