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.</para>
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>
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>
85 <variablelist class='network-directives'>
87 <term><varname>Host=</varname></term>
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>
97 <term><varname>Virtualization=</varname></term>
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>
108 <term><varname>KernelCommandLine=</varname></term>
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>
119 <term><varname>Architecture=</varname></term>
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>
130 <para>The <literal>[NetDev]</literal> section accepts the following
133 <variablelist class='network-directives'>
135 <term><varname>Name=</varname></term>
137 <para>The interface name used when creating the
138 netdev. This option is compulsory.</para>
142 <term><varname>Kind=</varname></term>
144 <para>The netdev kind. Currently, <literal>bridge</literal>,
145 <literal>bond</literal>, <literal>vlan</literal> and
146 <literal>macvlan</literal> are supported. This option
147 is compulsory.</para>
152 <para>The <literal>[VLAN]</literal> section only applies for netdevs of kind <literal>vlan</literal>,
153 and accepts the following key:</para>
155 <variablelist class='network-directives'>
157 <term><varname>Id=</varname></term>
159 <para>The VLAN ID to use. An integer in the range 0–4094.
160 This option is compulsory.</para>
165 <para>The <literal>[MACVLAN]</literal> section only applies for netdevs of kind
166 <literal>macvlan</literal>, and accepts the following key:</para>
168 <variablelist class='network-directives'>
170 <term><varname>Mode=</varname></term>
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>.
183 <title>Example</title>
185 <title>/etc/systemd/network/bridge.netdev</title>
187 <programlisting>[NetDev]
189 Kind=bridge</programlisting>
193 <title>/etc/systemd/network/vlan1.netdev</title>
195 <programlisting>[Match]
203 Id=1</programlisting>
209 <title>See Also</title>
211 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
212 <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
213 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>