chiark / gitweb /
man: add a minimized, modernized description of the file system hierarchy systemd...
[elogind.git] / man / systemd.netdev.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.netdev" conditional='ENABLE_NETWORKD'>
25
26         <refentryinfo>
27                 <title>systemd.network</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.netdev</refentrytitle>
42                 <manvolnum>5</manvolnum>
43         </refmeta>
44
45         <refnamediv>
46                 <refname>systemd.netdev</refname>
47                 <refpurpose>Virtual Network Device configuration</refpurpose>
48         </refnamediv>
49
50         <refsynopsisdiv>
51                 <para><filename><replaceable>netdev</replaceable>.netdev</filename></para>
52         </refsynopsisdiv>
53
54         <refsect1>
55                 <title>Description</title>
56
57                 <para>Network setup is performed by
58                 <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
59                 </para>
60
61                 <para>Virtual Network Device files must have the extension
62                 <filename>.netdev</filename>; other extensions are ignored. Virtual
63                 network devices are created as soon as networkd is started.</para>
64
65                 <para>The <filename>.netdev</filename> files are read from the files located in the
66                 system network directory <filename>/usr/lib/systemd/network</filename>,
67                 the volatile runtime network directory
68                 <filename>/run/systemd/network</filename> and the local administration
69                 network directory <filename>/etc/systemd/network</filename>.
70                 All configuration files are collectively sorted and processed in lexical order,
71                 regardless of the directories in which they live. However, files with
72                 identical filenames replace each other. Files in
73                 <filename>/etc</filename> have the highest priority, files in
74                 <filename>/run</filename> take precedence over files with the same
75                 name in <filename>/usr/lib</filename>. This can be used to override a
76                 system-supplied configuration file with a local file if needed; a symlink in
77                 <filename>/etc</filename> with the same name as a configuration file in
78                 <filename>/usr/lib</filename>, pointing to <filename>/dev/null</filename>,
79                 disables the configuration file entirely.</para>
80
81         </refsect1>
82
83         <refsect1>
84                 <title>[Match] Section Options</title>
85
86                 <para>A virtual network device is only created if the
87                 <literal>[Match]</literal> section matches the current
88                 environment, or if the section is empty. The following keys are accepted:</para>
89
90                         <variablelist class='network-directives'>
91                                 <varlistentry>
92                                         <term><varname>Host=</varname></term>
93                                         <listitem>
94                                                 <para>Matches against the hostname or machine ID of the
95                                                 host. See <literal>ConditionHost=</literal> in
96                                                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
97                                                 for details.
98                                                 </para>
99                                         </listitem>
100                                 </varlistentry>
101                                 <varlistentry>
102                                         <term><varname>Virtualization=</varname></term>
103                                         <listitem>
104                                                 <para>Checks whether the system is executed in a virtualized
105                                                 environment and optionally test whether it is a specific
106                                                 implementation. See <literal>ConditionVirtualization=</literal> in
107                                                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
108                                                 for details.
109                                                 </para>
110                                         </listitem>
111                                 </varlistentry>
112                                 <varlistentry>
113                                         <term><varname>KernelCommandLine=</varname></term>
114                                         <listitem>
115                                                 <para>Checks whether a specific kernel command line option is
116                                                 set (or if prefixed with the exclamation mark unset). See
117                                                 <literal>ConditionKernelCommandLine=</literal> in
118                                                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
119                                                 for details.
120                                                 </para>
121                                         </listitem>
122                                 </varlistentry>
123                                 <varlistentry>
124                                         <term><varname>Architecture=</varname></term>
125                                         <listitem>
126                                                 <para>Checks whether the system is running on a specific
127                                                 architecture. See <literal>ConditionArchitecture=</literal> in
128                                                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
129                                                 for details.
130                                                 </para>
131                                         </listitem>
132                                 </varlistentry>
133                         </variablelist>
134
135         </refsect1>
136
137         <refsect1>
138                 <title>[NetDev] Section Options</title>
139
140                         <para>The <literal>[NetDev]</literal> section accepts the following
141                         keys:</para>
142
143                         <variablelist class='network-directives'>
144                                 <varlistentry>
145                                         <term><varname>Name=</varname></term>
146                                         <listitem>
147                                                 <para>The interface name used when creating the
148                                                 netdev. This option is compulsory.</para>
149                                         </listitem>
150                                 </varlistentry>
151                                 <varlistentry>
152                                         <term><varname>Kind=</varname></term>
153                                         <listitem>
154                                                 <para>The netdev kind. Currently, <literal>bridge</literal>,
155                                                 <literal>bond</literal>, <literal>vlan</literal> and
156                                                 <literal>macvlan</literal> are supported. This option
157                                                 is compulsory.</para>
158                                         </listitem>
159                                 </varlistentry>
160                         </variablelist>
161
162         </refsect1>
163
164         <refsect1>
165                 <title>[VLAN] Section Options</title>
166
167                         <para>The <literal>[VLAN]</literal> section only applies for netdevs of kind <literal>vlan</literal>,
168                         and accepts the following key:</para>
169
170                         <variablelist class='network-directives'>
171                                 <varlistentry>
172                                         <term><varname>Id=</varname></term>
173                                         <listitem>
174                                                 <para>The VLAN ID to use. An integer in the range 0–4094.
175                                                 This option is compulsory.</para>
176                                         </listitem>
177                                 </varlistentry>
178                         </variablelist>
179
180         </refsect1>
181
182         <refsect1>
183                 <title>[MACVLAN] Section Options</title>
184
185                         <para>The <literal>[MACVLAN]</literal> section only applies for netdevs of kind
186                         <literal>macvlan</literal>, and accepts the following key:</para>
187
188                         <variablelist class='network-directives'>
189                                 <varlistentry>
190                                         <term><varname>Mode=</varname></term>
191                                         <listitem>
192                                                 <para>The MACVLAN mode to use. The supported options are
193                                                 <literal>private</literal>, <literal>vepa</literal>,
194                                                 <literal>bridge</literal> and <literal>passthru</literal>.
195                                                 </para>
196                                         </listitem>
197                                 </varlistentry>
198                         </variablelist>
199
200         </refsect1>
201
202         <refsect1>
203                 <title>Example</title>
204                 <example>
205                         <title>/etc/systemd/network/bridge.netdev</title>
206
207                         <programlisting>[NetDev]
208 Name=bridge0
209 Kind=bridge</programlisting>
210                 </example>
211
212                 <example>
213                         <title>/etc/systemd/network/vlan1.netdev</title>
214
215                         <programlisting>[Match]
216 Virtualization=no
217
218 [NetDev]
219 Name=vlan1
220 Kind=vlan
221
222 [VLAN]
223 Id=1</programlisting>
224                 </example>
225
226         </refsect1>
227
228         <refsect1>
229                 <title>See Also</title>
230                 <para>
231                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
232                         <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
233                         <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>
234                 </para>
235         </refsect1>
236
237 </refentry>