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