]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd.network.xml
test-hostname-util: add assert_se's to make coverity happy
[thirdparty/systemd.git] / man / systemd.network.xml
CommitLineData
ad943783 1<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
eac684ef 2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
12b42c76 3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
eac684ef
TG
4
5<!--
572eb058
ZJS
6 SPDX-License-Identifier: LGPL-2.1+
7
eac684ef
TG
8 This file is part of systemd.
9
10 Copyright 2013 Tom Gundersen
11
12 systemd is free software; you can redistribute it and/or modify it
13 under the terms of the GNU Lesser General Public License as published by
14 the Free Software Foundation; either version 2.1 of the License, or
15 (at your option) any later version.
16
17 systemd is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 Lesser General Public License for more details.
21
22 You should have received a copy of the GNU Lesser General Public License
23 along with systemd; If not, see <http://www.gnu.org/licenses/>.
24-->
25
26<refentry id="systemd.network" conditional='ENABLE_NETWORKD'>
27
798d3a52
ZJS
28 <refentryinfo>
29 <title>systemd.network</title>
30 <productname>systemd</productname>
31
32 <authorgroup>
33 <author>
34 <contrib>Developer</contrib>
35 <firstname>Tom</firstname>
36 <surname>Gundersen</surname>
37 <email>teg@jklm.no</email>
38 </author>
39 </authorgroup>
40 </refentryinfo>
41
42 <refmeta>
43 <refentrytitle>systemd.network</refentrytitle>
44 <manvolnum>5</manvolnum>
45 </refmeta>
46
47 <refnamediv>
48 <refname>systemd.network</refname>
49 <refpurpose>Network configuration</refpurpose>
50 </refnamediv>
51
52 <refsynopsisdiv>
53 <para><filename><replaceable>network</replaceable>.network</filename></para>
54 </refsynopsisdiv>
55
56 <refsect1>
57 <title>Description</title>
58
59 <para>Network setup is performed by
60 <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
61 </para>
62
bac150e9
ZJS
63 <para>The main network file must have the extension <filename>.network</filename>; other
64 extensions are ignored. Networks are applied to links whenever the links appear.</para>
65
66 <para>The <filename>.network</filename> files are read from the files located in the system
67 network directory <filename>/usr/lib/systemd/network</filename>, the volatile runtime network
68 directory <filename>/run/systemd/network</filename> and the local administration network
69 directory <filename>/etc/systemd/network</filename>. All configuration files are collectively
70 sorted and processed in lexical order, regardless of the directories in which they live.
71 However, files with identical filenames replace each other. Files in <filename>/etc</filename>
72 have the highest priority, files in <filename>/run</filename> take precedence over files with
73 the same name in <filename>/usr/lib</filename>. This can be used to override a system-supplied
74 configuration file with a local file if needed. As a special case, an empty file (file size 0)
75 or symlink with the same name pointing to <filename>/dev/null</filename> disables the
76 configuration file entirely (it is "masked").</para>
77
78 <para>Along with the network file <filename>foo.network</filename>, a "drop-in" directory
79 <filename>foo.network.d/</filename> may exist. All files with the suffix
80 <literal>.conf</literal> from this directory will be parsed after the file itself is
81 parsed. This is useful to alter or add configuration settings, without having to modify the main
82 configuration file. Each drop-in file must have appropriate section headers.</para>
83
84 <para>In addition to <filename>/etc/systemd/network</filename>, drop-in <literal>.d</literal>
85 directories can be placed in <filename>/usr/lib/systemd/network</filename> or
86 <filename>/run/systemd/network</filename> directories. Drop-in files in
87 <filename>/etc</filename> take precedence over those in <filename>/run</filename> which in turn
88 take precedence over those in <filename>/usr/lib</filename>. Drop-in files under any of these
89 directories take precedence over the main netdev file wherever located. (Of course, since
90 <filename>/run</filename> is temporary and <filename>/usr/lib</filename> is for vendors, it is
91 unlikely drop-ins should be used in either of those places.)</para>
92
93 <para>Note that an interface without any static IPv6 addresses configured, and neither DHCPv6
94 nor IPv6LL enabled, shall be considered to have no IPv6 support. IPv6 will be automatically
95 disabled for that interface by writing "1" to
96 <filename>/proc/sys/net/ipv6/conf/<replaceable>ifname</replaceable>/disable_ipv6</filename>.
82ecb4c3 97 </para>
798d3a52
ZJS
98 </refsect1>
99
100 <refsect1>
101 <title>[Match] Section Options</title>
102
103 <para>The network file contains a <literal>[Match]</literal>
104 section, which determines if a given network file may be applied
105 to a given device; and a <literal>[Network]</literal> section
106 specifying how the device should be configured. The first (in
107 lexical order) of the network files that matches a given device
a22e1850
LP
108 is applied, all later files are ignored, even if they match as
109 well.</para>
798d3a52
ZJS
110
111 <para>A network file is said to match a device if each of the
112 entries in the <literal>[Match]</literal> section matches, or if
113 the section is empty. The following keys are accepted:</para>
114
115 <variablelist class='network-directives'>
116 <varlistentry>
117 <term><varname>MACAddress=</varname></term>
118 <listitem>
de25aae1
DKG
119 <para>The hardware address of the interface (use full colon-delimited hexadecimal, e.g.,
120 01:23:45:67:89:ab).</para>
798d3a52
ZJS
121 </listitem>
122 </varlistentry>
123 <varlistentry>
124 <term><varname>Path=</varname></term>
125 <listitem>
5256e00e
TG
126 <para>A whitespace-separated list of shell-style globs
127 matching the persistent path, as exposed by the udev
618b196e
DM
128 property <literal>ID_PATH</literal>. If the list is
129 prefixed with a "!", the test is inverted; i.e. it is
130 true when <literal>ID_PATH</literal> does not match any
131 item in the list.</para>
798d3a52
ZJS
132 </listitem>
133 </varlistentry>
134 <varlistentry>
135 <term><varname>Driver=</varname></term>
136 <listitem>
5256e00e
TG
137 <para>A whitespace-separated list of shell-style globs
138 matching the driver currently bound to the device, as
798d3a52
ZJS
139 exposed by the udev property <literal>DRIVER</literal>
140 of its parent device, or if that is not set the driver
141 as exposed by <literal>ethtool -i</literal> of the
618b196e
DM
142 device itself. If the list is prefixed with a "!", the
143 test is inverted.</para>
798d3a52
ZJS
144 </listitem>
145 </varlistentry>
146 <varlistentry>
147 <term><varname>Type=</varname></term>
148 <listitem>
5256e00e
TG
149 <para>A whitespace-separated list of shell-style globs
150 matching the device type, as exposed by the udev property
618b196e
DM
151 <literal>DEVTYPE</literal>. If the list is prefixed with
152 a "!", the test is inverted.</para>
798d3a52
ZJS
153 </listitem>
154 </varlistentry>
155 <varlistentry>
156 <term><varname>Name=</varname></term>
157 <listitem>
5256e00e
TG
158 <para>A whitespace-separated list of shell-style globs
159 matching the device name, as exposed by the udev property
618b196e
DM
160 <literal>INTERFACE</literal>. If the list is prefixed
161 with a "!", the test is inverted.</para>
798d3a52
ZJS
162 </listitem>
163 </varlistentry>
164 <varlistentry>
165 <term><varname>Host=</varname></term>
166 <listitem>
167 <para>Matches against the hostname or machine ID of the
168 host. See <literal>ConditionHost=</literal> in
169 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
170 for details.
171 </para>
172 </listitem>
173 </varlistentry>
174 <varlistentry>
175 <term><varname>Virtualization=</varname></term>
176 <listitem>
177 <para>Checks whether the system is executed in a virtualized
178 environment and optionally test whether it is a specific
179 implementation. See <literal>ConditionVirtualization=</literal> in
180 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
181 for details.
182 </para>
183 </listitem>
184 </varlistentry>
185 <varlistentry>
186 <term><varname>KernelCommandLine=</varname></term>
187 <listitem>
188 <para>Checks whether a specific kernel command line option is
189 set (or if prefixed with the exclamation mark unset). See
190 <literal>ConditionKernelCommandLine=</literal> in
191 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
192 for details.
193 </para>
194 </listitem>
195 </varlistentry>
196 <varlistentry>
197 <term><varname>Architecture=</varname></term>
198 <listitem>
199 <para>Checks whether the system is running on a specific
200 architecture. See <literal>ConditionArchitecture=</literal> in
201 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
202 for details.
203 </para>
204 </listitem>
205 </varlistentry>
206 </variablelist>
207
208 </refsect1>
209
210 <refsect1>
211 <title>[Link] Section Options</title>
212
213 <para> The <literal>[Link]</literal> section accepts the following keys:</para>
214
215 <variablelist class='network-directives'>
216 <varlistentry>
217 <term><varname>MACAddress=</varname></term>
218 <listitem>
de25aae1 219 <para>The hardware address to set for the device.</para>
798d3a52
ZJS
220 </listitem>
221 </varlistentry>
222 <varlistentry>
223 <term><varname>MTUBytes=</varname></term>
224 <listitem>
225 <para>The maximum transmission unit in bytes to set for the
226 device. The usual suffixes K, M, G, are supported and are
227 understood to the base of 1024.</para>
439689c6
SS
228 <para>Note that if IPv6 is enabled on the interface, and the MTU is chosen
229 below 1280 (the minimum MTU for IPv6) it will automatically be increased to this value.</para>
798d3a52
ZJS
230 </listitem>
231 </varlistentry>
99d2baa2
SS
232 <varlistentry>
233 <term><varname>ARP=</varname></term>
234 <listitem>
235 <para> A boolean. Enables or disables the ARP (low-level Address Resolution Protocol)
236 for this interface. Defaults to unset, which means that the kernel default will be used.</para>
237 <para> For example, disabling ARP is useful when creating multiple MACVLAN or VLAN virtual
238 interfaces atop a single lower-level physical interface, which will then only serve as a
239 link/"bridge" device aggregating traffic to the same physical link and not participate in
240 the network otherwise.</para>
241 </listitem>
242 </varlistentry>
a09dc546
DM
243 <varlistentry>
244 <term><varname>Unmanaged=</varname></term>
245 <listitem>
246 <para>A boolean. When <literal>yes</literal>, no attempts are
247 made to bring up or configure matching links, equivalent to
248 when there are no matching network files. Defaults to
249 <literal>no</literal>.</para>
250 <para>This is useful for preventing later matching network
251 files from interfering with certain interfaces that are fully
252 controlled by other applications.</para>
253 </listitem>
254 </varlistentry>
798d3a52
ZJS
255 </variablelist>
256 </refsect1>
257
258 <refsect1>
259 <title>[Network] Section Options</title>
260
261 <para>The <literal>[Network]</literal> section accepts the following keys:</para>
262
263 <variablelist class='network-directives'>
264 <varlistentry>
265 <term><varname>Description=</varname></term>
266 <listitem>
267 <para>A description of the device. This is only used for
268 presentation purposes.</para>
269 </listitem>
270 </varlistentry>
271 <varlistentry>
272 <term><varname>DHCP=</varname></term>
273 <listitem>
ad943783 274 <para>Enables DHCPv4 and/or DHCPv6 client support. Accepts
798d3a52 275 <literal>yes</literal>, <literal>no</literal>,
c702bd3b
LY
276 <literal>ipv4</literal>, or <literal>ipv6</literal>. Defaults
277 to <literal>no</literal>.</para>
e88d8021 278
f5a8c43f 279 <para>Note that DHCPv6 will by default be triggered by Router
7f3fdb7f 280 Advertisement, if that is enabled, regardless of this parameter.
f5a8c43f
TG
281 By enabling DHCPv6 support explicitly, the DHCPv6 client will
282 be started regardless of the presence of routers on the link,
283 or what flags the routers pass. See
f921f573 284 <literal>IPv6AcceptRA=</literal>.</para>
f5a8c43f
TG
285
286 <para>Furthermore, note that by default the domain name
e88d8021
ZJS
287 specified through DHCP is not used for name resolution.
288 See option <option>UseDomains=</option> below.</para>
2ef322fc
LP
289
290 <para>See the <literal>[DHCP]</literal> section below for further configuration options for the DHCP client
291 support.</para>
798d3a52
ZJS
292 </listitem>
293 </varlistentry>
294 <varlistentry>
295 <term><varname>DHCPServer=</varname></term>
296 <listitem>
ad943783
LP
297 <para>A boolean. Enables DHCPv4 server support. Defaults
298 to <literal>no</literal>. Further settings for the DHCP
299 server may be set in the <literal>[DHCPServer]</literal>
300 section described below.</para>
798d3a52
ZJS
301 </listitem>
302 </varlistentry>
303 <varlistentry>
56fd6bf7 304 <term><varname>LinkLocalAddressing=</varname></term>
798d3a52 305 <listitem>
d0d6a4cd
TG
306 <para>Enables link-local address autoconfiguration. Accepts
307 <literal>yes</literal>, <literal>no</literal>,
308 <literal>ipv4</literal>, or <literal>ipv6</literal>. Defaults to
309 <literal>ipv6</literal>.</para>
798d3a52
ZJS
310 </listitem>
311 </varlistentry>
312 <varlistentry>
313 <term><varname>IPv4LLRoute=</varname></term>
314 <listitem>
315 <para>A boolean. When true, sets up the route needed for
316 non-IPv4LL hosts to communicate with IPv4LL-only hosts. Defaults
317 to false.
318 </para>
319 </listitem>
320 </varlistentry>
321 <varlistentry>
113bfde1
TG
322 <term><varname>IPv6Token=</varname></term>
323 <listitem>
324 <para>An IPv6 address with the top 64 bits unset. When set, indicates the
eb142d8e
TG
325 64-bit interface part of SLAAC IPv6 addresses for this link. Note that
326 the token is only ever used for SLAAC, and not for DHCPv6 addresses, even
3708bd46 327 in the case DHCP is requested by router advertisement. By default, the
eb142d8e 328 token is autogenerated.</para>
113bfde1
TG
329 </listitem>
330 </varlistentry>
331 <varlistentry>
798d3a52
ZJS
332 <term><varname>LLMNR=</varname></term>
333 <listitem>
aaa297d4
LP
334 <para>A boolean or <literal>resolve</literal>. When true,
335 enables <ulink
336 url="https://tools.ietf.org/html/rfc4795">Link-Local
337 Multicast Name Resolution</ulink> on the link. When set to
338 <literal>resolve</literal>, only resolution is enabled,
339 but not host registration and announcement. Defaults to
340 true. This setting is read by
341 <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
342 </listitem>
343 </varlistentry>
344 <varlistentry>
345 <term><varname>MulticastDNS=</varname></term>
346 <listitem>
347 <para>A boolean or <literal>resolve</literal>. When true,
348 enables <ulink
349 url="https://tools.ietf.org/html/rfc6762">Multicast
350 DNS</ulink> support on the link. When set to
351 <literal>resolve</literal>, only resolution is enabled,
352 but not host or service registration and
353 announcement. Defaults to false. This setting is read by
354 <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
798d3a52
ZJS
355 </listitem>
356 </varlistentry>
ad6c0475
LP
357 <varlistentry>
358 <term><varname>DNSSEC=</varname></term>
359 <listitem>
360 <para>A boolean or
361 <literal>allow-downgrade</literal>. When true, enables
362 <ulink
363 url="https://tools.ietf.org/html/rfc4033">DNSSEC</ulink>
364 DNS validation support on the link. When set to
365 <literal>allow-downgrade</literal>, compatibility with
366 non-DNSSEC capable networks is increased, by automatically
785889e5 367 turning off DNSSEC in this case. This option defines a
ad6c0475
LP
368 per-interface setting for
369 <citerefentry><refentrytitle>resolved.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>'s
370 global <varname>DNSSEC=</varname> option. Defaults to
371 false. This setting is read by
372 <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
373 </listitem>
374 </varlistentry>
8a516214
LP
375 <varlistentry>
376 <term><varname>DNSSECNegativeTrustAnchors=</varname></term>
377 <listitem><para>A space-separated list of DNSSEC negative
378 trust anchor domains. If specified and DNSSEC is enabled,
379 look-ups done via the interface's DNS server will be subject
380 to the list of negative trust anchors, and not require
381 authentication for the specified domains, or anything below
382 it. Use this to disable DNSSEC authentication for specific
383 private domains, that cannot be proven valid using the
384 Internet DNS hierarchy. Defaults to the empty list. This
385 setting is read by
386 <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
387 </listitem>
388 </varlistentry>
798d3a52
ZJS
389 <varlistentry>
390 <term><varname>LLDP=</varname></term>
391 <listitem>
da6c766d
LP
392 <para>Controls support for Ethernet LLDP packet reception. LLDP is a link-layer protocol commonly
393 implemented on professional routers and bridges which announces which physical port a system is connected
394 to, as well as other related data. Accepts a boolean or the special value
34437b4f
LP
395 <literal>routers-only</literal>. When true, incoming LLDP packets are accepted and a database of all LLDP
396 neighbors maintained. If <literal>routers-only</literal> is set only LLDP data of various types of routers
397 is collected and LLDP data about other types of devices ignored (such as stations, telephones and
7cececb2 398 others). If false, LLDP reception is disabled. Defaults to <literal>routers-only</literal>. Use
34437b4f 399 <citerefentry><refentrytitle>networkctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> to query the
da6c766d
LP
400 collected neighbor data. LLDP is only available on Ethernet links. See <varname>EmitLLDP=</varname> below
401 for enabling LLDP packet emission from the local system.
798d3a52
ZJS
402 </para>
403 </listitem>
404 </varlistentry>
da6c766d
LP
405 <varlistentry>
406 <term><varname>EmitLLDP=</varname></term>
407 <listitem>
7272b25e
LP
408 <para>Controls support for Ethernet LLDP packet emission. Accepts a boolean parameter or the special values
409 <literal>nearest-bridge</literal>, <literal>non-tpmr-bridge</literal> and
410 <literal>customer-bridge</literal>. Defaults to false, which turns off LLDP packet emission. If not false,
411 a short LLDP packet with information about the local system is sent out in regular intervals on the
412 link. The LLDP packet will contain information about the local host name, the local machine ID (as stored
413 in <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>) and the
da6c766d
LP
414 local interface name, as well as the pretty hostname of the system (as set in
415 <citerefentry><refentrytitle>machine-info</refentrytitle><manvolnum>5</manvolnum></citerefentry>). LLDP
7272b25e
LP
416 emission is only available on Ethernet links. Note that this setting passes data suitable for
417 identification of host to the network and should thus not be enabled on untrusted networks, where such
418 identification data should not be made available. Use this option to permit other systems to identify on
419 which interfaces they are connected to this system. The three special values control propagation of the
420 LLDP packets. The <literal>nearest-bridge</literal> setting permits propagation only to the nearest
421 connected bridge, <literal>non-tpmr-bridge</literal> permits propagation across Two-Port MAC Relays, but
422 not any other bridges, and <literal>customer-bridge</literal> permits propagation until a customer bridge
423 is reached. For details about these concepts, see <ulink
424 url="http://standards.ieee.org/getieee802/download/802.1AB-2009.pdf">IEEE 802.1AB-2009</ulink>. Note that
425 configuring this setting to true is equivalent to <literal>nearest-bridge</literal>, the recommended and
426 most restricted level of propagation. See <varname>LLDP=</varname> above for an option to enable LLDP
427 reception.</para>
da6c766d
LP
428 </listitem>
429 </varlistentry>
0d4ad91d
AR
430 <varlistentry>
431 <term><varname>BindCarrier=</varname></term>
432 <listitem>
2ae7505f
TG
433 <para>A link name or a list of link names. When set, controls the behavior of the current
434 link. When all links in the list are in an operational down state, the current link is brought
435 down. When at least one link has carrier, the current interface is brought up.
0d4ad91d
AR
436 </para>
437 </listitem>
438 </varlistentry>
798d3a52
ZJS
439 <varlistentry>
440 <term><varname>Address=</varname></term>
441 <listitem>
442 <para>A static IPv4 or IPv6 address and its prefix length,
443 separated by a <literal>/</literal> character. Specify
444 this key more than once to configure several addresses.
445 The format of the address must be as described in
3ba3a79d 446 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
798d3a52
ZJS
447 This is a short-hand for an [Address] section only
448 containing an Address key (see below). This option may be
449 specified more than once.
450 </para>
451
452 <para>If the specified address is 0.0.0.0 (for IPv4) or
453 [::] (for IPv6), a new address range of the requested size
454 is automatically allocated from a system-wide pool of
455 unused ranges. The allocated range is checked against all
456 current network interfaces and all known network
457 configuration files to avoid address range conflicts. The
458 default system-wide pool consists of 192.168.0.0/16,
459 172.16.0.0/12 and 10.0.0.0/8 for IPv4, and fc00::/7 for
460 IPv6. This functionality is useful to manage a large
461 number of dynamically created network interfaces with the
462 same network configuration and automatic address range
463 assignment.</para>
464
465 </listitem>
466 </varlistentry>
467 <varlistentry>
468 <term><varname>Gateway=</varname></term>
469 <listitem>
470 <para>The gateway address, which must be in the format
471 described in
3ba3a79d 472 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
798d3a52
ZJS
473 This is a short-hand for a [Route] section only containing
474 a Gateway key. This option may be specified more than
475 once.</para>
476 </listitem>
477 </varlistentry>
478 <varlistentry>
479 <term><varname>DNS=</varname></term>
480 <listitem>
481 <para>A DNS server address, which must be in the format
482 described in
3ba3a79d 483 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
f41b446a 484 This option may be specified more than once. This setting is read by
3df9bec5 485 <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
798d3a52
ZJS
486 </listitem>
487 </varlistentry>
488 <varlistentry>
489 <term><varname>Domains=</varname></term>
490 <listitem>
2df22529
ZJS
491 <para>A list of domains which should be resolved using the DNS servers on this link. Each item in the list
492 should be a domain name, optionally prefixed with a tilde (<literal>~</literal>). The domains with the
493 prefix are called "routing-only domains". The domains without the prefix are called "search domains" and
494 are first used as search suffixes for extending single-label host names (host names containing no dots) to
495 become fully qualified domain names (FQDNs). If a single-label host name is resolved on this interface,
496 each of the specified search domains are appended to it in turn, converting it into a fully qualified
497 domain name, until one of them may be successfully resolved.</para>
498
499 <para>Both "search" and "routing-only" domains are used for routing of DNS queries: look-ups for host names
500 ending in those domains (hence also single label names, if any "search domains" are listed), are routed to
501 the DNS servers configured for this interface. The domain routing logic is particularly useful on
502 multi-homed hosts with DNS servers serving particular private DNS zones on each interface.</para>
503
504 <para>The "routing-only" domain <literal>~.</literal> (the tilde indicating definition of a routing domain,
505 the dot referring to the DNS root domain which is the implied suffix of all valid DNS names) has special
506 effect. It causes all DNS traffic which does not match another configured domain routing entry to be routed
507 to DNS servers specified for this interface. This setting is useful to prefer a certain set of DNS servers
508 if a link on which they are connected is available.</para>
3df9bec5
LP
509
510 <para>This setting is read by
2df22529
ZJS
511 <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
512 "Search domains" correspond to the <varname>domain</varname> and <varname>search</varname> entries in
98e9d710 513 <citerefentry project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
2df22529
ZJS
514 Domain name routing has no equivalent in the traditional glibc API, which has no concept of domain
515 name servers limited to a specific link.</para>
798d3a52
ZJS
516 </listitem>
517 </varlistentry>
518 <varlistentry>
519 <term><varname>NTP=</varname></term>
520 <listitem>
f41b446a 521 <para>An NTP server address. This option may be specified more than once. This setting is read by
3df9bec5 522 <citerefentry><refentrytitle>systemd-timesyncd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
798d3a52
ZJS
523 </listitem>
524 </varlistentry>
525 <varlistentry>
526 <term><varname>IPForward=</varname></term>
765afd5c
LP
527 <listitem><para>Configures IP packet forwarding for the
528 system. If enabled, incoming packets on any network
529 interface will be forwarded to any other interfaces
530 according to the routing table. Takes either a boolean
531 argument, or the values <literal>ipv4</literal> or
532 <literal>ipv6</literal>, which only enable IP packet
533 forwarding for the specified address family. This controls
534 the <filename>net.ipv4.ip_forward</filename> and
535 <filename>net.ipv6.conf.all.forwarding</filename> sysctl
536 options of the network interface (see <ulink
4046d836
LP
537 url="https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt">ip-sysctl.txt</ulink>
538 for details about sysctl options). Defaults to
539 <literal>no</literal>.</para>
540
765afd5c
LP
541 <para>Note: this setting controls a global kernel option,
542 and does so one way only: if a network that has this setting
543 enabled is set up the global setting is turned on. However,
544 it is never turned off again, even after all networks with
545 this setting enabled are shut down again.</para>
546
547 <para>To allow IP packet forwarding only between specific
548 network interfaces use a firewall.</para>
4046d836 549 </listitem>
798d3a52
ZJS
550 </varlistentry>
551 <varlistentry>
552 <term><varname>IPMasquerade=</varname></term>
553 <listitem><para>Configures IP masquerading for the network
b938cb90 554 interface. If enabled, packets forwarded from the network
798d3a52
ZJS
555 interface will be appear as coming from the local host.
556 Takes a boolean argument. Implies
5c82dd13 557 <varname>IPForward=ipv4</varname>. Defaults to
4046d836 558 <literal>no</literal>.</para></listitem>
798d3a52 559 </varlistentry>
a46e37cb
SS
560 <varlistentry>
561 <term><varname>IPv6PrivacyExtensions=</varname></term>
1f0d9695
LP
562 <listitem><para>Configures use of stateless temporary
563 addresses that change over time (see <ulink
564 url="https://tools.ietf.org/html/rfc4941">RFC 4941</ulink>,
565 Privacy Extensions for Stateless Address Autoconfiguration
566 in IPv6). Takes a boolean or the special values
567 <literal>prefer-public</literal> and
b938cb90 568 <literal>kernel</literal>. When true, enables the privacy
1f0d9695 569 extensions and prefers temporary addresses over public
b938cb90 570 addresses. When <literal>prefer-public</literal>, enables the
1f0d9695
LP
571 privacy extensions, but prefers public addresses over
572 temporary addresses. When false, the privacy extensions
b938cb90 573 remain disabled. When <literal>kernel</literal>, the kernel's
1f0d9695 574 default setting will be left in place. Defaults to
a46e37cb
SS
575 <literal>no</literal>.</para></listitem>
576 </varlistentry>
941d0aa8 577 <varlistentry>
f921f573 578 <term><varname>IPv6AcceptRA=</varname></term>
1e7a0e21
LP
579 <listitem><para>Enable or disable IPv6 Router Advertisement (RA) reception support for the interface. Takes
580 a boolean parameter. If true, RAs are accepted; if false, RAs are ignored, independently of the local
581 forwarding state. When not set, the kernel default is used, and RAs are accepted only when local forwarding
582 is disabled for that interface. When RAs are accepted, they may trigger the start of the DHCPv6 client if
583 the relevant flags are set in the RA data, or if no routers are found on the link.</para>
584
585 <para>Further settings for the IPv6 RA support may be configured in the
f921f573 586 <literal>[IPv6AcceptRA]</literal> section, see below.</para>
1e7a0e21
LP
587
588 <para>Also see <ulink
589 url="https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt">ip-sysctl.txt</ulink> in the kernel
590 documentation regarding <literal>accept_ra</literal>, but note that systemd's setting of
591 <constant>1</constant> (i.e. true) corresponds to kernel's setting of <constant>2</constant>.</para>
ebf98081 592 </listitem>
941d0aa8 593 </varlistentry>
44de7fb1
SS
594 <varlistentry>
595 <term><varname>IPv6DuplicateAddressDetection=</varname></term>
a8eaaee7
JE
596 <listitem><para>Configures the amount of IPv6 Duplicate
597 Address Detection (DAD) probes to send. Defaults to unset.
44de7fb1
SS
598 </para></listitem>
599 </varlistentry>
a86cba89
SS
600 <varlistentry>
601 <term><varname>IPv6HopLimit=</varname></term>
602 <listitem><para>Configures IPv6 Hop Limit. For each router that
603 forwards the packet, the hop limit is decremented by 1. When the
604 hop limit field reaches zero, the packet is discarded.
605 Defaults to unset.
606 </para></listitem>
607 </varlistentry>
23d8b221 608 <varlistentry>
8f9a206b
SS
609 <term><varname>IPv4ProxyARP=</varname></term>
610 <listitem><para>A boolean. Configures proxy ARP for IPv4. Proxy ARP is the technique in which one host,
23d8b221
SS
611 usually a router, answers ARP requests intended for another machine. By "faking" its identity,
612 the router accepts responsibility for routing packets to the "real" destination. (see <ulink
613 url="https://tools.ietf.org/html/rfc1027">RFC 1027</ulink>.
614 Defaults to unset.
615 </para></listitem>
616 </varlistentry>
a0e5c15d 617 <varlistentry>
465dfe59
HV
618 <term><varname>IPv6ProxyNDP=</varname></term>
619 <listitem><para>A boolean. Configures proxy NDP for IPv6. Proxy NDP (Neighbor Discovery
620 Protocol) is a technique for IPv6 to allow routing of addresses to a different
621 destination when peers expect them to be present on a certain physical link.
a0e5c15d
FK
622 In this case a router answers Neighbour Advertisement messages intended for
623 another machine by offering its own MAC address as destination.
465dfe59 624 Unlike proxy ARP for IPv4, it is not enabled globally, but will only send Neighbour
a0e5c15d 625 Advertisement messages for addresses in the IPv6 neighbor proxy table,
465dfe59
HV
626 which can also be shown by <command>ip -6 neighbour show proxy</command>.
627 systemd-networkd will control the per-interface `proxy_ndp` switch for each configured
628 interface depending on this option.
629 Defautls to unset.
630 </para></listitem>
631 </varlistentry>
632 <varlistentry>
633 <term><varname>IPv6ProxyNDPAddress=</varname></term>
634 <listitem><para>An IPv6 address, for which Neighbour Advertisement messages will be
635 proxied. This option may be specified more than once. systemd-networkd will add the
636 <option>IPv6ProxyNDPAddress=</option> entries to the kernel's IPv6 neighbor proxy table.
637 This option implies <option>IPv6ProxyNDP=true</option> but has no effect if
638 <option>IPv6ProxyNDP</option> has been set to false. Defaults to unset.
a0e5c15d
FK
639 </para></listitem>
640 </varlistentry>
3f9e0236
PF
641 <varlistentry>
642 <term><varname>IPv6PrefixDelegation=</varname></term>
643 <listitem><para>Whether to enable or disable Router Advertisement sending on a link.
644 Defaults to <literal>false</literal>. See the <literal>[IPv6PrefixDelegation]</literal>
645 and the <literal>[IPv6Prefix]</literal> sections for configuration options.
646 </para></listitem>
647 </varlistentry>
798d3a52
ZJS
648 <varlistentry>
649 <term><varname>Bridge=</varname></term>
650 <listitem>
9e35b3de
ZJS
651 <para>The name of the bridge to add the link to. See
652 <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
653 </para>
798d3a52
ZJS
654 </listitem>
655 </varlistentry>
656 <varlistentry>
657 <term><varname>Bond=</varname></term>
658 <listitem>
9e35b3de
ZJS
659 <para>The name of the bond to add the link to. See
660 <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
661 </para>
798d3a52
ZJS
662 </listitem>
663 </varlistentry>
6cb955c6
AR
664 <varlistentry>
665 <term><varname>VRF=</varname></term>
666 <listitem>
9e35b3de
ZJS
667 <para>The name of the VRF to add the link to. See
668 <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
669 </para>
6cb955c6
AR
670 </listitem>
671 </varlistentry>
798d3a52
ZJS
672 <varlistentry>
673 <term><varname>VLAN=</varname></term>
674 <listitem>
9e35b3de
ZJS
675 <para>The name of a VLAN to create on the link. See
676 <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
677 This option may be specified more than once.</para>
798d3a52
ZJS
678 </listitem>
679 </varlistentry>
680 <varlistentry>
681 <term><varname>MACVLAN=</varname></term>
682 <listitem>
9e35b3de
ZJS
683 <para>The name of a MACVLAN to create on the link. See
684 <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
685 This option may be specified more than once.</para>
798d3a52
ZJS
686 </listitem>
687 </varlistentry>
688 <varlistentry>
689 <term><varname>VXLAN=</varname></term>
690 <listitem>
9e35b3de
ZJS
691 <para>The name of a VXLAN to create on the link. See
692 <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
693 This option may be specified more than once.</para>
798d3a52
ZJS
694 </listitem>
695 </varlistentry>
696 <varlistentry>
697 <term><varname>Tunnel=</varname></term>
698 <listitem>
9e35b3de
ZJS
699 <para>The name of a Tunnel to create on the link. See
700 <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
701 This option may be specified more than once.</para>
798d3a52
ZJS
702 </listitem>
703 </varlistentry>
dd5f3175
SS
704 <varlistentry>
705 <term><varname>ActiveSlave=</varname></term>
706 <listitem>
707 <para>A boolean. Specifies the new active slave. The <literal>ActiveSlave=</literal>
708 option is only valid for following modes:
709 <literal>active-backup</literal>,
710 <literal>balance-alb</literal> and
711 <literal>balance-tlb</literal>. Defaults to false.
712 </para>
713 </listitem>
714 </varlistentry>
715 <varlistentry>
716 <term><varname>PrimarySlave=</varname></term>
717 <listitem>
718 <para>A boolean. Specifies which slave is the primary device. The specified
719 device will always be the active slave while it is available. Only when the
720 primary is off-line will alternate devices be used. This is useful when
721 one slave is preferred over another, e.g. when one slave has higher throughput
722 than another. The <literal>PrimarySlave=</literal> option is only valid for
723 following modes:
724 <literal>active-backup</literal>,
725 <literal>balance-alb</literal> and
726 <literal>balance-tlb</literal>. Defaults to false.
727 </para>
728 </listitem>
729 </varlistentry>
dad2d78e
SS
730 <varlistentry>
731 <term><varname>ConfigureWithoutCarrier=</varname></term>
732 <listitem>
733 <para>A boolean. Allows networkd to configure a specific link even if it has no carrier.
734 Defaults to false.
735 </para>
736 </listitem>
737 </varlistentry>
798d3a52
ZJS
738 </variablelist>
739
740 </refsect1>
741
742 <refsect1>
743 <title>[Address] Section Options</title>
744
745 <para>An <literal>[Address]</literal> section accepts the
746 following keys. Specify several <literal>[Address]</literal>
747 sections to configure several addresses.</para>
748
749 <variablelist class='network-directives'>
750 <varlistentry>
751 <term><varname>Address=</varname></term>
752 <listitem>
753 <para>As in the <literal>[Network]</literal> section. This
754 key is mandatory.</para>
755 </listitem>
756 </varlistentry>
757 <varlistentry>
758 <term><varname>Peer=</varname></term>
759 <listitem>
760 <para>The peer address in a point-to-point connection.
761 Accepts the same format as the <literal>Address</literal>
762 key.</para>
763 </listitem>
764 </varlistentry>
765 <varlistentry>
766 <term><varname>Broadcast=</varname></term>
767 <listitem>
768 <para>The broadcast address, which must be in the format
769 described in
3ba3a79d 770 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
798d3a52
ZJS
771 This key only applies to IPv4 addresses. If it is not
772 given, it is derived from the <literal>Address</literal>
773 key.</para>
774 </listitem>
775 </varlistentry>
776 <varlistentry>
777 <term><varname>Label=</varname></term>
778 <listitem>
779 <para>An address label.</para>
780 </listitem>
781 </varlistentry>
b5834a0b
SS
782 <varlistentry>
783 <term><varname>PreferredLifetime=</varname></term>
784 <listitem>
785 <para>Allows the default "preferred lifetime" of the address to be overridden.
786 Only three settings are accepted: <literal>forever</literal> or <literal>infinity</literal>
787 which is the default and means that the address never expires, and <literal>0</literal> which means
788 that the address is considered immediately "expired" and will not be used,
789 unless explicitly requested. A setting of PreferredLifetime=0 is useful for
790 addresses which are added to be used only by a specific application,
791 which is then configured to use them explicitly.</para>
792 </listitem>
793 </varlistentry>
2959fb07
SS
794 <varlistentry>
795 <term><varname>Scope=</varname></term>
796 <listitem>
797 <para>The scope of the address, which can be <literal>global</literal>,
798 <literal>link</literal> or <literal>host</literal> or an unsigned integer ranges 0 to 255.
799 Defaults to <literal>global</literal>.</para>
800 </listitem>
801 </varlistentry>
e63be084
SS
802 <varlistentry>
803 <term><varname>HomeAddress=</varname></term>
804 <listitem>
805 <para>Takes a boolean argument. Designates this address the "home address" as defined in
806 <ulink url="https://tools.ietf.org/html/rfc6275">RFC 6275</ulink>.
807 Supported only on IPv6. Defaults to false.</para>
808 </listitem>
809 </varlistentry>
810 <varlistentry>
811 <term><varname>DuplicateAddressDetection=</varname></term>
812 <listitem>
813 <para>Takes a boolean argument. Do not perform Duplicate Address Detection
814 <ulink url="https://tools.ietf.org/html/rfc4862">RFC 4862</ulink> when adding this address.
815 Supported only on IPv6. Defaults to false.</para>
816 </listitem>
817 </varlistentry>
818 <varlistentry>
819 <term><varname>ManageTemporaryAddress=</varname></term>
820 <listitem>
821 <para>Takes a boolean argument. If true the kernel manage temporary addresses created
822 from this one as template on behalf of Privacy Extensions
823 <ulink url="https://tools.ietf.org/html/rfc3041">RFC 3041</ulink>. For this to become
824 active, the use_tempaddr sysctl setting has to be set to a value greater than zero.
825 The given address needs to have a prefix length of 64. This flag allows to use privacy
826 extensions in a manually configured network, just like if stateless auto-configuration
827 was active. Defaults to false. </para>
828 </listitem>
829 </varlistentry>
830 <varlistentry>
831 <term><varname>PrefixRoute=</varname></term>
832 <listitem>
833 <para>Takes a boolean argument. When adding or modifying an IPv6 address, the userspace
834 application needs a way to suppress adding a prefix route. This is for example relevant
835 together with IFA_F_MANAGERTEMPADDR, where userspace creates autoconf generated addresses,
836 but depending on on-link, no route for the prefix should be added. Defaults to false.</para>
837 </listitem>
838 </varlistentry>
839 <varlistentry>
840 <term><varname>AutoJoin=</varname></term>
841 <listitem>
842 <para>Takes a boolean argument. Joining multicast group on ethernet level via
843 <command>ip maddr</command> command would not work if we have an Ethernet switch that does
844 IGMP snooping since the switch would not replicate multicast packets on ports that did not
845 have IGMP reports for the multicast addresses. Linux vxlan interfaces created via
846 <command>ip link add vxlan</command> or networkd's netdev kind vxlan have the group option
847 that enables then to do the required join. By extending ip address command with option
848 <literal>autojoin</literal> we can get similar functionality for openvswitch (OVS) vxlan
849 interfaces as well as other tunneling mechanisms that need to receive multicast traffic.
850 Defaults to <literal>no</literal>.</para>
851 </listitem>
852 </varlistentry>
798d3a52
ZJS
853 </variablelist>
854 </refsect1>
855
95b74ef6
SS
856 <refsect1>
857 <title>[IPv6AddressLabel] Section Options</title>
858
859 <para>An <literal>[IPv6AddressLabel]</literal> section accepts the
860 following keys. Specify several <literal>[IPv6AddressLabel]</literal>
785889e5 861 sections to configure several address labels. IPv6 address labels are
95b74ef6
SS
862 used for address selection. See <ulink url="https://tools.ietf.org/html/rfc3484">RFC 3484</ulink>.
863 Precedence is managed by userspace, and only the label itself is stored in the kernel</para>
864
865 <variablelist class='network-directives'>
866 <varlistentry>
867 <term><varname>Label=</varname></term>
868 <listitem>
869 <para> The label for the prefix (an unsigned integer) ranges 0 to 4294967294.
870 0xffffffff is reserved. This key is mandatory.</para>
871 </listitem>
872 </varlistentry>
873 <varlistentry>
874 <term><varname>Prefix=</varname></term>
875 <listitem>
876 <para>IPv6 prefix is an address with a prefix length, separated by a slash <literal>/</literal> character.
877 This key is mandatory. </para>
878 </listitem>
879 </varlistentry>
880 </variablelist>
881 </refsect1>
882
bce67bbe
SS
883 <refsect1>
884 <title>[RoutingPolicyRule] Section Options</title>
885
886 <para>An <literal>[RoutingPolicyRule]</literal> section accepts the
887 following keys. Specify several <literal>[RoutingPolicyRule]</literal>
888 sections to configure several rules.</para>
889
890 <variablelist class='network-directives'>
891 <varlistentry>
892 <term><varname>TypeOfService=</varname></term>
893 <listitem>
894 <para>Specifies the type of service to match a number between 0 to 255.</para>
895 </listitem>
896 </varlistentry>
897 <varlistentry>
898 <term><varname>From=</varname></term>
899 <listitem>
900 <para>Specifies the source address prefix to match. Possibly followed by a slash and the prefix length.</para>
901 </listitem>
902 </varlistentry>
903 <varlistentry>
904 <term><varname>To=</varname></term>
905 <listitem>
906 <para>Specifies the destination address prefix to match. Possibly followed by a slash and the prefix length.</para>
907 </listitem>
908 </varlistentry>
909 <varlistentry>
910 <term><varname>FirewallMark=</varname></term>
911 <listitem>
912 <para>Specifies the iptables firewall mark value to match (a number between 1 and 4294967295).</para>
913 </listitem>
914 </varlistentry>
915 <varlistentry>
916 <term><varname>Table=</varname></term>
917 <listitem>
918 <para>Specifies the routing table identifier to lookup if the rule
919 selector matches. The table identifier for a route (a number between 1 and 4294967295).</para>
920 </listitem>
921 </varlistentry>
922 <varlistentry>
923 <term><varname>Priority=</varname></term>
924 <listitem>
925 <para>Specifies the priority of this rule. <varname>Priority=</varname> is an unsigned
926 integer. Higher number means lower priority, and rules get processed in order of increasing number.</para>
927 </listitem>
928 </varlistentry>
762e2659
SS
929 <varlistentry>
930 <term><varname>IncomingInterface=</varname></term>
931 <listitem>
932 <para>Specifies incoming device to match. If the interface is loopback, the rule only matches packets originating from this host.</para>
933 </listitem>
934 </varlistentry>
935 <varlistentry>
936 <term><varname>OutgoingInterface=</varname></term>
937 <listitem>
938 <para>Specifies the outgoing device to match. The outgoing interface is only available for packets originating from local sockets that are bound to a device.</para>
939 </listitem>
940 </varlistentry>
bce67bbe
SS
941 </variablelist>
942 </refsect1>
943
798d3a52
ZJS
944 <refsect1>
945 <title>[Route] Section Options</title>
946 <para>The <literal>[Route]</literal> section accepts the
947 following keys. Specify several <literal>[Route]</literal>
948 sections to configure several routes.</para>
949
950 <variablelist class='network-directives'>
951 <varlistentry>
952 <term><varname>Gateway=</varname></term>
953 <listitem>
954 <para>As in the <literal>[Network]</literal> section.</para>
955 </listitem>
956 </varlistentry>
28959f7d
SS
957 <varlistentry>
958 <term><varname>GatewayOnlink=</varname></term>
959 <listitem>
320ac7a6 960 <para>The <literal>GatewayOnlink</literal> option tells the kernel that it does not have
28959f7d
SS
961 to check if the gateway is reachable directly by the current machine (i.e., the kernel does
962 not need to check if the gateway is attached to the local network), so that we can insert the
963 route in the kernel table without it being complained about. A boolean, defaults to <literal>no</literal>.
964 </para>
965 </listitem>
966 </varlistentry>
798d3a52
ZJS
967 <varlistentry>
968 <term><varname>Destination=</varname></term>
969 <listitem>
970 <para>The destination prefix of the route. Possibly
b938cb90 971 followed by a slash and the prefix length. If omitted, a
798d3a52
ZJS
972 full-length host route is assumed.</para>
973 </listitem>
974 </varlistentry>
975 <varlistentry>
976 <term><varname>Source=</varname></term>
977 <listitem>
978 <para>The source prefix of the route. Possibly followed by
b938cb90 979 a slash and the prefix length. If omitted, a full-length
798d3a52
ZJS
980 host route is assumed.</para>
981 </listitem>
982 </varlistentry>
983 <varlistentry>
984 <term><varname>Metric=</varname></term>
985 <listitem>
b938cb90 986 <para>The metric of the route (an unsigned integer).</para>
798d3a52
ZJS
987 </listitem>
988 </varlistentry>
b5bf6f64
SS
989 <varlistentry>
990 <term><varname>IPv6Preference=</varname></term>
991 <listitem>
992 <para>Specifies the route preference as defined in <ulink
993 url="https://tools.ietf.org/html/rfc4191">RFC4191</ulink> for Router Discovery messages.
994 Which can be one of <literal>low</literal> the route has a lowest priority,
995 <literal>medium</literal> the route has a default priority or
996 <literal>high</literal> the route has a highest priority.</para>
997 </listitem>
998 </varlistentry>
769b56a3
TG
999 <varlistentry>
1000 <term><varname>Scope=</varname></term>
1001 <listitem>
a8eaaee7 1002 <para>The scope of the route, which can be <literal>global</literal>,
769b56a3
TG
1003 <literal>link</literal> or <literal>host</literal>. Defaults to
1004 <literal>global</literal>.</para>
1005 </listitem>
0d07e595
JK
1006 </varlistentry>
1007 <varlistentry>
1008 <term><varname>PreferredSource=</varname></term>
1009 <listitem>
1010 <para>The preferred source address of the route. The address
1011 must be in the format described in
1012 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
1013 </listitem>
769b56a3 1014 </varlistentry>
c953b24c
SS
1015 <varlistentry>
1016 <term><varname>Table=<replaceable>num</replaceable></varname></term>
1017 <listitem>
1018 <para>The table identifier for the route (a number between 1 and 4294967295, or 0 to unset).
1019 The table can be retrieved using <command>ip route show table <replaceable>num</replaceable></command>.
1020 </para>
1021 </listitem>
1022 </varlistentry>
c83ecc04
SS
1023 <varlistentry>
1024 <term><varname>Protocol=</varname></term>
1025 <listitem>
1026 <para>The Protocol identifier for the route. Takes a number between 0 and 255 or the special values
1027 <literal>kernel</literal>, <literal>boot</literal> and <literal>static</literal>. Defaults to
1028 <literal>static</literal>.
1029 </para>
1030 </listitem>
1031 </varlistentry>
983226f3
SS
1032 <varlistentry>
1033 <term><varname>Type=</varname></term>
1034 <listitem>
1035 <para>The Type identifier for special route types, which can be
1036 <literal>unicast</literal> route to a destination network address which describes the path to the destination,
1037 <literal>blackhole</literal> packets are discarded silently,
1038 <literal>unreachable</literal> packets are discarded and the ICMP message host unreachable is generated,
1039 <literal>prohibit</literal> packets are discarded and the ICMP message communication administratively
1040 prohibited is generated. Defaults to <literal>unicast</literal>.
1041 </para>
1042 </listitem>
1043 </varlistentry>
1044
798d3a52
ZJS
1045 </variablelist>
1046 </refsect1>
1047
1048 <refsect1>
1049 <title>[DHCP] Section Options</title>
ad943783
LP
1050 <para>The <literal>[DHCP]</literal> section configures the
1051 DHCPv4 and DHCP6 client, if it is enabled with the
1052 <varname>DHCP=</varname> setting described above:</para>
798d3a52
ZJS
1053
1054 <variablelist class='network-directives'>
1055 <varlistentry>
1056 <term><varname>UseDNS=</varname></term>
1057 <listitem>
1058 <para>When true (the default), the DNS servers received
1059 from the DHCP server will be used and take precedence over
1060 any statically configured ones.</para>
e88d8021
ZJS
1061
1062 <para>This corresponds to the <option>nameserver</option>
ad943783
LP
1063 option in <citerefentry
1064 project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
798d3a52
ZJS
1065 </listitem>
1066 </varlistentry>
301f4073
MM
1067 <varlistentry>
1068 <term><varname>UseNTP=</varname></term>
1069 <listitem>
1070 <para>When true (the default), the NTP servers received
1071 from the DHCP server will be used by systemd-timesyncd
1072 and take precedence over any statically configured ones.</para>
1073 </listitem>
1074 </varlistentry>
798d3a52
ZJS
1075 <varlistentry>
1076 <term><varname>UseMTU=</varname></term>
1077 <listitem>
1078 <para>When true, the interface maximum transmission unit
1079 from the DHCP server will be used on the current link.
95ab9eff 1080 Defaults to false.</para>
798d3a52
ZJS
1081 </listitem>
1082 </varlistentry>
7585baa0 1083 <varlistentry>
1084 <term><varname>Anonymize=</varname></term>
1085 <listitem>
1086 <para>Takes a boolean argument. When true, the options sent to the DHCP server will
1087 follow the <ulink url="https://tools.ietf.org/html/rfc7844">RFC 7844</ulink>
1088 (Anonymity Profiles for DHCP Clients) to minimize disclosure of identifying information.
1089 Defaults to false.</para>
1090
1091 <para>This option should only be set to true when
1092 <varname>MACAddressPolicy=</varname> is set to <literal>random</literal>
1093 (see <citerefentry
1094 project='man-pages'><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>).</para>
1095
1096 <para>Note that this configuration will overwrite others.
1097 In concrete, the following variables will be ignored:
1098 <varname>SendHostname=</varname>, <varname>ClientIdentifier=</varname>,
1099 <varname>UseRoutes=</varname>, <varname>SendHostname=</varname>,
1100 <varname>UseMTU=</varname>, <varname>VendorClassIdentifier=</varname>,
1101 <varname>UseTimezone=</varname>.</para>
1102 </listitem>
1103 </varlistentry>
798d3a52
ZJS
1104 <varlistentry>
1105 <term><varname>SendHostname=</varname></term>
1106 <listitem>
d59be2cf
ZJS
1107 <para>When true (the default), the machine's hostname will
1108 be sent to the DHCP server.</para>
798d3a52
ZJS
1109 </listitem>
1110 </varlistentry>
1111 <varlistentry>
1112 <term><varname>UseHostname=</varname></term>
1113 <listitem>
1114 <para>When true (the default), the hostname received from
ad943783 1115 the DHCP server will be set as the transient hostname of the system
d59be2cf 1116 </para>
798d3a52
ZJS
1117 </listitem>
1118 </varlistentry>
1adc5d0b
SS
1119 <varlistentry>
1120 <term><varname>Hostname=</varname></term>
1121 <listitem>
d59be2cf
ZJS
1122 <para>Use this value for the hostname which is sent to the
1123 DHCP server, instead of machine's hostname.</para>
1adc5d0b
SS
1124 </listitem>
1125 </varlistentry>
798d3a52
ZJS
1126 <varlistentry>
1127 <term><varname>UseDomains=</varname></term>
1128 <listitem>
07ff561c 1129 <para>Takes a boolean argument, or the special value <literal>route</literal>. When true, the domain name
b2a81c0b
LP
1130 received from the DHCP server will be used as DNS search domain over this link, similar to the effect of
1131 the <option>Domains=</option> setting. If set to <literal>route</literal>, the domain name received from
1132 the DHCP server will be used for routing DNS queries only, but not for searching, similar to the effect of
1133 the <option>Domains=</option> setting when the argument is prefixed with <literal>~</literal>. Defaults to
1134 false.</para>
1135
1136 <para>It is recommended to enable this option only on trusted networks, as setting this affects resolution
1e7a0e21 1137 of all host names, in particular of single-label names. It is generally safer to use the supplied domain
b2a81c0b
LP
1138 only as routing domain, rather than as search domain, in order to not have it affect local resolution of
1139 single-label names.</para>
1140
1141 <para>When set to true, this setting corresponds to the <option>domain</option> option in <citerefentry
1142 project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
798d3a52
ZJS
1143 </listitem>
1144 </varlistentry>
1145 <varlistentry>
1146 <term><varname>UseRoutes=</varname></term>
1147 <listitem>
d6eac9bd
DW
1148 <para>When true (the default), the static routes will be requested from the DHCP server and added to the
1149 routing table with a metric of 1024, and a scope of "global", "link" or "host", depending on the route's
1150 destination and gateway. If the destination is on the local host, e.g., 127.x.x.x, or the same as the
1151 link's own address, the scope will be set to "host". Otherwise if the gateway is null (a direct route), a
1152 "link" scope will be used. For anything else, scope defaults to "global".</para>
798d3a52
ZJS
1153 </listitem>
1154 </varlistentry>
ad943783
LP
1155
1156 <varlistentry>
1157 <term><varname>UseTimezone=</varname></term>
1158
1159 <listitem><para>When true, the timezone received from the
7f3fdb7f 1160 DHCP server will be set as timezone of the local
ad943783
LP
1161 system. Defaults to <literal>no</literal>.</para></listitem>
1162 </varlistentry>
1163
798d3a52
ZJS
1164 <varlistentry>
1165 <term><varname>CriticalConnection=</varname></term>
1166 <listitem>
1167 <para>When true, the connection will never be torn down
1168 even if the DHCP lease expires. This is contrary to the
1169 DHCP specification, but may be the best choice if, say,
1170 the root filesystem relies on this connection. Defaults to
1171 false.</para>
1172 </listitem>
1173 </varlistentry>
e2e08e77 1174
3e43b2cd
JJ
1175 <varlistentry>
1176 <term><varname>ClientIdentifier=</varname></term>
1177 <listitem>
076ea6f6 1178 <para>The DHCPv4 client identifier to use. Either <literal>mac</literal> to use the MAC address of the link
037a3ded 1179 or <literal>duid</literal> (the default, see below) to use an RFC4361-compliant Client ID.</para>
3e43b2cd
JJ
1180 </listitem>
1181 </varlistentry>
e2e08e77 1182
798d3a52
ZJS
1183 <varlistentry>
1184 <term><varname>VendorClassIdentifier=</varname></term>
1185 <listitem>
1186 <para>The vendor class identifier used to identify vendor
1187 type and configuration.</para>
1188 </listitem>
1189 </varlistentry>
076ea6f6 1190
e2e08e77
ZJS
1191 <varlistentry>
1192 <term><varname>DUIDType=</varname></term>
1193 <listitem>
1194 <para>Override the global <varname>DUIDType</varname> setting for this network. See
1195 <citerefentry><refentrytitle>networkd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
1196 for a description of possible values.</para>
1197 </listitem>
1198 </varlistentry>
076ea6f6 1199
e2e08e77
ZJS
1200 <varlistentry>
1201 <term><varname>DUIDRawData=</varname></term>
1202 <listitem>
1203 <para>Override the global <varname>DUIDRawData</varname> setting for this network. See
1204 <citerefentry><refentrytitle>networkd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
1205 for a description of possible values.</para>
076ea6f6
LP
1206 </listitem>
1207 </varlistentry>
e2e08e77 1208
d05def16
LP
1209 <varlistentry>
1210 <term><varname>IAID=</varname></term>
1211 <listitem>
1212 <para>The DHCP Identity Association Identifier (IAID) for the interface, a 32-bit unsigned integer.</para>
1213 </listitem>
1214 </varlistentry>
1215
798d3a52
ZJS
1216 <varlistentry>
1217 <term><varname>RequestBroadcast=</varname></term>
1218 <listitem>
1219 <para>Request the server to use broadcast messages before
1220 the IP address has been configured. This is necessary for
1221 devices that cannot receive RAW packets, or that cannot
1222 receive packets at all before an IP address has been
1223 configured. On the other hand, this must not be enabled on
1224 networks where broadcasts are filtered out.</para>
1225 </listitem>
1226 </varlistentry>
e2e08e77 1227
798d3a52
ZJS
1228 <varlistentry>
1229 <term><varname>RouteMetric=</varname></term>
1230 <listitem>
1231 <para>Set the routing metric for routes specified by the
1232 DHCP server.</para>
1233 </listitem>
1234 </varlistentry>
f594276b
JK
1235
1236 <varlistentry>
1237 <term><varname>RouteTable=<replaceable>num</replaceable></varname></term>
1238 <listitem>
d11e656a 1239 <para>The table identifier for DHCP routes (a number between 1 and 4294967295, or 0 to unset).
f594276b
JK
1240 The table can be retrieved using <command>ip route show table <replaceable>num</replaceable></command>.
1241 </para>
917b2260
AR
1242 <para>When used in combination with <varname>VRF=</varname> the
1243 VRF's routing table is used unless this parameter is specified.
1244 </para>
f594276b
JK
1245 </listitem>
1246 </varlistentry>
9faed222
SS
1247
1248 <varlistentry>
1249 <term><varname>ListenPort=</varname></term>
1250 <listitem>
1251 <para>Allow setting custom port for the DHCP client to listen on.</para>
1252 </listitem>
1253 </varlistentry>
ad943783 1254 </variablelist>
076ea6f6 1255 </refsect1>
413708d1 1256
1e7a0e21 1257 <refsect1>
f921f573
LP
1258 <title>[IPv6AcceptRA] Section Options</title>
1259 <para>The <literal>[IPv6AcceptRA]</literal> section configures the IPv6 Router Advertisement
1260 (RA) client, if it is enabled with the <varname>IPv6AcceptRA=</varname> setting described
1e7a0e21
LP
1261 above:</para>
1262
1263 <variablelist class='network-directives'>
1264 <varlistentry>
1265 <term><varname>UseDNS=</varname></term>
1266 <listitem>
1267 <para>When true (the default), the DNS servers received in the Router Advertisement will be used and take
1268 precedence over any statically configured ones.</para>
1269
1270 <para>This corresponds to the <option>nameserver</option> option in <citerefentry
1271 project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
1272 </listitem>
1273 </varlistentry>
1274
1275 <varlistentry>
1276 <term><varname>UseDomains=</varname></term>
1277 <listitem>
1278 <para>Takes a boolean argument, or the special value <literal>route</literal>. When true, the domain name
1279 received via IPv6 Router Advertisement (RA) will be used as DNS search domain over this link, similar to
1280 the effect of the <option>Domains=</option> setting. If set to <literal>route</literal>, the domain name
1281 received via IPv6 RA will be used for routing DNS queries only, but not for searching, similar to the
1282 effect of the <option>Domains=</option> setting when the argument is prefixed with
1283 <literal>~</literal>. Defaults to false.</para>
1284
1285 <para>It is recommended to enable this option only on trusted networks, as setting this affects resolution
1286 of all host names, in particular of single-label names. It is generally safer to use the supplied domain
1287 only as routing domain, rather than as search domain, in order to not have it affect local resolution of
1288 single-label names.</para>
1289
1290 <para>When set to true, this setting corresponds to the <option>domain</option> option in <citerefentry
1291 project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
1292 </listitem>
1293 </varlistentry>
2ba31d29
JK
1294
1295 <varlistentry>
1296 <term><varname>RouteTable=<replaceable>num</replaceable></varname></term>
1297 <listitem>
d11e656a
ZJS
1298 <para>The table identifier for the routes received in the Router Advertisement
1299 (a number between 1 and 4294967295, or 0 to unset).
2ba31d29
JK
1300 The table can be retrieved using <command>ip route show table <replaceable>num</replaceable></command>.
1301 </para>
1302 </listitem>
1303 </varlistentry>
1e7a0e21
LP
1304 </variablelist>
1305 </refsect1>
1306
1307
ad943783
LP
1308 <refsect1>
1309 <title>[DHCPServer] Section Options</title>
1310 <para>The <literal>[DHCPServer]</literal> section contains
1311 settings for the DHCP server, if enabled via the
1312 <varname>DHCPServer=</varname> option described above:</para>
1313
1314 <variablelist class='network-directives'>
1315
9b3a67c5
TG
1316 <varlistentry>
1317 <term><varname>PoolOffset=</varname></term>
1318 <term><varname>PoolSize=</varname></term>
1319
1320 <listitem><para>Configures the pool of addresses to hand out. The pool
1321 is a contiguous sequence of IP addresses in the subnet configured for
1322 the server address, which does not include the subnet nor the broadcast
1323 address. <varname>PoolOffset=</varname> takes the offset of the pool
1324 from the start of subnet, or zero to use the default value.
1325 <varname>PoolSize=</varname> takes the number of IP addresses in the
b938cb90 1326 pool or zero to use the default value. By default, the pool starts at
9b3a67c5
TG
1327 the first address after the subnet address and takes up the rest of
1328 the subnet, excluding the broadcast address. If the pool includes
1329 the server address (the default), this is reserved and not handed
1330 out to clients.</para></listitem>
1331 </varlistentry>
1332
ad943783
LP
1333 <varlistentry>
1334 <term><varname>DefaultLeaseTimeSec=</varname></term>
1335 <term><varname>MaxLeaseTimeSec=</varname></term>
1336
1337 <listitem><para>Control the default and maximum DHCP lease
1338 time to pass to clients. These settings take time values in seconds or
1339 another common time unit, depending on the suffix. The default
1340 lease time is used for clients that did not ask for a specific
1341 lease time. If a client asks for a lease time longer than the
b938cb90 1342 maximum lease time, it is automatically shortened to the
ad943783
LP
1343 specified time. The default lease time defaults to 1h, the
1344 maximum lease time to 12h. Shorter lease times are beneficial
1345 if the configuration data in DHCP leases changes frequently
1346 and clients shall learn the new settings with shorter
1347 latencies. Longer lease times reduce the generated DHCP
1348 network traffic.</para></listitem>
1349 </varlistentry>
1350
1351 <varlistentry>
1352 <term><varname>EmitDNS=</varname></term>
1353 <term><varname>DNS=</varname></term>
1354
1355 <listitem><para>Configures whether the DHCP leases handed out
1356 to clients shall contain DNS server information. The
1357 <varname>EmitDNS=</varname> setting takes a boolean argument
1358 and defaults to <literal>yes</literal>. The DNS servers to
1359 pass to clients may be configured with the
1360 <varname>DNS=</varname> option, which takes a list of IPv4
1361 addresses. If the <varname>EmitDNS=</varname> option is
b938cb90 1362 enabled but no servers configured, the servers are
ad943783
LP
1363 automatically propagated from an "uplink" interface that has
1364 appropriate servers set. The "uplink" interface is determined
1365 by the default route of the system with the highest
1366 priority. Note that this information is acquired at the time
1367 the lease is handed out, and does not take uplink interfaces
1368 into account that acquire DNS or NTP server information at a
1369 later point. DNS server propagation does not take
1370 <filename>/etc/resolv.conf</filename> into account. Also, note
a8eaaee7 1371 that the leases are not refreshed if the uplink network
ad943783 1372 configuration changes. To ensure clients regularly acquire the
b938cb90 1373 most current uplink DNS server information, it is thus
ad943783
LP
1374 advisable to shorten the DHCP lease time via
1375 <varname>MaxLeaseTimeSec=</varname> described
1376 above.</para></listitem>
1377 </varlistentry>
1378
1379 <varlistentry>
1380 <term><varname>EmitNTP=</varname></term>
1381 <term><varname>NTP=</varname></term>
1382
1383 <listitem><para>Similar to the <varname>EmitDNS=</varname> and
b938cb90 1384 <varname>DNS=</varname> settings described above, these
ad943783
LP
1385 settings configure whether and what NTP server information
1386 shall be emitted as part of the DHCP lease. The same syntax,
1387 propagation semantics and defaults apply as for
1388 <varname>EmitDNS=</varname> and
1389 <varname>DNS=</varname>.</para></listitem>
1390 </varlistentry>
1391
77ff6022
CG
1392 <varlistentry>
1393 <term><varname>EmitRouter=</varname></term>
1394
1395 <listitem><para>Similar to the <varname>EmitDNS=</varname>
1396 setting described above, this setting configures whether the
1397 DHCP lease should contain the router option. The same syntax,
1398 propagation semantics and defaults apply as for
1399 <varname>EmitDNS=</varname>.</para></listitem>
1400 </varlistentry>
1401
ad943783
LP
1402 <varlistentry>
1403 <term><varname>EmitTimezone=</varname></term>
1404 <term><varname>Timezone=</varname></term>
1405
1406 <listitem><para>Configures whether the DHCP leases handed out
1407 to clients shall contain timezone information. The
1408 <varname>EmitTimezone=</varname> setting takes a boolean
1409 argument and defaults to <literal>yes</literal>. The
1410 <varname>Timezone=</varname> setting takes a timezone string
1411 (such as <literal>Europe/Berlin</literal> or
1412 <literal>UTC</literal>) to pass to clients. If no explicit
b938cb90 1413 timezone is set, the system timezone of the local host is
ad943783
LP
1414 propagated, as determined by the
1415 <filename>/etc/localtime</filename> symlink.</para></listitem>
1416 </varlistentry>
1417
1418 </variablelist>
1419 </refsect1>
1420
798d3a52 1421 <refsect1>
3f9e0236
PF
1422 <title>[IPv6PrefixDelegation] Section Options</title>
1423 <para>The <literal>[IPv6PrefixDelegation]</literal> section contains
1424 settings for sending IPv6 Router Advertisements and whether to act as
1425 a router, if enabled via the <varname>IPv6PrefixDelegation=</varname>
1426 option described above. IPv6 network prefixes are defined with one or
1427 more <literal>[IPv6Prefix]</literal> sections.</para>
1428
1429 <variablelist class='network-directives'>
1430
1431 <varlistentry>
1432 <term><varname>Managed=</varname></term>
1433 <term><varname>OtherInformation=</varname></term>
1434
1435 <listitem><para>Controls whether a DHCPv6 server is used to acquire IPv6
1436 addresses on the network link when <varname>Managed=</varname> boolean
1437 is set to <literal>true</literal> or if only additional network
1438 information can be obtained via DHCPv6 for the network link when
1439 <varname>OtherInformation=</varname> boolean is set to
1440 <literal>true</literal>. Both settings default to
1441 <literal>false</literal>, which means that a DHCPv6 server is not being
1442 used.</para></listitem>
1443 </varlistentry>
1444
1445 <varlistentry>
1446 <term><varname>RouterLifetimeSec=</varname></term>
1447
1448 <listitem><para>Configures the IPv6 router lifetime in seconds. If set,
1449 this host also announces itself in Router Advertisements as an IPv6
1450 router for the network link. Defaults to unset, which means the host is
1451 not acting as a router.</para>
1452 </listitem>
1453 </varlistentry>
1454
1455 <varlistentry>
1456 <term><varname>RouterPreference=</varname></term>
1457
1458 <listitem><para>Configures IPv6 router preference if
1459 <varname>RouterLifetimeSec=</varname> is non-zero. Valid values are
1460 <literal>high</literal>, <literal>medium</literal> and
1461 <literal>low</literal>, with <literal>normal</literal> and
1462 <literal>default</literal> added as synonyms for
1463 <literal>medium</literal> just to make configuration easier. See
1464 <ulink url="https://tools.ietf.org/html/rfc4191">RFC 4191</ulink>
1465 for details. Defaults to <literal>medium</literal>.</para></listitem>
1466 </varlistentry>
1467
1468 <varlistentry>
4cb8478c 1469 <term><varname>EmitDNS=</varname></term>
3f9e0236
PF
1470 <term><varname>DNS=</varname></term>
1471
4cb8478c
PF
1472 <listitem><para><varname>DNS=</varname> specifies a list of recursive
1473 DNS server IPv6 addresses that distributed via Router Advertisement
1474 messages when <varname>EmitDNS=</varname> is true. If <varname>DNS=
1475 </varname> is empty, DNS servers are read from the
1476 <literal>[Network]</literal> section. If the
1477 <literal>[Network]</literal> section does not contain any DNS servers
1478 either, DNS servers from the uplink with the highest priority default
1479 route are used. When <varname>EmitDNS=</varname> is false, no DNS server
1480 information is sent in Router Advertisement messages.
1481 <varname>EmitDNS=</varname> defaults to true.
3f9e0236
PF
1482 </para></listitem>
1483 </varlistentry>
1484
760021c0 1485 <varlistentry>
4cb8478c 1486 <term><varname>EmitDomains=</varname></term>
760021c0
PF
1487 <term><varname>Domains=</varname></term>
1488
4cb8478c
PF
1489 <listitem><para>A list of DNS search domains distributed via Router
1490 Advertisement messages when <varname>EmitDomains=</varname> is true. If
1491 <varname>Domains=</varname> is empty, DNS search domains are read from the
1492 <literal>[Network]</literal> section. If the <literal>[Network]</literal>
1493 section does not contain any DNS search domains either, DNS search
1494 domains from the uplink with the highest priority default route are
1495 used. When <varname>EmitDomains=</varname> is false, no DNS search domain
1496 information is sent in Router Advertisement messages.
1497 <varname>EmitDomains=</varname> defaults to true.
1498 </para></listitem>
760021c0
PF
1499 </varlistentry>
1500
3f9e0236
PF
1501 <varlistentry>
1502 <term><varname>DNSLifetimeSec=</varname></term>
1503
1504 <listitem><para>Lifetime in seconds for the DNS server addresses listed
760021c0
PF
1505 in <varname>DNS=</varname> and search domains listed in
1506 <varname>Domains=</varname>.</para></listitem>
3f9e0236
PF
1507 </varlistentry>
1508
1509 </variablelist>
1510 </refsect1>
1511
1512 <refsect1>
1513 <title>[IPv6Prefix] Section Options</title>
1514 <para>One or more <literal>[IPv6Prefix]</literal> sections contain the IPv6
1515 prefixes that are announced via Router Advertisements. See
1516 <ulink url="https://tools.ietf.org/html/rfc4861">RFC 4861</ulink>
1517 for further details.</para>
1518
1519 <variablelist class='network-directives'>
1520
1521 <varlistentry>
1522 <term><varname>AddressAutoconfiguration=</varname></term>
1523 <term><varname>OnLink=</varname></term>
1524
1525 <listitem><para>Boolean values to specify whether IPv6 addresses can be
1526 autoconfigured with this prefix and whether the prefix can be used for
1527 onlink determination. Both settings default to <literal>true</literal>
1528 in order to ease configuration.
1529 </para></listitem>
1530 </varlistentry>
1531
1532 <varlistentry>
1533 <term><varname>Prefix=</varname></term>
1534
1535 <listitem><para>The IPv6 prefix that is to be distributed to hosts.
1536 Similarly to configuring static IPv6 addresses, the setting is
1537 configured as an IPv6 prefix and its prefix length, separated by a
1538 <literal>/</literal> character. Use multiple
1539 <literal>[IPv6Prefix]</literal> sections to configure multiple IPv6
1540 prefixes since prefix lifetimes, address autoconfiguration and onlink
1541 status may differ from one prefix to another.</para></listitem>
1542 </varlistentry>
1543
1544 <varlistentry>
1545 <term><varname>PreferredLifetimeSec=</varname></term>
1546 <term><varname>ValidLifetimeSec=</varname></term>
1547
1548 <listitem><para>Preferred and valid lifetimes for the prefix measured in
1549 seconds. <varname>PreferredLifetimeSec=</varname> defaults to 604800
1550 seconds (one week) and <varname>ValidLifetimeSec=</varname> defaults
1551 to 2592000 seconds (30 days).</para></listitem>
1552 </varlistentry>
1553
1554 </variablelist>
1555 </refsect1>
1556
1557 <refsect1>
798d3a52
ZJS
1558 <title>[Bridge] Section Options</title>
1559 <para>The <literal>[Bridge]</literal> section accepts the
1560 following keys.</para>
1561 <variablelist class='network-directives'>
165c41a9
SS
1562 <varlistentry>
1563 <term><varname>UnicastFlood=</varname></term>
1564 <listitem>
072f9e4a
ZJS
1565 <para>A boolean. Controls whether the bridge should flood
1566 traffic for which an FDB entry is missing and the destination
1567 is unknown through this port. Defaults to on.
47c7dfe2 1568 </para>
165c41a9
SS
1569 </listitem>
1570 </varlistentry>
1571 <varlistentry>
1572 <term><varname>HairPin=</varname></term>
1573 <listitem>
47c7dfe2
ZJS
1574 <para>A boolean. Configures whether traffic may be sent back
1575 out of the port on which it was received. By default, this
1576 flag is false, and the bridge will not forward traffic back
1577 out of the receiving port.</para>
165c41a9
SS
1578 </listitem>
1579 </varlistentry>
1580 <varlistentry>
84c34096 1581 <term><varname>UseBPDU=</varname></term>
165c41a9 1582 <listitem>
47c7dfe2 1583 <para>A boolean. Configures whether STP Bridge Protocol Data Units will be
84c34096 1584 processed by the bridge port. Defaults to yes.</para>
165c41a9
SS
1585 </listitem>
1586 </varlistentry>
1587 <varlistentry>
1588 <term><varname>FastLeave=</varname></term>
1589 <listitem>
47c7dfe2 1590 <para>A boolean. This flag allows the bridge to immediately stop multicast
a8eaaee7 1591 traffic on a port that receives an IGMP Leave message. It is only used with
47c7dfe2 1592 IGMP snooping if enabled on the bridge. Defaults to off.</para>
165c41a9
SS
1593 </listitem>
1594 </varlistentry>
1595 <varlistentry>
23da66bb 1596 <term><varname>AllowPortToBeRoot=</varname></term>
165c41a9 1597 <listitem>
47c7dfe2
ZJS
1598 <para>A boolean. Configures whether a given port is allowed to
1599 become a root port. Only used when STP is enabled on the bridge.
23da66bb 1600 Defaults to on.</para>
165c41a9
SS
1601 </listitem>
1602 </varlistentry>
798d3a52
ZJS
1603 <varlistentry>
1604 <term><varname>Cost=</varname></term>
1605 <listitem>
47c7dfe2 1606 <para>Sets the "cost" of sending packets of this interface.
a8eaaee7 1607 Each port in a bridge may have a different speed and the cost
798d3a52 1608 is used to decide which link to use. Faster interfaces
785889e5 1609 should have lower costs. It is an integer value between 1 and
b56be296
DJL
1610 65535.</para>
1611 </listitem>
1612 </varlistentry>
1613 <varlistentry>
1614 <term><varname>Priority=</varname></term>
1615 <listitem>
1616 <para>Sets the "priority" of sending packets on this interface.
1617 Each port in a bridge may have a different priority which is used
1618 to decide which link to use. Lower value means higher priority.
785889e5 1619 It is an integer value between 0 to 63. Networkd does not set any
b56be296 1620 default, meaning the kernel default value of 32 is used.</para>
798d3a52
ZJS
1621 </listitem>
1622 </varlistentry>
1623 </variablelist>
1624 </refsect1>
798d3a52
ZJS
1625 <refsect1>
1626 <title>[BridgeFDB] Section Options</title>
1627 <para>The <literal>[BridgeFDB]</literal> section manages the
1628 forwarding database table of a port and accepts the following
1629 keys. Specify several <literal>[BridgeFDB]</literal> sections to
1630 configure several static MAC table entries.</para>
1631
1632 <variablelist class='network-directives'>
1633 <varlistentry>
1634 <term><varname>MACAddress=</varname></term>
1635 <listitem>
1636 <para>As in the <literal>[Network]</literal> section. This
1637 key is mandatory.</para>
1638 </listitem>
1639 </varlistentry>
1640 <varlistentry>
1641 <term><varname>VLANId=</varname></term>
1642 <listitem>
a8eaaee7
JE
1643 <para>The VLAN ID for the new static MAC table entry. If
1644 omitted, no VLAN ID info is appended to the new static MAC
798d3a52
ZJS
1645 table entry.</para>
1646 </listitem>
1647 </varlistentry>
1648 </variablelist>
1649 </refsect1>
13b498f9
TJ
1650 <refsect1>
1651 <title>[BridgeVLAN] Section Options</title>
1652 <para>The <literal>[BridgeVLAN]</literal> section manages the VLAN ID configuration of a bridge port and accepts
1653 the following keys. Specify several <literal>[BridgeVLAN]</literal> sections to configure several VLAN entries.
1654 The <varname>VLANFiltering=</varname> option has to be enabled, see <literal>[Bridge]</literal> section in
1655 <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
1656
1657 <variablelist class='network-directives'>
1658 <varlistentry>
1659 <term><varname>VLAN=</varname></term>
1660 <listitem>
1661 <para>The VLAN ID allowed on the port. This can be either a single ID or a range M-N. VLAN IDs are valid
1662 from 1 to 4094.</para>
1663 </listitem>
1664 </varlistentry>
1665 <varlistentry>
1666 <term><varname>EgressUntagged=</varname></term>
1667 <listitem>
1668 <para>The VLAN ID specified here will be used to untag frames on egress. Configuring
1669 <varname>EgressUntagged=</varname> implicates the use of <varname>VLAN=</varname> above and will enable the
1670 VLAN ID for ingress as well. This can be either a single ID or a range M-N.</para>
1671 </listitem>
1672 </varlistentry>
1673 <varlistentry>
1674 <term><varname>PVID=</varname></term>
1675 <listitem>
1676 <para>The Port VLAN ID specified here is assigned to all untagged frames at ingress.
1677 <varname>PVID=</varname> can be used only once. Configuring <varname>PVID=</varname> implicates the use of
1678 <varname>VLAN=</varname> above and will enable the VLAN ID for ingress as well.</para>
1679 </listitem>
1680 </varlistentry>
1681 </variablelist>
1682 </refsect1>
798d3a52
ZJS
1683
1684 <refsect1>
9e35b3de 1685 <title>Examples</title>
798d3a52 1686 <example>
9e35b3de 1687 <title>Static network configuration</title>
798d3a52 1688
9e35b3de
ZJS
1689 <programlisting># /etc/systemd/network/50-static.network
1690[Match]
eac684ef
TG
1691Name=enp2s0
1692
1693[Network]
1694Address=192.168.0.15/24
1695Gateway=192.168.0.1</programlisting>
9e35b3de
ZJS
1696
1697 <para>This brings interface <literal>enp2s0</literal> up with a static address. The
1698 specified gateway will be used for a default route.</para>
798d3a52 1699 </example>
eac684ef 1700
798d3a52 1701 <example>
9e35b3de 1702 <title>DHCP on ethernet links</title>
eac684ef 1703
9e35b3de
ZJS
1704 <programlisting># /etc/systemd/network/80-dhcp.network
1705[Match]
eac684ef
TG
1706Name=en*
1707
1708[Network]
9c8ca3f7 1709DHCP=yes</programlisting>
9e35b3de
ZJS
1710
1711 <para>This will enable DHCPv4 and DHCPv6 on all interfaces with names starting with
1712 <literal>en</literal> (i.e. ethernet interfaces).</para>
798d3a52 1713 </example>
eac684ef 1714
798d3a52 1715 <example>
9e35b3de 1716 <title>A bridge with two enslaved links</title>
f47c5c47 1717
9e35b3de
ZJS
1718 <programlisting># /etc/systemd/network/25-bridge-static.network
1719[Match]
f47c5c47 1720Name=bridge0
1721
1722[Network]
1723Address=192.168.0.15/24
1724Gateway=192.168.0.1
1725DNS=192.168.0.1</programlisting>
f47c5c47 1726
9e35b3de
ZJS
1727 <programlisting># /etc/systemd/network/25-bridge-slave-interface-1.network
1728[Match]
f47c5c47 1729Name=enp2s0
1730
1731[Network]
1732Bridge=bridge0</programlisting>
9e35b3de
ZJS
1733
1734 <programlisting># /etc/systemd/network/25-bridge-slave-interface-2.network
1735[Match]
1736Name=wlp3s0
1737
1738[Network]
1739Bridge=bridge0</programlisting>
1740
1741 <para>This creates a bridge and attaches devices <literal>enp2s0</literal> and
1742 <literal>wlp3s0</literal> to it. The bridge will have the specified static address
1743 and network assigned, and a default route via the specified gateway will be
1744 added. The specified DNS server will be added to the global list of DNS resolvers.
1745 </para>
13b498f9 1746 </example>
9e35b3de 1747
13b498f9 1748 <example>
9e35b3de 1749 <title></title>
13b498f9 1750
9e35b3de
ZJS
1751 <programlisting>
1752# /etc/systemd/network/20-bridge-slave-interface-vlan.network
1753[Match]
13b498f9
TJ
1754Name=enp2s0
1755
1756[Network]
1757Bridge=bridge0
1758
1759[BridgeVLAN]
1760VLAN=1-32
1761PVID=42
1762EgressUntagged=42
1763
1764[BridgeVLAN]
1765VLAN=100-200
1766
1767[BridgeVLAN]
1768EgressUntagged=300-400</programlisting>
0a8a0fad 1769
9e35b3de
ZJS
1770 <para>This overrides the configuration specified in the previous example for the
1771 interface <literal>enp2s0</literal>, and enables VLAN on that bridge port. VLAN IDs
1772 1-32, 42, 100-400 will be allowed. Packets tagged with VLAN IDs 42, 300-400 will be
1773 untagged when they leave on this interface. Untagged packets which arrive on this
1774 interface will be assigned VLAN ID 42.</para>
798d3a52 1775 </example>
0a8a0fad 1776
798d3a52 1777 <example>
9e35b3de 1778 <title>Various tunnels</title>
0a8a0fad 1779
9e35b3de
ZJS
1780 <programlisting>/etc/systemd/network/25-tunnels.network
1781[Match]
1782Name=ens1
0a8a0fad
TG
1783
1784[Network]
9e35b3de
ZJS
1785Tunnel=ipip-tun
1786Tunnel=sit-tun
1787Tunnel=gre-tun
1788Tunnel=vti-tun
1789 </programlisting>
1790
1791 <programlisting>/etc/systemd/network/25-tunnel-ipip.netdev
1792[NetDev]
1793Name=ipip-tun
1794Kind=ipip
1795 </programlisting>
1796
1797 <programlisting>/etc/systemd/network/25-tunnel-sit.netdev
1798[NetDev]
1799Name=sit-tun
1800Kind=sit
1801 </programlisting>
1802
1803 <programlisting>/etc/systemd/network/25-tunnel-gre.netdev
1804[NetDev]
1805Name=gre-tun
1806Kind=gre
1807 </programlisting>
1808
1809 <programlisting>/etc/systemd/network/25-tunnel-vti.netdev
1810[NetDev]
1811Name=vti-tun
1812Kind=vti
1813 </programlisting>
1814
1815 <para>This will bring interface <literal>ens1</literal> up and create an IPIP tunnel,
1816 a SIT tunnel, a GRE tunnel, and a VTI tunnel using it.</para>
798d3a52 1817 </example>
0a8a0fad 1818
798d3a52 1819 <example>
9e35b3de 1820 <title>A bond device</title>
0a8a0fad 1821
9e35b3de
ZJS
1822 <programlisting># /etc/systemd/network/30-bond1.network
1823[Match]
1824Name=bond1
0a8a0fad
TG
1825
1826[Network]
9e35b3de
ZJS
1827DHCP=ipv6
1828</programlisting>
0a8a0fad 1829
9e35b3de
ZJS
1830 <programlisting># /etc/systemd/network/30-bond1.netdev
1831[NetDev]
1832Name=bond1
1833Kind=bond
1834</programlisting>
0a8a0fad 1835
301a21a8 1836 <programlisting># /etc/systemd/network/30-bond1-dev1.network
9e35b3de
ZJS
1837[Match]
1838MACAddress=52:54:00:e9:64:41
0a8a0fad
TG
1839
1840[Network]
9e35b3de
ZJS
1841Bond=bond1
1842</programlisting>
d94facdc 1843
301a21a8 1844 <programlisting># /etc/systemd/network/30-bond1-dev2.network
9e35b3de
ZJS
1845[Match]
1846MACAddress=52:54:00:e9:64:42
d94facdc
MH
1847
1848[Network]
9e35b3de 1849Bond=bond1
6cb955c6 1850</programlisting>
9e35b3de
ZJS
1851
1852 <para>This will create a bond device <literal>bond1</literal> and enslave the two
1853 devices with MAC addresses 52:54:00:e9:64:41 and 52:54:00:e9:64:42 to it. IPv6 DHCP
1854 will be used to acquire an address.</para>
6cb955c6
AR
1855 </example>
1856
1857 <example>
9e35b3de
ZJS
1858 <title>Virtual Routing and Forwarding (VRF)</title>
1859 <para>Add the <literal>bond1</literal> interface to the VRF master interface
1860 <literal>vrf1</literal>. This will redirect routes generated on this interface to be
11d38b90
AR
1861 within the routing table defined during VRF creation. For kernels before 4.8 traffic
1862 won't be redirected towards the VRFs routing table unless specific ip-rules are added.
1863 </para>
9e35b3de
ZJS
1864 <programlisting># /etc/systemd/network/25-vrf.network
1865[Match]
6cb955c6
AR
1866Name=bond1
1867
1868[Network]
9e35b3de 1869VRF=vrf1
d94facdc
MH
1870</programlisting>
1871 </example>
1872
42125eda
SS
1873 <example>
1874 <title>MacVTap</title>
1875 <para>This brings up a network interface <literal>macvtap-test</literal>
1876 and attaches it to <literal>enp0s25</literal>.</para>
83ddf5d3 1877 <programlisting># /usr/lib/systemd/network/25-macvtap.network
42125eda
SS
1878[Match]
1879Name=enp0s25
1880
1881[Network]
1882MACVTAP=macvtap-test
1883</programlisting>
1884 </example>
798d3a52
ZJS
1885 </refsect1>
1886
1887 <refsect1>
1888 <title>See Also</title>
1889 <para>
1890 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
f41b446a 1891 <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
798d3a52 1892 <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
aaa297d4
LP
1893 <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1894 <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
798d3a52
ZJS
1895 </para>
1896 </refsect1>
eac684ef
TG
1897
1898</refentry>