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