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