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>vti</literal> and <literal>ip6tnl</literal> and accepts the following keys:</para>
336 <variablelist class='network-directives'>
338 <term><varname>Local=</varname></term>
340 <para>A static local address for tunneled packets.
341 It must be an address on another interface of this host.</para>
345 <term><varname>Remote=</varname></term>
347 <para>The remote endpoint of the tunnel.</para>
351 <term><varname>TOS=</varname></term>
353 <para>The Type Of Service byte value for a tunnel interface.
354 For details about the TOS see the
355 <ulink url="http://tools.ietf.org/html/rfc1349">
356 Type of Service in the Internet Protocol Suite
362 <term><varname>TTL=</varname></term>
364 <para>A fixed Time To Live N on tunneled packets.
365 N is a number in the range 1-255. 0 is a special value meaning that packets
366 inherit the TTL value. The default value for IPv4 tunnels is: inherit.
367 The default value for IPv6 tunnels is: 64.</para>
371 <term><varname>DiscoverPathMTU=</varname></term>
373 <para>A boolean. When true, enables Path MTU Discovery on the tunnel.</para>
377 <term><varname>Mode=</varname></term>
379 <para>IPv6 tunnels can have three mode
380 <literal>ip6ip6</literal>
381 <literal>ip4ipv6</literal>,
382 <literal>any</literal>
388 <term><varname>Mode=</varname></term>
390 <para>The mode specifies the ip6 tunnel protocol. Supported type are </para>
396 <title>[Peer] Section Options</title>
398 <para>The <literal>[Peer]</literal> section only applies for netdevs of kind <literal>veth</literal>
399 and accepts the following key:</para>
401 <variablelist class='network-directives'>
403 <term><varname>Name=</varname></term>
405 <para>The interface name used when creating the netdev.
406 This option is compulsory.</para>
410 <term><varname>MACAddress=</varname></term>
412 <para>The peer MACAddress, if not set it is generated in the same
413 way as the MAC address of the main interface.</para>
419 <title>[Tun] Section Options</title>
421 <para>The <literal>[Tun]</literal> section only applies for netdevs of kind
422 <literal>tun</literal>, and accepts the following keys:</para>
424 <variablelist class='network-directives'>
426 <term><varname>OneQueue=</varname></term>
427 <listitem><para>Takes a boolean argument. Configures whether
428 all packets are queued at the device (enabled), or a fixed number
429 of packets are queued at the device and the rest at the
430 <literal>qdisc</literal>. Defaults to <literal>no</literal>.</para>
434 <term><varname>MultiQueue=</varname></term>
435 <listitem><para>Takes a boolean argument. Configures whether to
436 use multiple file descriptors (queues) to parallelize packets
437 sending and receiving. Defaults to <literal>no</literal>.</para>
441 <term><varname>PacketInfo=</varname></term>
442 <listitem><para>Takes a boolean argument. Configures whether packets
443 should be prepened with four extra bytes (two flag bytes and two
444 protocol bytes). If disabled it indicates that the packets will be
445 pure IP packets. Defaults to <literal>no</literal>.</para>
449 <term><varname>User=</varname></term>
450 <listitem><para>User to grant access to the <filename>/dev/net/tun</filename>
455 <term><varname>Group=</varname></term>
456 <listitem><para>Group to grant access to the <filename>/dev/net/tun</filename>
466 <title>[Tap] Section Options</title>
468 <para>The <literal>[Tap]</literal> section only applies for netdevs of kind
469 <literal>tap</literal>, and accepts the same keys as the
470 <literal>[Tun]</literal> section.</para>
474 <title>[Bond] Section Options</title>
476 <para>The <literal>[Bond]</literal> section accepts the following
479 <variablelist class='network-directives'>
481 <term><varname>Mode=</varname></term>
483 <para>Specifies one of the bonding policies. The default is
484 <literal>balance-rr</literal> (round robin). Possible values are
485 <literal>balance-rr</literal>,
486 <literal>active-backup</literal>,
487 <literal>balance-xor</literal>,
488 <literal>broadcast</literal>,
489 <literal>802.3ad</literal>,
490 <literal>balance-tlb</literal>, and
491 <literal>balance-alb</literal>.
497 <term><varname>TransmitHashPolicy=</varname></term>
499 <para>Selects the transmit hash policy to use for slave selection in
500 balance-xor, 802.3ad, and tlb modes. Possible values are
501 <literal>layer2</literal>,
502 <literal>layer3+4</literal>,
503 <literal>layer2+3</literal>,
504 <literal>encap2+3</literal>,
505 <literal>802.3ad</literal>, and
506 <literal>encap3+4</literal>.
512 <term><varname>LACPTransmitRate=</varname></term>
514 <para>Specifies the rate with which link partner
515 transmits Link Aggregation Control Protocol Data Unit packets
516 in 802.3ad mode. Possible values are
517 <literal>slow</literal>, which requests partner to transmit LACPDUs every 30 seconds, and
518 <literal>fast</literal>, which requests partner to transmit LACPDUs every second.
519 The default value is <literal>slow</literal>.</para>
524 <term><varname>MIIMonitorSec=</varname></term>
526 <para>Specifies the frequency that Media Independent Interface link
527 monitoring will occur. A value of zero disables MII link monitoring.
528 This values is rounded down to the nearest millisecond. The default
534 <term><varname>UpDelaySec=</varname></term>
536 <para>Specifies the delay before a link is enabled after a link up
537 status has been detected. This value is rounded down to a multiple of
538 MIIMonitorSec. The default value is 0.</para>
543 <term><varname>DownDelaySec=</varname></term>
545 <para>Specifies the delay before a link is disabled after a link down
546 status has been detected. This value is rounded down to a multiple of
547 MIIMonitorSec. The default value is 0.</para>
555 <title>Example</title>
557 <title>/etc/systemd/network/bridge.netdev</title>
559 <programlisting>[NetDev]
561 Kind=bridge</programlisting>
565 <title>/etc/systemd/network/vlan1.netdev</title>
567 <programlisting>[Match]
575 Id=1</programlisting>
578 <title>/etc/systemd/network/ipip.netdev</title>
579 <programlisting>[NetDev]
585 Local=192.168.223.238
586 Remote=192.169.224.239
587 TTL=64</programlisting>
590 <title>/etc/systemd/network/tap.netdev</title>
591 <programlisting>[NetDev]
597 PacketInfo=true</programlisting> </example>
600 <title>/etc/systemd/network/sit.netdev</title>
601 <programlisting>[NetDev]
608 Remote=10.65.223.239</programlisting>
612 <title>/etc/systemd/network/gre.netdev</title>
613 <programlisting>[NetDev]
620 Remote=10.65.223.239</programlisting>
624 <title>/etc/systemd/network/vti.netdev</title>
626 <programlisting>[NetDev]
633 Remote=10.65.223.239</programlisting>
637 <title>/etc/systemd/network/veth.netdev</title>
638 <programlisting>[NetDev]
643 Name=veth-peer</programlisting>
647 <title>/etc/systemd/network/dummy.netdev</title>
648 <programlisting>[NetDev]
651 MACAddress=12:34:56:78:9a:bc</programlisting>
656 <title>See Also</title>
658 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
659 <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
660 <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
661 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>