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-networkd.service">
27 <title>systemd-networkd.service</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-networkd.service</refentrytitle>
42 <manvolnum>8</manvolnum>
46 <refname>systemd-networkd.service</refname>
47 <refname>systemd-networkd</refname>
48 <refpurpose>Network manager</refpurpose>
52 <para><filename>systemd-networkd.service</filename></para>
53 <para><filename>/usr/lib/systemd/systemd-networkd</filename></para>
57 <title>Description</title>
59 <para><command>systemd-networkd</command> is a system
60 service that manages networks. It detects and configures
61 network devices as they appear.</para>
63 <para>Network devices are managed by networkd only if they
64 have the udev tag <literal>systemd-networkd</literal>.</para>
66 <para>Network configurations applied before networkd is started
67 are not removed, and configuration applied by networkd are not
68 removed when networkd exits. This ensures restarting networkd
69 does not cut the network connection, and in particular that it
70 is safe to transition between the initrd and the real root,
74 <refsect1><title>Network Configuration</title>
75 <para>The network files are read from the files located in the
76 system network directory <filename>/usr/lib/systemd/network</filename>,
77 the volatile runtime network directory
78 <filename>/run/systemd/network</filename> and the local administration
79 network directory <filename>/etc/systemd/network</filename>.
80 All link files are collectively sorted and processed in lexical order,
81 regardless of the directories in which they live. However, files with
82 identical filenames replace each other. Files in
83 <filename>/etc</filename> have the highest priority, files in
84 <filename>/run</filename> take precedence over files with the same
85 name in <filename>/lib</filename>. This can be used to override a
86 system-supplied network file with a local file if needed; a symlink in
87 <filename>/etc</filename> with the same name as a network file in
88 <filename>/lib</filename>, pointing to <filename>/dev/null</filename>,
89 disables the network file entirely. Network files must have the extension
90 <filename>.network</filename>; other extensions are ignored.</para>
92 <para>The network file contains a <literal>[Match]</literal> section,
93 which determines if a given network file may be applied to a given device;
94 and a <literal>[Network]</literal> section specifying how the device should
95 be configured. The first (in lexical order) of the network files that
96 matches a given device is applied.</para>
98 <para>A network file is said to match a device if each of the entries in the
99 <literal>[Match]</literal> section matches, or if the section is empty.
100 The following keys are accepted:</para>
102 <variablelist class='network-directives'>
104 <term><varname>MACAddress</varname></term>
106 <para>The hardware address.</para>
110 <term><varname>Path</varname></term>
112 <para>The persistent path, as exposed by the udev
113 property <literal>ID_PATH</literal>.</para>
117 <term><varname>Driver</varname></term>
119 <para>The driver currently bound to the device, as
120 exposed by the udev property <literal>DRIVER</literal>.
125 <term><varname>Type</varname></term>
127 <para>The device type, as exposed by the udev property
128 <literal>DEVTYPE</literal>.</para>
132 <term><varname>Name</varname></term>
134 <para>The device name, as exposed by the udev property
135 <literal>INTERFACE</literal>.</para>
140 <para>The <literal>[Network]</literal> section accepts the following keys:</para>
142 <variablelist class='network-directives'>
144 <term><varname>Description</varname></term>
146 <para>A description of the device. This is only used for
147 presentation purposes.</para>
151 <term><varname>Address</varname></term>
153 <para>A static IPv4 or IPv6 address and its prefix length,
154 separated by a '/' character. The format of the address must
156 <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>
161 <term><varname>Gateway</varname></term>
163 <para>The gateway address, which must be in the format described in
164 <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>
172 <title>See Also</title>
174 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
175 <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>,