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