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