]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd.netdev.xml
zsh-completion: remove duplicate function
[thirdparty/systemd.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. If a netdev
64 with the specified name already exists, networkd will use that as-is
65 rather than create its own. Note that the settings of the pre-existing
66 netdev will not be changed by networkd.</para>
67
68 <para>The <filename>.netdev</filename> files are read from the files located in the
69 system network directory <filename>/usr/lib/systemd/network</filename>,
70 the volatile runtime network directory
71 <filename>/run/systemd/network</filename> and the local administration
72 network directory <filename>/etc/systemd/network</filename>.
73 All configuration files are collectively sorted and processed in lexical order,
74 regardless of the directories in which they live. However, files with
75 identical filenames replace each other. Files in
76 <filename>/etc</filename> have the highest priority, files in
77 <filename>/run</filename> take precedence over files with the same
78 name in <filename>/usr/lib</filename>. This can be used to override a
79 system-supplied configuration file with a local file if needed; a symlink in
80 <filename>/etc</filename> with the same name as a configuration file in
81 <filename>/usr/lib</filename>, pointing to <filename>/dev/null</filename>,
82 disables the configuration file entirely.</para>
83
84 </refsect1>
85
86 <refsect1>
87 <title>[Match] Section Options</title>
88
89 <para>A virtual network device is only created if the
90 <literal>[Match]</literal> section matches the current
91 environment, or if the section is empty. The following keys are accepted:</para>
92
93 <variablelist class='network-directives'>
94 <varlistentry>
95 <term><varname>Host=</varname></term>
96 <listitem>
97 <para>Matches against the hostname or machine ID of the
98 host. See <literal>ConditionHost=</literal> in
99 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
100 for details.
101 </para>
102 </listitem>
103 </varlistentry>
104 <varlistentry>
105 <term><varname>Virtualization=</varname></term>
106 <listitem>
107 <para>Checks whether the system is executed in a virtualized
108 environment and optionally test whether it is a specific
109 implementation. See <literal>ConditionVirtualization=</literal> in
110 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
111 for details.
112 </para>
113 </listitem>
114 </varlistentry>
115 <varlistentry>
116 <term><varname>KernelCommandLine=</varname></term>
117 <listitem>
118 <para>Checks whether a specific kernel command line option is
119 set (or if prefixed with the exclamation mark unset). See
120 <literal>ConditionKernelCommandLine=</literal> in
121 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
122 for details.
123 </para>
124 </listitem>
125 </varlistentry>
126 <varlistentry>
127 <term><varname>Architecture=</varname></term>
128 <listitem>
129 <para>Checks whether the system is running on a specific
130 architecture. See <literal>ConditionArchitecture=</literal> in
131 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
132 for details.
133 </para>
134 </listitem>
135 </varlistentry>
136 </variablelist>
137
138 </refsect1>
139
140 <refsect1>
141 <title>[NetDev] Section Options</title>
142
143 <para>The <literal>[NetDev]</literal> section accepts the following
144 keys:</para>
145
146 <variablelist class='network-directives'>
147 <varlistentry>
148 <term><varname>Description=</varname></term>
149 <listitem>
150 <para>A free-form description of the netdev.
151 </para>
152 </listitem>
153 </varlistentry>
154 <varlistentry>
155 <term><varname>Name=</varname></term>
156 <listitem>
157 <para>The interface name used when creating the
158 netdev. This option is compulsory.</para>
159 </listitem>
160 </varlistentry>
161 <varlistentry>
162 <term><varname>Kind=</varname></term>
163 <listitem>
164 <para>The netdev kind. Currently, <literal>bridge</literal>,
165 <literal>bond</literal>, <literal>vlan</literal>,
166 <literal>macvlan</literal>, <literal>vxlan</literal>,
167 <literal>ipip</literal>, <literal>gre</literal>,
168 <literal>sit</literal>, <literal>vti</literal>,
169 <literal>veth</literal>, <literal>tun</literal>,
170 <literal>tap</literal> and <literal>dummy</literal>
171 are supported. This option is compulsory.</para>
172 </listitem>
173 </varlistentry>
174 <varlistentry>
175 <term><varname>MTUBytes=</varname></term>
176 <listitem>
177 <para>The maximum transmission unit in bytes to
178 set for the device. The usual suffixes K, M, G,
179 are supported and are understood to the base of
180 1024. This key is not currently suported for
181 <literal>tun</literal> or <literal>tap</literal> devices.
182 </para>
183 </listitem>
184 </varlistentry>
185 <varlistentry>
186 <term><varname>MACAddress=</varname></term>
187 <listitem>
188 <para>The MAC address to use for the device.
189 If none is given, one is generated based on
190 the interface name and the
191 <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
192 This key is not currently suported for <literal>tun</literal> or <literal>tap</literal> devices.
193 </para>
194 </listitem>
195 </varlistentry>
196 </variablelist>
197 </refsect1>
198
199 <refsect1>
200 <title>[VLAN] Section Options</title>
201
202 <para>The <literal>[VLAN]</literal> section only applies for netdevs of kind <literal>vlan</literal>,
203 and accepts the following key:</para>
204
205 <variablelist class='network-directives'>
206 <varlistentry>
207 <term><varname>Id=</varname></term>
208 <listitem>
209 <para>The VLAN ID to use. An integer in the range 0–4094.
210 This option is compulsory.</para>
211 </listitem>
212 </varlistentry>
213 </variablelist>
214
215 </refsect1>
216
217 <refsect1>
218 <title>[MACVLAN] Section Options</title>
219
220 <para>The <literal>[MACVLAN]</literal> section only applies for netdevs of kind
221 <literal>macvlan</literal>, and accepts the following key:</para>
222
223 <variablelist class='network-directives'>
224 <varlistentry>
225 <term><varname>Mode=</varname></term>
226 <listitem>
227 <para>The MACVLAN mode to use. The supported options are
228 <literal>private</literal>, <literal>vepa</literal>,
229 <literal>bridge</literal> and <literal>passthru</literal>.
230 </para>
231 </listitem>
232 </varlistentry>
233 </variablelist>
234
235 </refsect1>
236 <refsect1>
237 <title>[VXLAN] Section Options</title>
238 <para>The <literal>[VXLAN]</literal> section only applies for netdevs of kind
239 <literal>vxlan</literal>, and accepts the following key:</para>
240
241 <variablelist class='network-directives'>
242 <varlistentry>
243 <term><varname>Id=</varname></term>
244 <listitem>
245 <para>The VXLAN ID to use.</para>
246 </listitem>
247 </varlistentry>
248 <varlistentry>
249 <term><varname>Group=</varname></term>
250 <listitem>
251 <para>An assigned multicast group IP address.</para>
252 </listitem>
253 </varlistentry>
254 <varlistentry>
255 <term><varname>TOS=</varname></term>
256 <listitem>
257 <para>The Type Of Service byte value for a vxlan interface.</para>
258 </listitem>
259 </varlistentry>
260 <varlistentry>
261 <term><varname>TTL=</varname></term>
262 <listitem>
263 <para>A fixed Time To Live N on Virtual eXtensible Local Area Network packets.
264 N is a number in the range 1-255. 0 is a special value meaning that packets
265 inherit the TTL value.</para>
266 </listitem>
267 </varlistentry>
268 <varlistentry>
269 <term><varname>MacLearning=</varname></term>
270 <listitem>
271 <para>A boolean. When true, enables dynamic MAC learning
272 to discover remote MAC addresses.</para>
273 </listitem>
274 </varlistentry>
275 <varlistentry>
276 <term><varname>FDBAgeingSec=</varname></term>
277 <listitem>
278 <para>The lifetime of Forwarding Database entry learnt by the kernel in seconds.</para>
279 </listitem>
280 </varlistentry>
281 <varlistentry>
282 <term><varname>ARPProxy=</varname></term>
283 <listitem>
284 <para>A boolean. When true, enables ARP proxy.</para>
285 </listitem>
286 </varlistentry>
287 <varlistentry>
288 <term><varname>L2MissNotification=</varname></term>
289 <listitem>
290 <para>A boolean. When true, enables netlink LLADDR miss notifications.</para>
291 </listitem>
292 </varlistentry>
293 <varlistentry>
294 <term><varname>L3MissNotification=</varname></term>
295 <listitem>
296 <para>A boolean. When true, enables netlink IP ADDR miss notifications.</para>
297 </listitem>
298 </varlistentry>
299 <varlistentry>
300 <term><varname>RouteShortCircuit=</varname></term>
301 <listitem>
302 <para>A boolean. When true route short circuit is turned on.</para>
303 </listitem>
304 </varlistentry>
305 </variablelist>
306 </refsect1>
307 <refsect1>
308 <title>[Tunnel] Section Options</title>
309
310 <para>The <literal>[Tunnel]</literal> section only applies for netdevs of kind
311 <literal>ipip</literal>, <literal>sit</literal>, <literal>gre</literal> and
312 <literal>vti</literal> and accepts the following keys:</para>
313
314 <variablelist class='network-directives'>
315 <varlistentry>
316 <term><varname>Local=</varname></term>
317 <listitem>
318 <para>A static local address for tunneled packets.
319 It must be an address on another interface of this host.</para>
320 </listitem>
321 </varlistentry>
322 <varlistentry>
323 <term><varname>Remote=</varname></term>
324 <listitem>
325 <para>The remote endpoint of the tunnel.</para>
326 </listitem>
327 </varlistentry>
328 <varlistentry>
329 <term><varname>TOS=</varname></term>
330 <listitem>
331 <para>The Type Of Service byte value for a tunnel interface.
332 For details about the TOS see the
333 <ulink url="http://tools.ietf.org/html/rfc1349">
334 Type of Service in the Internet Protocol Suite
335 </ulink> document.
336 </para>
337 </listitem>
338 </varlistentry>
339 <varlistentry>
340 <term><varname>TTL=</varname></term>
341 <listitem>
342 <para>A fixed Time To Live N on tunneled packets.
343 N is a number in the range 1-255. 0 is a special value meaning that packets
344 inherit the TTL value. The default value for IPv4 tunnels is: inherit.
345 The default value for IPv6 tunnels is: 64.</para>
346 </listitem>
347 </varlistentry>
348 <varlistentry>
349 <term><varname>DiscoverPathMTU=</varname></term>
350 <listitem>
351 <para>A boolean. When true, enables Path MTU Discovery on the tunnel.</para>
352 </listitem>
353 </varlistentry>
354 </variablelist>
355 </refsect1>
356 <refsect1>
357 <title>[Peer] Section Options</title>
358
359 <para>The <literal>[Peer]</literal> section only applies for netdevs of kind <literal>veth</literal>
360 and accepts the following key:</para>
361
362 <variablelist class='network-directives'>
363 <varlistentry>
364 <term><varname>Name=</varname></term>
365 <listitem>
366 <para>The interface name used when creating the netdev.
367 This option is compulsory.</para>
368 </listitem>
369 </varlistentry>
370 <varlistentry>
371 <term><varname>MACAddress=</varname></term>
372 <listitem>
373 <para>The peer MACAddress, if not set it is generated in the same
374 way as the MAC address of the main interface.</para>
375 </listitem>
376 </varlistentry>
377 </variablelist>
378 </refsect1>
379 <refsect1>
380 <title>[Tun] Section Options</title>
381
382 <para>The <literal>[Tun]</literal> section only applies for netdevs of kind
383 <literal>tun</literal>, and accepts the following keys:</para>
384
385 <variablelist class='network-directives'>
386 <varlistentry>
387 <term><varname>OneQueue=</varname></term>
388 <listitem><para>Takes a boolean argument. Configures whether
389 all packets are queued at the device (enabled), or a fixed number
390 of packets are queued at the device and the rest at the
391 <literal>qdisc</literal>. Defaults to <literal>no</literal>.</para>
392 </listitem>
393 </varlistentry>
394 <varlistentry>
395 <term><varname>MultiQueue=</varname></term>
396 <listitem><para>Takes a boolean argument. Configures whether to
397 use multiple file descriptors (queues) to parallelize packets
398 sending and receiving. Defaults to <literal>no</literal>.</para>
399 </listitem>
400 </varlistentry>
401 <varlistentry>
402 <term><varname>PacketInfo=</varname></term>
403 <listitem><para>Takes a boolean argument. Configures whether packets
404 should be prepened with four extra bytes (two flag bytes and two
405 protocol bytes). If disabled it indicates that the packets will be
406 pure IP packets. Defaults to <literal>no</literal>.</para>
407 </listitem>
408 </varlistentry>
409 <varlistentry>
410 <term><varname>User=</varname></term>
411 <listitem><para>User to grant access to the <filename>/dev/net/tun</filename>
412 device.</para>
413 </listitem>
414 </varlistentry>
415 <varlistentry>
416 <term><varname>Group=</varname></term>
417 <listitem><para>Group to grant access to the <filename>/dev/net/tun</filename>
418 device.</para>
419 </listitem>
420 </varlistentry>
421
422 </variablelist>
423
424 </refsect1>
425
426 <refsect1>
427 <title>[Tap] Section Options</title>
428
429 <para>The <literal>[Tap]</literal> section only applies for netdevs of kind
430 <literal>tap</literal>, and accepts the same keys as the
431 <literal>[Tun]</literal> section.</para>
432 </refsect1>
433
434 <refsect1>
435 <title>[Bond] Section Options</title>
436
437 <para>The <literal>[Bond]</literal> section accepts the following
438 key:</para>
439
440 <variablelist class='network-directives'>
441 <varlistentry>
442 <term><varname>Mode=</varname></term>
443 <listitem>
444 <para>Specifies one of the bonding policies. The default is
445 <literal>balance-rr</literal> (round robin). Possible values are
446 <literal>balance-rr</literal>,
447 <literal>active-backup</literal>,
448 <literal>balance-xor</literal>,
449 <literal>broadcast</literal>,
450 <literal>802.3ad</literal>,
451 <literal>balance-tlb</literal>, and
452 <literal>balance-alb</literal>.
453 </para>
454 </listitem>
455 </varlistentry>
456
457 <varlistentry>
458 <term><varname>TransmitHashPolicy=</varname></term>
459 <listitem>
460 <para>Selects the transmit hash policy to use for slave selection in
461 balance-xor, 802.3ad, and tlb modes. Possible values are
462 <literal>layer2</literal>,
463 <literal>layer3+4</literal>,
464 <literal>layer2+3</literal>,
465 <literal>encap2+3</literal>,
466 <literal>802.3ad</literal>, and
467 <literal>encap3+4</literal>.
468 </para>
469 </listitem>
470 </varlistentry>
471
472 <varlistentry>
473 <term><varname>LACPTransmitRate=</varname></term>
474 <listitem>
475 <para>Specifies the rate with which link partner
476 transmits Link Aggregation Control Protocol Data Unit packets
477 in 802.3ad mode. Possible values are
478 <literal>slow</literal>, which requests partner to transmit LACPDUs every 30 seconds, and
479 <literal>fast</literal>, which requests partner to transmit LACPDUs every second.
480 The default value is <literal>slow</literal>.</para>
481 </listitem>
482 </varlistentry>
483
484 <varlistentry>
485 <term><varname>MIIMonitorSec=</varname></term>
486 <listitem>
487 <para>Specifies the frequency that Media Independent Interface link
488 monitoring will occur. A value of zero disables MII link monitoring.
489 This values is rounded down to the nearest millisecond. The default
490 value is 0.</para>
491 </listitem>
492 </varlistentry>
493
494 <varlistentry>
495 <term><varname>UpDelaySec=</varname></term>
496 <listitem>
497 <para>Specifies the delay before a link is enabled after a link up
498 status has been detected. This value is rounded down to a multiple of
499 MIIMonitorSec. The default value is 0.</para>
500 </listitem>
501 </varlistentry>
502
503 <varlistentry>
504 <term><varname>DownDelaySec=</varname></term>
505 <listitem>
506 <para>Specifies the delay before a link is disabled after a link down
507 status has been detected. This value is rounded down to a multiple of
508 MIIMonitorSec. The default value is 0.</para>
509 </listitem>
510 </varlistentry>
511
512 </variablelist>
513 </refsect1>
514
515 <refsect1>
516 <title>Example</title>
517 <example>
518 <title>/etc/systemd/network/bridge.netdev</title>
519
520 <programlisting>[NetDev]
521 Name=bridge0
522 Kind=bridge</programlisting>
523 </example>
524
525 <example>
526 <title>/etc/systemd/network/vlan1.netdev</title>
527
528 <programlisting>[Match]
529 Virtualization=no
530
531 [NetDev]
532 Name=vlan1
533 Kind=vlan
534
535 [VLAN]
536 Id=1</programlisting>
537 </example>
538 <example>
539 <title>/etc/systemd/network/ipip.netdev</title>
540 <programlisting>[NetDev]
541 Name=ipip-tun
542 Kind=ipip
543 MTUBytes=1480
544
545 [Tunnel]
546 Local=192.168.223.238
547 Remote=192.169.224.239
548 TTL=64</programlisting>
549 </example>
550 <example>
551 <title>/etc/systemd/network/tap.netdev</title>
552 <programlisting>[NetDev]
553 Name=tap-test
554 Kind=tap
555
556 [Tap]
557 MultiQueue=true
558 PacketInfo=true</programlisting> </example>
559
560 <example>
561 <title>/etc/systemd/network/sit.netdev</title>
562 <programlisting>[NetDev]
563 Name=sit-tun
564 Kind=sit
565 MTUBytes=1480
566
567 [Tunnel]
568 Local=10.65.223.238
569 Remote=10.65.223.239</programlisting>
570 </example>
571
572 <example>
573 <title>/etc/systemd/network/gre.netdev</title>
574 <programlisting>[NetDev]
575 Name=gre-tun
576 Kind=gre
577 MTUBytes=1480
578
579 [Tunnel]
580 Local=10.65.223.238
581 Remote=10.65.223.239</programlisting>
582 </example>
583
584 <example>
585 <title>/etc/systemd/network/vti.netdev</title>
586
587 <programlisting>[NetDev]
588 Name=vti-tun
589 Kind=vti
590 MTUBytes=1480
591
592 [Tunnel]
593 Local=10.65.223.238
594 Remote=10.65.223.239</programlisting>
595 </example>
596
597 <example>
598 <title>/etc/systemd/network/veth.netdev</title>
599 <programlisting>[NetDev]
600 Name=veth-test
601 Kind=veth
602
603 [Peer]
604 Name=veth-peer</programlisting>
605 </example>
606
607 <example>
608 <title>/etc/systemd/network/dummy.netdev</title>
609 <programlisting>[NetDev]
610 Name=dummy-test
611 Kind=dummy
612 MACAddress=12:34:56:78:9a:bc</programlisting>
613 </example>
614
615 </refsect1>
616 <refsect1>
617 <title>See Also</title>
618 <para>
619 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
620 <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
621 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>
622 </para>
623 </refsect1>
624
625 </refentry>