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