systemd.network.xml revision 0a8a0fad010018be0f46d1c2e077ade0eb27c7db
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<?xml version='1.0'?> <!--*-nxml-*-->
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd<!--
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor This file is part of systemd.
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor Copyright 2013 Tom Gundersen
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
96ad5d81ee4a2cc66a4ae19893efc8aa6d06fae7jailletc systemd is free software; you can redistribute it and/or modify it
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor under the terms of the GNU Lesser General Public License as published by
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor the Free Software Foundation; either version 2.1 of the License, or
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor (at your option) any later version.
2e545ce2450a9953665f701bb05350f0d3f26275nd
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor systemd is distributed in the hope that it will be useful, but
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor WITHOUT ANY WARRANTY; without even the implied warranty of
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor Lesser General Public License for more details.
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor You should have received a copy of the GNU Lesser General Public License
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor along with systemd; If not, see <http://www.gnu.org/licenses/>.
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor-->
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor<refentry id="systemd.network" conditional='ENABLE_NETWORKD'>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <refentryinfo>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <title>systemd.network</title>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <productname>systemd</productname>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <authorgroup>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <author>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <contrib>Developer</contrib>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <firstname>Tom</firstname>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <surname>Gundersen</surname>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <email>teg@jklm.no</email>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </author>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </authorgroup>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </refentryinfo>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <refmeta>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <refentrytitle>systemd.network</refentrytitle>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <manvolnum>5</manvolnum>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </refmeta>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <refnamediv>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <refname>systemd.network</refname>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <refpurpose>Network configuration</refpurpose>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </refnamediv>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <refsynopsisdiv>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <para><filename><replaceable>network</replaceable>.network</filename></para>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </refsynopsisdiv>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <refsect1>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <title>Description</title>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
01f52ba6a87aa39d3873a441369828875c471823trawick <para>Network setup is performed by
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
fb9422f3bdba0c01312e22a55864dcc056583b7cgryzor </para>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <para>Network files must have the extension <filename>.network</filename>;
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar other extensions are ignored. Networks are applied to links whenever the links
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar appear.</para>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <para>The <filename>.network</filename> files are read from the files located in the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar system network directory <filename>/usr/lib/systemd/network</filename>,
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar the volatile runtime network directory
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <filename>/run/systemd/network</filename> and the local administration
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor network directory <filename>/etc/systemd/network</filename>.
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor All configuration files are collectively sorted and processed in lexical order,
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor regardless of the directories in which they live. However, files with
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor identical filenames replace each other. Files in
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <filename>/etc</filename> have the highest priority, files in
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <filename>/run</filename> take precedence over files with the same
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor name in <filename>/usr/lib</filename>. This can be used to override a
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor system-supplied configuration file with a local file if needed; a symlink in
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <filename>/etc</filename> with the same name as a configuration file in
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <filename>/usr/lib</filename>, pointing to <filename>/dev/null</filename>,
01f52ba6a87aa39d3873a441369828875c471823trawick disables the configuration file entirely.</para>
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick </refsect1>
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick <refsect1>
01f52ba6a87aa39d3873a441369828875c471823trawick <title>[Match] Section Options</title>
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick <para>The network file contains a <literal>[Match]</literal> section,
0237f43ab925775250e266e479d0a337ff374a4btakashi which determines if a given network file may be applied to a given device;
01f52ba6a87aa39d3873a441369828875c471823trawick and a <literal>[Network]</literal> section specifying how the device should
01f52ba6a87aa39d3873a441369828875c471823trawick be configured. The first (in lexical order) of the network files that
01f52ba6a87aa39d3873a441369828875c471823trawick matches a given device is applied.</para>
01f52ba6a87aa39d3873a441369828875c471823trawick
01f52ba6a87aa39d3873a441369828875c471823trawick <para>A network file is said to match a device if each of the entries in the
01f52ba6a87aa39d3873a441369828875c471823trawick <literal>[Match]</literal> section matches, or if the section is empty.
01f52ba6a87aa39d3873a441369828875c471823trawick The following keys are accepted:</para>
4aa603e6448b99f9371397d439795c91a93637eand
4aa603e6448b99f9371397d439795c91a93637eand <variablelist class='network-directives'>
01f52ba6a87aa39d3873a441369828875c471823trawick <varlistentry>
01f52ba6a87aa39d3873a441369828875c471823trawick <term><varname>MACAddress=</varname></term>
01f52ba6a87aa39d3873a441369828875c471823trawick <listitem>
01f52ba6a87aa39d3873a441369828875c471823trawick <para>The hardware address.</para>
01f52ba6a87aa39d3873a441369828875c471823trawick </listitem>
01f52ba6a87aa39d3873a441369828875c471823trawick </varlistentry>
01f52ba6a87aa39d3873a441369828875c471823trawick <varlistentry>
01f52ba6a87aa39d3873a441369828875c471823trawick <term><varname>Path=</varname></term>
01f52ba6a87aa39d3873a441369828875c471823trawick <listitem>
4aa603e6448b99f9371397d439795c91a93637eand <para>The persistent path, as exposed by the udev
4aa603e6448b99f9371397d439795c91a93637eand property <literal>ID_PATH</literal>. May contain shell
01f52ba6a87aa39d3873a441369828875c471823trawick style globs.</para>
01f52ba6a87aa39d3873a441369828875c471823trawick </listitem>
01f52ba6a87aa39d3873a441369828875c471823trawick </varlistentry>
01f52ba6a87aa39d3873a441369828875c471823trawick <varlistentry>
01f52ba6a87aa39d3873a441369828875c471823trawick <term><varname>Driver=</varname></term>
01f52ba6a87aa39d3873a441369828875c471823trawick <listitem>
01f52ba6a87aa39d3873a441369828875c471823trawick <para>The driver currently bound to the device, as
01f52ba6a87aa39d3873a441369828875c471823trawick exposed by the udev property <literal>DRIVER</literal>
01f52ba6a87aa39d3873a441369828875c471823trawick of its parent device, or if that is not set the driver
4aa603e6448b99f9371397d439795c91a93637eand as exposed by <literal>ethtool -i</literal> of the
4aa603e6448b99f9371397d439795c91a93637eand device itself.</para>
01f52ba6a87aa39d3873a441369828875c471823trawick </listitem>
01f52ba6a87aa39d3873a441369828875c471823trawick </varlistentry>
01f52ba6a87aa39d3873a441369828875c471823trawick <varlistentry>
01f52ba6a87aa39d3873a441369828875c471823trawick <term><varname>Type=</varname></term>
01f52ba6a87aa39d3873a441369828875c471823trawick <listitem>
01f52ba6a87aa39d3873a441369828875c471823trawick <para>The device type, as exposed by the udev property
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <literal>DEVTYPE</literal>.</para>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <term><varname>Name=</varname></term>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <para>The device name, as exposed by the udev property
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <literal>INTERFACE</literal>. May contain shell style
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor globs.</para>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <term><varname>Host=</varname></term>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <para>Matches against the hostname or machine ID of the
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor host. See <literal>ConditionHost=</literal> in
fb9422f3bdba0c01312e22a55864dcc056583b7cgryzor <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor for details.
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </para>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <varlistentry>
fb9422f3bdba0c01312e22a55864dcc056583b7cgryzor <term><varname>Virtualization=</varname></term>
fb9422f3bdba0c01312e22a55864dcc056583b7cgryzor <listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <para>Checks whether the system is executed in a virtualized
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor environment and optionally test whether it is a specific
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor implementation. See <literal>ConditionVirtualization=</literal> in
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor for details.
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </para>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <varlistentry>
4aa603e6448b99f9371397d439795c91a93637eand <term><varname>KernelCommandLine=</varname></term>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <para>Checks whether a specific kernel command line option is
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor set (or if prefixed with the exclamation mark unset). See
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <literal>ConditionKernelCommandLine=</literal> in
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor for details.
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </para>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </listitem>
853ab6827637acc5cdd976cd2ea20a18f82ae184lgentis </varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <term><varname>Architecture=</varname></term>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <para>Checks whether the system is running on a specific
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor architecture. See <literal>ConditionArchitecture=</literal> in
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor for details.
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </para>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </variablelist>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </refsect1>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <refsect1>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <title>[Network] Section Options</title>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <para>The <literal>[Network]</literal> section accepts the following keys:</para>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <variablelist class='network-directives'>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <term><varname>Description=</varname></term>
853ab6827637acc5cdd976cd2ea20a18f82ae184lgentis <listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <para>A description of the device. This is only used for
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor presentation purposes.</para>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <term><varname>DHCP=</varname></term>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <para>Enables DHCPv4 and/or DHCPv6 support. Accepts
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <literal>both</literal>, <literal>none</literal>,
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <literal>v4</literal> or <literal>v6</literal>.</para>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <varlistentry>
853ab6827637acc5cdd976cd2ea20a18f82ae184lgentis <term><varname>DHCPServer=</varname></term>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <para>A boolean. Enables a basic DHCPv4 server on the
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor device. Mostly useful for handing out leases to container
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor instances.</para>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </listitem>
4aa603e6448b99f9371397d439795c91a93637eand </varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <term><varname>IPv4LL=</varname></term>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <para>A boolean. When true, enables IPv4 link-local support.
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor If <literal>DHCP=</literal> is also true, acquiring DHCP address
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor will deprecate previously acquired IPv4 link-local address or
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor stop acquiring process if one has not been acquired before.
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </para>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <term><varname>Address=</varname></term>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <para>A static IPv4 or IPv6 address and its prefix length,
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor separated by a <literal>/</literal> character. Specify this
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor key more than once to configure several addresses.
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor The format of the address must be as described in
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar This is a short-hand for an [Address] section only containing
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar an Address key (see below). This option may be specified
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar more than once.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar </para>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <para>If the specified
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar address is 0.0.0.0
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar (for IPv4) or [::]
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar (for IPv6), a new
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar address range of the
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar requested size is
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar automatically
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar allocated from a
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar system-wide pool of
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar unused ranges. The
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar allocated range is
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar checked against all
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar current network
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar interfaces and all
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar known network
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar configuration files to
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar avoid address range
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar conflicts. The default
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar system-wide pool
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar consists of
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar 192.168.0.0/16,
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar 172.16.0.0/12 and
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar 10.0.0.0/8 for IPv4,
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar and fc00::/7 for
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar IPv6. This
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar functionality is
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar useful to manage a
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar large number of
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar dynamically created
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar network interfaces
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar with the same network
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar configuration and
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar automatic address
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar range
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar assignment.</para>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar </listitem>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar </varlistentry>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <varlistentry>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <term><varname>Gateway=</varname></term>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <listitem>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <para>The gateway address, which must be in the format described in
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar This is a short-hand for a [Route] section only containing a Gateway
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar key. This option may be specified more than once.</para>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar </listitem>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar </varlistentry>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <varlistentry>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <term><varname>DNS=</varname></term>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <listitem>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <para>A DNS server address, which must be in the format described in
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar This option may be specified more than once.</para>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar </listitem>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar </varlistentry>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<!-- TODO: document NTP= option when it is actually used somewhere -->
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <varlistentry>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <term><varname>Bridge=</varname></term>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <listitem>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <para>The name of the bridge to add the link to.</para>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar </listitem>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar </varlistentry>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <varlistentry>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <term><varname>Bond=</varname></term>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <listitem>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <para>The name of the bond to add the link to.</para>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar </listitem>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar </varlistentry>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <varlistentry>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <term><varname>VLAN=</varname></term>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <listitem>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <para>The name of a VLAN to create on the link. This option
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar may be specified more than once.</para>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar </listitem>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar </varlistentry>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <varlistentry>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <term><varname>MACVLAN=</varname></term>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <listitem>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <para>The name of a MACVLAN to create on the link. This option
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar may be specified more than once.</para>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar </listitem>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar </varlistentry>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <varlistentry>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <term><varname>VXLAN=</varname></term>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <listitem>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar <para>The name of a VXLAN to create on the link. This option
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar may be specified more than once.</para>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <term><varname>Tunnel=</varname></term>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <para>The name of a Tunnel to create on the link. This option
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor may be specified more than once.</para>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </variablelist>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </refsect1>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <refsect1>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <title>[Address] Section Options</title>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <para>An <literal>[Address]</literal> section accepts the following keys.
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor Specify several <literal>[Address]</literal> sections to configure several
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor addresses.</para>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <variablelist class='network-directives'>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <varlistentry>
205f749042ed530040a4f0080dbcb47ceae8a374rjung <term><varname>Address=</varname></term>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <para>As in the <literal>[Network]</literal> section. This key is mandatory.</para>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </listitem>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor </varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <varlistentry>
0f40f560dcfc0a192b0d92b8dc00b13e980bfe9dgryzor <term><varname>Broadcast=</varname></term>
<listitem>
<para>The broadcast address, which must be in the format described in
<citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
This key only applies to IPv4 addresses. If it is not given, it is
derived from the <literal>Address</literal> key.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>Label=</varname></term>
<listitem>
<para>An address label.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>[Route] Section Options</title>
<para>The <literal>[Route]</literal> section accepts the following keys. Specify
several <literal>[Route]</literal> sections to configure several routes.</para>
<variablelist class='network-directives'>
<varlistentry>
<term><varname>Gateway=</varname></term>
<listitem>
<para>As in the <literal>[Network]</literal> section. This key is mandatory.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>Destination=</varname></term>
<listitem>
<para>The destination prefix of the route. Possibly followed by a slash and the
prefixlength. If ommitted, a full-length host route is assumed.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>[DHCP] Section Options</title>
<para>The <literal>[DHCP]</literal> section accepts the following keys:</para>
<variablelist class='network-directives'>
<varlistentry>
<term><varname>UseDNS=</varname></term>
<listitem>
<para>When true (the default), the DNS servers received from the DHCP server will
be used and take precedence over any statically configured ones.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>UseMTU=</varname></term>
<listitem>
<para>When true, the interface maximum transmission unit from the DHCP server will
be used on the current link. Defaults to false.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>UseHostname=</varname></term>
<listitem>
<para>When true (the default), the hostname received from the DHCP server
will be used as the transient hostname.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>UseRoutes=</varname></term>
<listitem>
<para>When true (the default), the static routes will be requested from the DHCP server
and added to the routing table with metric of 1024.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>CriticalConnection=</varname></term>
<listitem>
<para>When true, the connection will never be torn down even if the DHCP lease
expires. This is contrary to the DHCP specification, but may be the best choice
if, say, the root filesystem relies on this connection. Defaults to false.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Example</title>
<example>
<title>/etc/systemd/network/50-static.network</title>
<programlisting>[Match]
Name=enp2s0
[Network]
Address=192.168.0.15/24
Gateway=192.168.0.1</programlisting>
</example>
<example>
<title>/etc/systemd/network/80-dhcp.network</title>
<programlisting>[Match]
Name=en*
[Network]
DHCP=yes</programlisting>
</example>
<example>
<title>/etc/systemd/network/bridge-static.network</title>
<programlisting>[Match]
Name=bridge0
[Network]
Address=192.168.0.15/24
Gateway=192.168.0.1
DNS=192.168.0.1</programlisting>
</example>
<example>
<title>/etc/systemd/network/bridge-slave-interface.network</title>
<programlisting>[Match]
Name=enp2s0
[Network]
Bridge=bridge0</programlisting>
</example>
<example>
<title>/etc/systemd/network/ipip.network</title>
<programlisting>[Match]
Name=em1
[Network]
Tunnel=ipip-tun</programlisting>
</example>
<example>
<title>/etc/systemd/network/sit.network</title>
<programlisting>[Match]
Name=em1
[Network]
Tunnel=sit-tun</programlisting>
</example>
<example>
<title>/etc/systemd/network/gre.network</title>
<programlisting>[Match]
Name=em1
[Network]
Tunnel=gre-tun</programlisting>
</example>
<example>
<title>/etc/systemd/network/vti.network</title>
<programlisting>[Match]
Name=em1
[Network]
Tunnel=vti-tun</programlisting>
</example>
</refsect1>
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>