]>
Commit | Line | Data |
---|---|---|
eac684ef TG |
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>, | |
fe6b2d55 TG |
145 | <literal>bond</literal>, <literal>vlan</literal> and |
146 | <literal>macvlan</literal> are supported. This option | |
147 | is compulsory.</para> | |
eac684ef TG |
148 | </listitem> |
149 | </varlistentry> | |
150 | </variablelist> | |
151 | ||
152 | <para>The <literal>[VLAN]</literal> section only applies for netdevs of kind <literal>vlan</literal>, | |
153 | and accepts the following key:</para> | |
154 | ||
155 | <variablelist class='network-directives'> | |
156 | <varlistentry> | |
157 | <term><varname>Id=</varname></term> | |
158 | <listitem> | |
159 | <para>The VLAN ID to use. An integer in the range 0–4094. | |
160 | This option is compulsory.</para> | |
161 | </listitem> | |
162 | </varlistentry> | |
fe6b2d55 TG |
163 | </variablelist> |
164 | ||
165 | <para>The <literal>[MACVLAN]</literal> section only applies for netdevs of kind | |
166 | <literal>macvlan</literal>, and accepts the following key:</para> | |
167 | ||
168 | <variablelist class='network-directives'> | |
169 | <varlistentry> | |
170 | <term><varname>Mode=</varname></term> | |
171 | <listitem> | |
172 | <para>The MACVLAN mode to use. The supported options are | |
173 | <literal>private</literal>, <literal>vepa</literal>, | |
174 | <literal>bridge</literal> and <literal>passthru</literal>. | |
175 | </para> | |
176 | </listitem> | |
177 | </varlistentry> | |
eac684ef TG |
178 | </variablelist> |
179 | ||
180 | </refsect1> | |
181 | ||
182 | <refsect1> | |
183 | <title>Example</title> | |
184 | <example> | |
185 | <title>/etc/systemd/network/bridge.netdev</title> | |
186 | ||
187 | <programlisting>[NetDev] | |
188 | Name=bridge0 | |
189 | Kind=bridge</programlisting> | |
190 | </example> | |
191 | ||
192 | <example> | |
193 | <title>/etc/systemd/network/vlan1.netdev</title> | |
194 | ||
195 | <programlisting>[Match] | |
196 | Virtualization=no | |
197 | ||
198 | [NetDev] | |
199 | Name=vlan1 | |
200 | Kind=vlan | |
201 | ||
202 | [VLAN] | |
203 | Id=1</programlisting> | |
204 | </example> | |
205 | ||
206 | </refsect1> | |
207 | ||
208 | <refsect1> | |
209 | <title>See Also</title> | |
210 | <para> | |
211 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
f47c5c47 | 212 | <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
213 | <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
eac684ef TG |
214 | </para> |
215 | </refsect1> | |
216 | ||
217 | </refentry> |