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