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">
6 This file is part of systemd.
8 Copyright 2013 Tom Gundersen
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.
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.
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/>.
24 <refentry id="systemd.netdev" conditional='ENABLE_NETWORKD'>
27 <title>systemd.network</title>
28 <productname>systemd</productname>
32 <contrib>Developer</contrib>
33 <firstname>Tom</firstname>
34 <surname>Gundersen</surname>
35 <email>teg@jklm.no</email>
41 <refentrytitle>systemd.netdev</refentrytitle>
42 <manvolnum>5</manvolnum>
46 <refname>systemd.netdev</refname>
47 <refpurpose>Virtual Network Device configuration</refpurpose>
51 <para><filename><replaceable>netdev</replaceable>.netdev</filename></para>
55 <title>Description</title>
57 <para>Network setup is performed by
58 <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
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>
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>
87 <title>[Match] Section Options</title>
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>
93 <variablelist class='network-directives'>
95 <term><varname>Host=</varname></term>
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>
105 <term><varname>Virtualization=</varname></term>
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>
116 <term><varname>KernelCommandLine=</varname></term>
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>
127 <term><varname>Architecture=</varname></term>
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>
141 <title>[NetDev] Section Options</title>
143 <para>The <literal>[NetDev]</literal> section accepts the following
146 <variablelist class='network-directives'>
148 <term><varname>Description=</varname></term>
150 <para>A free-form description of the netdev.
155 <term><varname>Name=</varname></term>
157 <para>The interface name used when creating the
158 netdev. This option is compulsory.</para>
162 <term><varname>Kind=</varname></term>
164 <para>The netdev kind. Currently, <literal>bridge</literal>,
165 <literal>bond</literal>, <literal>vlan</literal>,
166 <literal>macvlan</literal>,
167 <literal>ipvlan</literal>, <literal>vxlan</literal>,
168 <literal>ipip</literal>, <literal>gre</literal>,
169 <literal>gretap</literal>, <literal>sit</literal>,
170 <literal>vti</literal>, <literal>veth</literal>,
171 <literal>tun</literal>, <literal>tap</literal> and
172 <literal>dummy</literal>
173 are supported. This option is compulsory.</para>
177 <term><varname>MTUBytes=</varname></term>
179 <para>The maximum transmission unit in bytes to
180 set for the device. The usual suffixes K, M, G,
181 are supported and are understood to the base of
182 1024. This key is not currently suported for
183 <literal>tun</literal> or <literal>tap</literal> devices.
188 <term><varname>MACAddress=</varname></term>
190 <para>The MAC address to use for the device.
191 If none is given, one is generated based on
192 the interface name and the
193 <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
194 This key is not currently suported for <literal>tun</literal> or <literal>tap</literal> devices.
202 <title>[VLAN] Section Options</title>
204 <para>The <literal>[VLAN]</literal> section only applies for netdevs of kind <literal>vlan</literal>,
205 and accepts the following key:</para>
207 <variablelist class='network-directives'>
209 <term><varname>Id=</varname></term>
211 <para>The VLAN ID to use. An integer in the range 0–4094.
212 This option is compulsory.</para>
220 <title>[MACVLAN] Section Options</title>
222 <para>The <literal>[MACVLAN]</literal> section only applies for netdevs of kind
223 <literal>macvlan</literal>, and accepts the following key:</para>
225 <variablelist class='network-directives'>
227 <term><varname>Mode=</varname></term>
229 <para>The MACVLAN mode to use. The supported options are
230 <literal>private</literal>, <literal>vepa</literal>,
231 <literal>bridge</literal> and <literal>passthru</literal>.
240 <title>[IPVLAN] Section Options</title>
242 <para>The <literal>[IPVLAN]</literal> section only applies for netdevs of kind
243 <literal>ipvlan</literal>, and accepts the following key:</para>
245 <variablelist class='network-directives'>
247 <term><varname>Mode=</varname></term>
249 <para>The IPVLAN mode to use. The supported options are
250 <literal>L2</literal> and <literal>L3</literal>.
259 <title>[VXLAN] Section Options</title>
260 <para>The <literal>[VXLAN]</literal> section only applies for netdevs of kind
261 <literal>vxlan</literal>, and accepts the following key:</para>
263 <variablelist class='network-directives'>
265 <term><varname>Id=</varname></term>
267 <para>The VXLAN ID to use.</para>
271 <term><varname>Group=</varname></term>
273 <para>An assigned multicast group IP address.</para>
277 <term><varname>TOS=</varname></term>
279 <para>The Type Of Service byte value for a vxlan interface.</para>
283 <term><varname>TTL=</varname></term>
285 <para>A fixed Time To Live N on Virtual eXtensible Local Area Network packets.
286 N is a number in the range 1-255. 0 is a special value meaning that packets
287 inherit the TTL value.</para>
291 <term><varname>MacLearning=</varname></term>
293 <para>A boolean. When true, enables dynamic MAC learning
294 to discover remote MAC addresses.</para>
298 <term><varname>FDBAgeingSec=</varname></term>
300 <para>The lifetime of Forwarding Database entry learnt by the kernel in seconds.</para>
304 <term><varname>ARPProxy=</varname></term>
306 <para>A boolean. When true, enables ARP proxy.</para>
310 <term><varname>L2MissNotification=</varname></term>
312 <para>A boolean. When true, enables netlink LLADDR miss notifications.</para>
316 <term><varname>L3MissNotification=</varname></term>
318 <para>A boolean. When true, enables netlink IP ADDR miss notifications.</para>
322 <term><varname>RouteShortCircuit=</varname></term>
324 <para>A boolean. When true route short circuit is turned on.</para>
330 <title>[Tunnel] Section Options</title>
332 <para>The <literal>[Tunnel]</literal> section only applies for netdevs of kind
333 <literal>ipip</literal>, <literal>sit</literal>, <literal>gre</literal>, <literal>gretap</literal>,
334 <literal>ip6gre</literal>, <literal>ip6gretap</literal>, <literal>vti</literal> and <literal>ip6tnl</literal>
335 and accepts the following keys:</para>
337 <variablelist class='network-directives'>
339 <term><varname>Local=</varname></term>
341 <para>A static local address for tunneled packets.
342 It must be an address on another interface of this host.</para>
346 <term><varname>Remote=</varname></term>
348 <para>The remote endpoint of the tunnel.</para>
352 <term><varname>TOS=</varname></term>
354 <para>The Type Of Service byte value for a tunnel interface.
355 For details about the TOS see the
356 <ulink url="http://tools.ietf.org/html/rfc1349">
357 Type of Service in the Internet Protocol Suite
363 <term><varname>TTL=</varname></term>
365 <para>A fixed Time To Live N on tunneled packets.
366 N is a number in the range 1-255. 0 is a special value meaning that packets
367 inherit the TTL value. The default value for IPv4 tunnels is: inherit.
368 The default value for IPv6 tunnels is: 64.</para>
372 <term><varname>DiscoverPathMTU=</varname></term>
374 <para>A boolean. When true, enables Path MTU Discovery on the tunnel.</para>
378 <term><varname>Mode=</varname></term>
380 <para>IPv6 tunnels can have three modes:
381 <literal>ip6ip6</literal>,
382 <literal>ip4ipv6</literal>,
383 <literal>any</literal>
389 <term><varname>Mode=</varname></term>
391 <para>The mode specifies the ip6 tunnel protocol. Supported type are </para>
397 <title>[Peer] Section Options</title>
399 <para>The <literal>[Peer]</literal> section only applies for netdevs of kind <literal>veth</literal>
400 and accepts the following key:</para>
402 <variablelist class='network-directives'>
404 <term><varname>Name=</varname></term>
406 <para>The interface name used when creating the netdev.
407 This option is compulsory.</para>
411 <term><varname>MACAddress=</varname></term>
413 <para>The peer MACAddress, if not set it is generated in the same
414 way as the MAC address of the main interface.</para>
420 <title>[Tun] Section Options</title>
422 <para>The <literal>[Tun]</literal> section only applies for netdevs of kind
423 <literal>tun</literal>, and accepts the following keys:</para>
425 <variablelist class='network-directives'>
427 <term><varname>OneQueue=</varname></term>
428 <listitem><para>Takes a boolean argument. Configures whether
429 all packets are queued at the device (enabled), or a fixed number
430 of packets are queued at the device and the rest at the
431 <literal>qdisc</literal>. Defaults to <literal>no</literal>.</para>
435 <term><varname>MultiQueue=</varname></term>
436 <listitem><para>Takes a boolean argument. Configures whether to
437 use multiple file descriptors (queues) to parallelize packets
438 sending and receiving. Defaults to <literal>no</literal>.</para>
442 <term><varname>PacketInfo=</varname></term>
443 <listitem><para>Takes a boolean argument. Configures whether packets
444 should be prepened with four extra bytes (two flag bytes and two
445 protocol bytes). If disabled it indicates that the packets will be
446 pure IP packets. Defaults to <literal>no</literal>.</para>
450 <term><varname>User=</varname></term>
451 <listitem><para>User to grant access to the <filename>/dev/net/tun</filename>
456 <term><varname>Group=</varname></term>
457 <listitem><para>Group to grant access to the <filename>/dev/net/tun</filename>
467 <title>[Tap] Section Options</title>
469 <para>The <literal>[Tap]</literal> section only applies for netdevs of kind
470 <literal>tap</literal>, and accepts the same keys as the
471 <literal>[Tun]</literal> section.</para>
475 <title>[Bond] Section Options</title>
477 <para>The <literal>[Bond]</literal> section accepts the following
480 <variablelist class='network-directives'>
482 <term><varname>Mode=</varname></term>
484 <para>Specifies one of the bonding policies. The default is
485 <literal>balance-rr</literal> (round robin). Possible values are
486 <literal>balance-rr</literal>,
487 <literal>active-backup</literal>,
488 <literal>balance-xor</literal>,
489 <literal>broadcast</literal>,
490 <literal>802.3ad</literal>,
491 <literal>balance-tlb</literal>, and
492 <literal>balance-alb</literal>.
498 <term><varname>TransmitHashPolicy=</varname></term>
500 <para>Selects the transmit hash policy to use for slave selection in
501 balance-xor, 802.3ad, and tlb modes. Possible values are
502 <literal>layer2</literal>,
503 <literal>layer3+4</literal>,
504 <literal>layer2+3</literal>,
505 <literal>encap2+3</literal>,
506 <literal>802.3ad</literal>, and
507 <literal>encap3+4</literal>.
513 <term><varname>LACPTransmitRate=</varname></term>
515 <para>Specifies the rate with which link partner
516 transmits Link Aggregation Control Protocol Data Unit packets
517 in 802.3ad mode. Possible values are
518 <literal>slow</literal>, which requests partner to transmit LACPDUs every 30 seconds, and
519 <literal>fast</literal>, which requests partner to transmit LACPDUs every second.
520 The default value is <literal>slow</literal>.</para>
525 <term><varname>MIIMonitorSec=</varname></term>
527 <para>Specifies the frequency that Media Independent Interface link
528 monitoring will occur. A value of zero disables MII link monitoring.
529 This values is rounded down to the nearest millisecond. The default
535 <term><varname>UpDelaySec=</varname></term>
537 <para>Specifies the delay before a link is enabled after a link up
538 status has been detected. This value is rounded down to a multiple of
539 MIIMonitorSec. The default value is 0.</para>
544 <term><varname>DownDelaySec=</varname></term>
546 <para>Specifies the delay before a link is disabled after a link down
547 status has been detected. This value is rounded down to a multiple of
548 MIIMonitorSec. The default value is 0.</para>
556 <title>Example</title>
558 <title>/etc/systemd/network/bridge.netdev</title>
560 <programlisting>[NetDev]
562 Kind=bridge</programlisting>
566 <title>/etc/systemd/network/vlan1.netdev</title>
568 <programlisting>[Match]
576 Id=1</programlisting>
579 <title>/etc/systemd/network/ipip.netdev</title>
580 <programlisting>[NetDev]
586 Local=192.168.223.238
587 Remote=192.169.224.239
588 TTL=64</programlisting>
591 <title>/etc/systemd/network/tap.netdev</title>
592 <programlisting>[NetDev]
598 PacketInfo=true</programlisting> </example>
601 <title>/etc/systemd/network/sit.netdev</title>
602 <programlisting>[NetDev]
609 Remote=10.65.223.239</programlisting>
613 <title>/etc/systemd/network/gre.netdev</title>
614 <programlisting>[NetDev]
621 Remote=10.65.223.239</programlisting>
625 <title>/etc/systemd/network/vti.netdev</title>
627 <programlisting>[NetDev]
634 Remote=10.65.223.239</programlisting>
638 <title>/etc/systemd/network/veth.netdev</title>
639 <programlisting>[NetDev]
644 Name=veth-peer</programlisting>
648 <title>/etc/systemd/network/dummy.netdev</title>
649 <programlisting>[NetDev]
652 MACAddress=12:34:56:78:9a:bc</programlisting>
657 <title>See Also</title>
659 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
660 <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
661 <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
662 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>