chiark / gitweb /
man: split out systemd.net{work,dev}(5) from systemd-networkd(8)
[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                 <para>A virtual network device is only created if the
82                 <literal>[Match]</literal> section matches the current
83                 environment, or if the section is empty. The following keys are accepted:</para>
84
85                         <variablelist class='network-directives'>
86                                 <varlistentry>
87                                         <term><varname>Host=</varname></term>
88                                         <listitem>
89                                                 <para>Matches against the hostname or machine ID of the
90                                                 host. See <literal>ConditionHost=</literal> in
91                                                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
92                                                 for details.
93                                                 </para>
94                                         </listitem>
95                                 </varlistentry>
96                                 <varlistentry>
97                                         <term><varname>Virtualization=</varname></term>
98                                         <listitem>
99                                                 <para>Checks whether the system is executed in a virtualized
100                                                 environment and optionally test whether it is a specific
101                                                 implementation. See <literal>ConditionVirtualization=</literal> in
102                                                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
103                                                 for details.
104                                                 </para>
105                                         </listitem>
106                                 </varlistentry>
107                                 <varlistentry>
108                                         <term><varname>KernelCommandLine=</varname></term>
109                                         <listitem>
110                                                 <para>Checks whether a specific kernel command line option is
111                                                 set (or if prefixed with the exclamation mark unset). See
112                                                 <literal>ConditionKernelCommandLine=</literal> in
113                                                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
114                                                 for details.
115                                                 </para>
116                                         </listitem>
117                                 </varlistentry>
118                                 <varlistentry>
119                                         <term><varname>Architecture=</varname></term>
120                                         <listitem>
121                                                 <para>Checks whether the system is running on a specific
122                                                 architecture. See <literal>ConditionArchitecture=</literal> in
123                                                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
124                                                 for details.
125                                                 </para>
126                                         </listitem>
127                                 </varlistentry>
128                         </variablelist>
129
130                         <para>The <literal>[NetDev]</literal> section accepts the following
131                         keys:</para>
132
133                         <variablelist class='network-directives'>
134                                 <varlistentry>
135                                         <term><varname>Name=</varname></term>
136                                         <listitem>
137                                                 <para>The interface name used when creating the
138                                                 netdev. This option is compulsory.</para>
139                                         </listitem>
140                                 </varlistentry>
141                                 <varlistentry>
142                                         <term><varname>Kind=</varname></term>
143                                         <listitem>
144                                                 <para>The netdev kind. Currently, <literal>bridge</literal>,
145                                                 <literal>bond</literal> and <literal>vlan</literal>
146                                                 are supported. This option is compulsory.</para>
147                                         </listitem>
148                                 </varlistentry>
149                         </variablelist>
150
151                         <para>The <literal>[VLAN]</literal> section only applies for netdevs of kind <literal>vlan</literal>,
152                         and accepts the following key:</para>
153
154                         <variablelist class='network-directives'>
155                                 <varlistentry>
156                                         <term><varname>Id=</varname></term>
157                                         <listitem>
158                                                 <para>The VLAN ID to use. An integer in the range 0–4094.
159                                                 This option is compulsory.</para>
160                                         </listitem>
161                                 </varlistentry>
162                         </variablelist>
163
164         </refsect1>
165
166         <refsect1>
167                 <title>Example</title>
168                 <example>
169                         <title>/etc/systemd/network/bridge.netdev</title>
170
171                         <programlisting>[NetDev]
172 Name=bridge0
173 Kind=bridge</programlisting>
174                 </example>
175
176                 <example>
177                         <title>/etc/systemd/network/vlan1.netdev</title>
178
179                         <programlisting>[Match]
180 Virtualization=no
181
182 [NetDev]
183 Name=vlan1
184 Kind=vlan
185
186 [VLAN]
187 Id=1</programlisting>
188                 </example>
189
190         </refsect1>
191
192         <refsect1>
193                 <title>See Also</title>
194                 <para>
195                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
196                         <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
197                 </para>
198         </refsect1>
199
200 </refentry>