chiark / gitweb /
networkd: tuntap - default to no packet information
[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>Description=</varname></term>
146                                         <listitem>
147                                                 <para>A free-form description of the netdev.
148                                                 </para>
149                                         </listitem>
150                                 </varlistentry>
151                                 <varlistentry>
152                                         <term><varname>Name=</varname></term>
153                                         <listitem>
154                                                 <para>The interface name used when creating the
155                                                 netdev. This option is compulsory.</para>
156                                         </listitem>
157                                 </varlistentry>
158                                 <varlistentry>
159                                         <term><varname>Kind=</varname></term>
160                                         <listitem>
161                                                 <para>The netdev kind. Currently, <literal>bridge</literal>,
162                                                 <literal>bond</literal>, <literal>vlan</literal>,
163                                                 <literal>macvlan</literal>, <literal>vxlan</literal>,
164                                                 <literal>ipip</literal>, <literal>gre</literal>,
165                                                 <literal>sit</literal>, <literal>vti</literal>,
166                                                 <literal>veth</literal>, and <literal>dummy</literal>
167                                                 are supported. This option is compulsory.</para>
168                                         </listitem>
169                                 </varlistentry>
170                                 <varlistentry>
171                                         <term><varname>MTUBytes=</varname></term>
172                                         <listitem>
173                                                 <para>The maximum transmission unit in bytes to
174                                                 set for the device. The usual suffixes K, M, G,
175                                                 are supported and are understood to the base of
176                                                 1024.</para>
177                                         </listitem>
178                                 </varlistentry>
179                                 <varlistentry>
180                                         <term><varname>MACAddress=</varname></term>
181                                         <listitem>
182                                                 <para>The MAC address to use for the device.
183                                                 If none is given, one is generated based on
184                                                 the interface name and the
185                                                 <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
186                                                 </para>
187                                         </listitem>
188                                 </varlistentry>
189                         </variablelist>
190         </refsect1>
191
192         <refsect1>
193                 <title>[VLAN] Section Options</title>
194
195                         <para>The <literal>[VLAN]</literal> section only applies for netdevs of kind <literal>vlan</literal>,
196                         and accepts the following key:</para>
197
198                         <variablelist class='network-directives'>
199                                 <varlistentry>
200                                         <term><varname>Id=</varname></term>
201                                         <listitem>
202                                                 <para>The VLAN ID to use. An integer in the range 0–4094.
203                                                 This option is compulsory.</para>
204                                         </listitem>
205                                 </varlistentry>
206                         </variablelist>
207
208         </refsect1>
209
210         <refsect1>
211                 <title>[MACVLAN] Section Options</title>
212
213                         <para>The <literal>[MACVLAN]</literal> section only applies for netdevs of kind
214                         <literal>macvlan</literal>, and accepts the following key:</para>
215
216                         <variablelist class='network-directives'>
217                                 <varlistentry>
218                                         <term><varname>Mode=</varname></term>
219                                         <listitem>
220                                                 <para>The MACVLAN mode to use. The supported options are
221                                                 <literal>private</literal>, <literal>vepa</literal>,
222                                                 <literal>bridge</literal> and <literal>passthru</literal>.
223                                                 </para>
224                                         </listitem>
225                                 </varlistentry>
226                         </variablelist>
227
228         </refsect1>
229         <refsect1>
230                 <title>[VXLAN] Section Options</title>
231                         <para>The <literal>[VXLAN]</literal> section only applies for netdevs of kind
232                         <literal>vxlan</literal>, and accepts the following key:</para>
233
234                         <variablelist class='network-directives'>
235                                 <varlistentry>
236                                         <term><varname>Id=</varname></term>
237                                         <listitem>
238                                                 <para>The VXLAN ID to use.</para>
239                                         </listitem>
240                                 </varlistentry>
241                                 <varlistentry>
242                                         <term><varname>Group=</varname></term>
243                                         <listitem>
244                                                 <para>An assigned multicast group IP address.</para>
245                                         </listitem>
246                                 </varlistentry>
247                                 <varlistentry>
248                                         <term><varname>TOS=</varname></term>
249                                         <listitem>
250                                                 <para>The Type Of Service byte value for a vxlan interface.</para>
251                                         </listitem>
252                                 </varlistentry>
253                                 <varlistentry>
254                                         <term><varname>TTL=</varname></term>
255                                         <listitem>
256                                                 <para>A fixed Time To Live N on Virtual eXtensible Local Area Network packets.
257                                                 N is a number in the range 1-255. 0 is a special value meaning that packets
258                                                 inherit the TTL value.</para>
259                                         </listitem>
260                                 </varlistentry>
261                                 <varlistentry>
262                                         <term><varname>MacLearning=</varname></term>
263                                         <listitem>
264                                                 <para>A boolean. When true, enables dynamic MAC learning
265                                                 to discover remote MAC addresses.</para>
266                                         </listitem>
267                                 </varlistentry>
268                         </variablelist>
269         </refsect1>
270         <refsect1>
271                 <title>[Tunnel] Section Options</title>
272
273                         <para>The <literal>[Tunnel]</literal> section only applies for netdevs of kind
274                         <literal>ipip</literal>, <literal>sit</literal>, <literal>gre</literal> and
275                         <literal>vti</literal> and accepts the following keys:</para>
276
277                         <variablelist class='network-directives'>
278                                 <varlistentry>
279                                         <term><varname>Local=</varname></term>
280                                         <listitem>
281                                                 <para>A static local address for tunneled packets.
282                                                 It must be an address on another interface of this host.</para>
283                                         </listitem>
284                                 </varlistentry>
285                                 <varlistentry>
286                                         <term><varname>Remote=</varname></term>
287                                         <listitem>
288                                                 <para>The remote endpoint of the tunnel.</para>
289                                         </listitem>
290                                 </varlistentry>
291                                 <varlistentry>
292                                         <term><varname>TOS=</varname></term>
293                                         <listitem>
294                                                 <para>The Type Of Service byte value for a tunnel interface.
295                                                 For details about the TOS see the
296                                                 <ulink url="http://tools.ietf.org/html/rfc1349">
297                                                 Type of Service in the Internet Protocol Suite
298                                                 </ulink> document.
299                                                 </para>
300                                         </listitem>
301                                 </varlistentry>
302                                 <varlistentry>
303                                         <term><varname>TTL=</varname></term>
304                                         <listitem>
305                                                 <para>A fixed Time To Live N on tunneled packets.
306                                                 N is a number in the range 1-255. 0 is a special value meaning that packets
307                                                 inherit the TTL value. The default value for IPv4 tunnels is: inherit.
308                                                 The default value for IPv6 tunnels is: 64.</para>
309                                         </listitem>
310                                 </varlistentry>
311                                 <varlistentry>
312                                         <term><varname>DiscoverPathMTU=</varname></term>
313                                         <listitem>
314                                                 <para>A boolean. When true, enables Path MTU Discovery on the tunnel.</para>
315                                         </listitem>
316                                 </varlistentry>
317                         </variablelist>
318         </refsect1>
319         <refsect1>
320                 <title>[Peer] Section Options</title>
321
322                         <para>The <literal>[Peer]</literal> section only applies for netdevs of kind <literal>veth</literal>
323                         and accepts the following key:</para>
324
325                         <variablelist class='network-directives'>
326                                 <varlistentry>
327                                         <term><varname>Name=</varname></term>
328                                         <listitem>
329                                                 <para>The interface name used when creating the netdev.
330                                                 This option is compulsory.</para>
331                                         </listitem>
332                                 </varlistentry>
333                                 <varlistentry>
334                                         <term><varname>MACAddress=</varname></term>
335                                         <listitem>
336                                                 <para>The peer MACAddress, if not set it is generated in the same
337                                                 way as the MAC address of the main interface.</para>
338                                         </listitem>
339                                 </varlistentry>
340                         </variablelist>
341         </refsect1>
342         <refsect1>
343                 <title>[Tun] Section Options</title>
344
345                         <para>The <literal>[Tun]</literal> section only applies for netdevs of kind
346                         <literal>tun</literal>, and accepts the following keys:</para>
347
348                         <variablelist class='network-directives'>
349                                 <varlistentry>
350                                         <term><varname>OneQueue=</varname></term>
351                                         <listitem><para>Takes a boolean argument. Configures whether
352                                         all packets are queued at the device (enabled), or a fixed number
353                                         of packets are queued at the device and the rest at the
354                                         <literal>qdisc</literal>. Defaults to <literal>no</literal>.</para>
355                                         </listitem>
356                                 </varlistentry>
357                                 <varlistentry>
358                                         <term><varname>MultiQueue=</varname></term>
359                                         <listitem><para>Takes a boolean argument. Configures whether to
360                                         use multiple file descriptors (queues) to parallelize packets
361                                         sending and receiving. Defaults to <literal>no</literal>.</para>
362                                         </listitem>
363                                 </varlistentry>
364                                 <varlistentry>
365                                         <term><varname>PacketInfo=</varname></term>
366                                         <listitem><para>Takes a boolean argument. Configures whether packets
367                                         should be prepened with four extra bytes (two flag bytes and two
368                                         protocol bytes). If disabled it indicates that the packets will be
369                                         pure IP packets. Defaults to <literal>no</literal>.</para>
370                                         </listitem>
371                                 </varlistentry>
372                                 <varlistentry>
373                                         <term><varname>User=</varname></term>
374                                         <listitem><para>User to grant access to the <filename>/dev/net/tun</filename>
375                                         device.</para>
376                                         </listitem>
377                                 </varlistentry>
378                                 <varlistentry>
379                                         <term><varname>Group=</varname></term>
380                                         <listitem><para>Group to grant access to the <filename>/dev/net/tun</filename>
381                                         device.</para>
382                                         </listitem>
383                                 </varlistentry>
384
385                         </variablelist>
386
387         </refsect1>
388
389         <refsect1>
390                 <title>[Tap] Section Options</title>
391
392                         <para>The <literal>[Tap]</literal> section only applies for netdevs of kind
393                         <literal>tap</literal>, and accepts the same keys as the
394                         <literal>[Tun]</literal> section.</para>
395         </refsect1>
396
397         <refsect1>
398                 <title>Example</title>
399                 <example>
400                         <title>/etc/systemd/network/bridge.netdev</title>
401
402                         <programlisting>[NetDev]
403 Name=bridge0
404 Kind=bridge</programlisting>
405                 </example>
406
407                 <example>
408                         <title>/etc/systemd/network/vlan1.netdev</title>
409
410                         <programlisting>[Match]
411 Virtualization=no
412
413 [NetDev]
414 Name=vlan1
415 Kind=vlan
416
417 [VLAN]
418 Id=1</programlisting>
419                 </example>
420                 <example>
421                         <title>/etc/systemd/network/ipip.netdev</title>
422                         <programlisting>[NetDev]
423 Name=ipip-tun
424 Kind=ipip
425 MTUBytes=1480
426
427 [Tunnel]
428 Local=192.168.223.238
429 Remote=192.169.224.239
430 TTL=64</programlisting>
431                 </example>
432                 <example>
433                   <title>/etc/systemd/network/tap.netdev</title>
434                   <programlisting>[NetDev]
435 Name=tap-test
436 Kind=tap
437
438 [Tap]
439 MultiQueue=true
440 PacketInfo=true</programlisting> </example>
441
442                 <example>
443                         <title>/etc/systemd/network/sit.netdev</title>
444                         <programlisting>[NetDev]
445 Name=sit-tun
446 Kind=sit
447 MTUBytes=1480
448
449 [Tunnel]
450 Local=10.65.223.238
451 Remote=10.65.223.239</programlisting>
452                 </example>
453
454                 <example>
455                         <title>/etc/systemd/network/gre.netdev</title>
456                         <programlisting>[NetDev]
457 Name=gre-tun
458 Kind=gre
459 MTUBytes=1480
460
461 [Tunnel]
462 Local=10.65.223.238
463 Remote=10.65.223.239</programlisting>
464                 </example>
465
466                 <example>
467                         <title>/etc/systemd/network/vti.netdev</title>
468
469                         <programlisting>[NetDev]
470 Name=vti-tun
471 Kind=vti
472 MTUBytes=1480
473
474 [Tunnel]
475 Local=10.65.223.238
476 Remote=10.65.223.239</programlisting>
477                 </example>
478
479                 <example>
480                         <title>/etc/systemd/network/veth.netdev</title>
481                         <programlisting>[NetDev]
482 Name=veth-test
483 Kind=veth
484
485 [Peer]
486 Name=veth-peer</programlisting>
487                 </example>
488
489                 <example>
490                         <title>/etc/systemd/network/dummy.netdev</title>
491                         <programlisting>[NetDev]
492 Name=dummy-test
493 Kind=dummy
494 MACAddress=12:34:56:78:9a:bc</programlisting>
495                 </example>
496
497         </refsect1>
498         <refsect1>
499                 <title>See Also</title>
500                 <para>
501                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
502                         <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
503                         <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>
504                 </para>
505         </refsect1>
506
507 </refentry>