systemd-networkd.service.xml revision eb27aeca247a4cf8816fffc4c0dbcab55ead3864
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek<?xml version='1.0'?> <!--*-nxml-*-->
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek This file is part of systemd.
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek Copyright 2013 Tom Gundersen
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek systemd is free software; you can redistribute it and/or modify it
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek under the terms of the GNU Lesser General Public License as published by
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek the Free Software Foundation; either version 2.1 of the License, or
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek (at your option) any later version.
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek systemd is distributed in the hope that it will be useful, but
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek WITHOUT ANY WARRANTY; without even the implied warranty of
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek Lesser General Public License for more details.
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek You should have received a copy of the GNU Lesser General Public License
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek along with systemd; If not, see <http://www.gnu.org/licenses/>.
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek<refentry id="systemd-networkd.service" conditional='ENABLE_NETWORKD'>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <title>systemd-networkd.service</title>
c6878637502b1717a110a9a7e8bba32a8583fcdfLennart Poettering </refentryinfo>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <refentrytitle>systemd-networkd.service</refentrytitle>
958b66ea16deddd794b3a52643bd44633e165eadLennart Poettering <refname>systemd-networkd.service</refname>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <refsynopsisdiv>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para><filename>systemd-networkd.service</filename></para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para><filename>/usr/lib/systemd/systemd-networkd</filename></para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek </refsynopsisdiv>
875c2e220e2611165e09051c4747971811f1de58Lennart Poettering <para><command>systemd-networkd</command> is a system
74df0fca09b3c31ed19e14ba80f996fdff772417Lennart Poettering service that manages networks. It detects and configures
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek network devices as they appear, as well as creating virtual
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek network devices.</para>
26687bf8a907009dedcff79346860ed41511405eOleksii Shevchuk <para>Network configurations applied before networkd is started
7f1ad696a273703789b624fe0b209fb63e953016Lennart Poettering are not removed, and configuration applied by networkd are not
7f1ad696a273703789b624fe0b209fb63e953016Lennart Poettering removed when networkd exits. This ensures restarting networkd
e150e82097211f09b911c7784a89ef9efed713caMichał Bartoszkiewicz does not cut the network connection, and, in particular, that
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek it is safe to transition between the initrd and the real root,
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek and back.</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <refsect1><title>Configuration Files</title>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>The configuration files are read from the files located in the
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek system network directory <filename>/usr/lib/systemd/network</filename>,
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek the volatile runtime network directory
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <filename>/run/systemd/network</filename> and the local administration
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek network directory <filename>/etc/systemd/network</filename>.
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek All configuration files are collectively sorted and processed in lexical order,
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek regardless of the directories in which they live. However, files with
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek identical filenames replace each other. Files in
2c5859afecee81e345fc9526b1083bf79990ffb8Daniel Mack <filename>/etc</filename> have the highest priority, files in
2c5859afecee81e345fc9526b1083bf79990ffb8Daniel Mack <filename>/run</filename> take precedence over files with the same
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek name in <filename>/usr/lib</filename>. This can be used to override a
2c5859afecee81e345fc9526b1083bf79990ffb8Daniel Mack system-supplied configuration file with a local file if needed; a symlink in
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <filename>/etc</filename> with the same name as a configuration file in
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <filename>/usr/lib</filename>, pointing to <filename>/dev/null</filename>,
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek disables the configuration file entirely.</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <refsect2><title>Virtual Network Devices</title>
670b110c3b59dfa335ac43065b2038400d1d04a9Zbigniew Jędrzejewski-Szmek <para>Netdev files must have the extension <filename>.netdev</filename>;
db91ea32aa223d1b087d99811226a9c59a1bb281Zbigniew Jędrzejewski-Szmek other extensions are ignored. Virtual network devices are created as soon
7fd1b19bc9e9f5574f2877936b8ac267c7706947Harald Hoyer as networkd is started.</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>The <literal>[Netdev]</literal> section accepts the following
670b110c3b59dfa335ac43065b2038400d1d04a9Zbigniew Jędrzejewski-Szmek <term><varname>Name</varname></term>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>The interface name used when creating the
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek bridge. This option is compulsory.</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <term><varname>Kind</varname></term>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>The netdev kind. Currently, 'bridge', 'bond' and 'vlan'
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek are supported. This option is compulsory.</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>The <literal>[VLAN]</literal> section only applies for netdevs of kind 'vlan',
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek and accepts the following keys:</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <variablelist class='network-directives'>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <term><varname>Id</varname></term>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>The VLAN ID to use. This option is compulsory.</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <refsect2><title>Networks</title>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>Network files must have the extension <filename>.network</filename>;
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek other extensions are ignored. Networks are applied to links whenever the links
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>The network file contains a <literal>[Match]</literal> section,
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek which determines if a given network file may be applied to a given device;
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek and a <literal>[Network]</literal> section specifying how the device should
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek be configured. The first (in lexical order) of the network files that
0371ca0dac1d70b2e5060a3c4e6fbbc2bdbd8671Florian Weimer matches a given device is applied.</para>
0371ca0dac1d70b2e5060a3c4e6fbbc2bdbd8671Florian Weimer <para>A network file is said to match a device if each of the entries in the
0371ca0dac1d70b2e5060a3c4e6fbbc2bdbd8671Florian Weimer <literal>[Match]</literal> section matches, or if the section is empty.
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek The following keys are accepted:</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <variablelist class='network-directives'>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <term><varname>MACAddress</varname></term>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>The hardware address.</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <term><varname>Path</varname></term>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>The persistent path, as exposed by the udev
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek property <literal>ID_PATH</literal>.</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <term><varname>Driver</varname></term>
348ced909724a1331b85d57aede80a102a00e428Zbigniew Jędrzejewski-Szmek <para>The driver currently bound to the device, as
348ced909724a1331b85d57aede80a102a00e428Zbigniew Jędrzejewski-Szmek exposed by the udev property <literal>DRIVER</literal>.
348ced909724a1331b85d57aede80a102a00e428Zbigniew Jędrzejewski-Szmek <term><varname>Type</varname></term>
348ced909724a1331b85d57aede80a102a00e428Zbigniew Jędrzejewski-Szmek <para>The device type, as exposed by the udev property
348ced909724a1331b85d57aede80a102a00e428Zbigniew Jędrzejewski-Szmek <literal>DEVTYPE</literal>.</para>
670b110c3b59dfa335ac43065b2038400d1d04a9Zbigniew Jędrzejewski-Szmek <term><varname>Name</varname></term>
670b110c3b59dfa335ac43065b2038400d1d04a9Zbigniew Jędrzejewski-Szmek <para>The device name, as exposed by the udev property
670b110c3b59dfa335ac43065b2038400d1d04a9Zbigniew Jędrzejewski-Szmek <literal>INTERFACE</literal>.</para>
da2e288bbc4d8cebaa1d38a80f6eec8cde3e9cceLennart Poettering </varlistentry>
da2e288bbc4d8cebaa1d38a80f6eec8cde3e9cceLennart Poettering </variablelist>
da2e288bbc4d8cebaa1d38a80f6eec8cde3e9cceLennart Poettering <para>The <literal>[Network]</literal> section accepts the following keys:</para>
670b110c3b59dfa335ac43065b2038400d1d04a9Zbigniew Jędrzejewski-Szmek <variablelist class='network-directives'>
670b110c3b59dfa335ac43065b2038400d1d04a9Zbigniew Jędrzejewski-Szmek <term><varname>Description</varname></term>
348ced909724a1331b85d57aede80a102a00e428Zbigniew Jędrzejewski-Szmek <para>A description of the device. This is only used for
670b110c3b59dfa335ac43065b2038400d1d04a9Zbigniew Jędrzejewski-Szmek presentation purposes.</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <term><varname>DHCP</varname></term>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>A boolean. When true enables basic DHCPv4 support.</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <term><varname>Address</varname></term>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>A static IPv4 or IPv6 address and its prefix length,
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek separated by a '/' character. The format of the address must
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek be as described in
4608af4333d0f7f5f8e3bc632801b04ef07d246dLennart Poettering <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek . This is a short-hand for an [Address] section only containing an Address key (see below).</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>The gateway address, which must be in the format described in
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek . This is a short-hand for a [Route] section only containing a Gateway key.</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <term><varname>DNS</varname></term>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>A DNS server address, which must be in the format described in
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>
56f64d95763a799ba4475daf44d8e9f72a1bd474Michal Schmidt <varlistentry>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <term><varname>Bridge</varname></term>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>The name of the bridge to add the configured link to.</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <term><varname>Bond</varname></term>
23ad4dd8844c582929115a11ed2830a1371568d6Jan Alexander Steffens (heftig) <para>The name of the bond to add the configured link to.</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>The <literal>[Address]</literal> section accepts the following keys:</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <variablelist class='network-directives'>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <term><varname>Address</varname></term>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>As in the <literal>[Network]</literal> section. This key is mandatory.</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <term><varname>Label</varname></term>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>The <literal>[Route]</literal> section accepts the following keys:</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <variablelist class='network-directives'>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <term><varname>Gateway</varname></term>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>As in the <literal>[Network]</literal> section. This key is mandatory.</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <term><varname>Destination</varname></term>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>The destination prefix of the route. Possibly followed by a slash and the
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek prefixlength, if ommitted a full-length host route is assumed.</para>
de0671ee7fe465e108f62dcbbbe9366f81dd9e9aZbigniew Jędrzejewski-Szmek <para>The <literal>[DHCPv4]</literal> section accepts the following keys:</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <variablelist class='network-directives'>
43cf8388ea4ffed1801468d4b650d6e48eefce9eMichal Schmidt <para>When true (the default) the DNS servers received from the DHCP server will
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek be used, and take precedence over any statically configured ones.</para>
cbd671772c9ce053a7050ddd29de170eb9efac7eZbigniew Jędrzejewski-Szmek <term><varname>UseMTU</varname></term>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>When true the interface maximum transmission unit from the DHCP server will
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek be used on the current link. Defaults to false.</para>
43cf8388ea4ffed1801468d4b650d6e48eefce9eMichal Schmidt <varlistentry>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <term><varname>UseHostname</varname></term>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <para>When true (the default) the hostname received from the DHCP server
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek will be used as the transient hostname.</para>
d025f1e4dca8fc1436aff76f9e6185fe3e728daaZbigniew Jędrzejewski-Szmek <term><varname>CriticalConnection</varname></term>
ea69bd41c5923f4f278a09bb7d8cb1abcfa122e1Lennart Poettering <para>When true the connection will never be torn down even if the DHCP lease
ea69bd41c5923f4f278a09bb7d8cb1abcfa122e1Lennart Poettering expires. This is contrary to the DHCP specification, but may be the best choice
ea69bd41c5923f4f278a09bb7d8cb1abcfa122e1Lennart Poettering if, say, the root filesystem relies on this connection. Defaults to false.</para>
ea69bd41c5923f4f278a09bb7d8cb1abcfa122e1Lennart Poettering </varlistentry>
ea69bd41c5923f4f278a09bb7d8cb1abcfa122e1Lennart Poettering </variablelist>
fc55baee9964a118afbddbf82b8e667a0ad80b99Zbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
fc55baee9964a118afbddbf82b8e667a0ad80b99Zbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>,