]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd.network.xml
networkd: dhcp6 - split up configure() method
[thirdparty/systemd.git] / man / systemd.network.xml
CommitLineData
ad943783 1<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
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<!--
6 This file is part of systemd.
7
8 Copyright 2013 Tom Gundersen
9
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22-->
23
24<refentry id="systemd.network" conditional='ENABLE_NETWORKD'>
25
798d3a52
ZJS
26 <refentryinfo>
27 <title>systemd.network</title>
28 <productname>systemd</productname>
29
30 <authorgroup>
31 <author>
32 <contrib>Developer</contrib>
33 <firstname>Tom</firstname>
34 <surname>Gundersen</surname>
35 <email>teg@jklm.no</email>
36 </author>
37 </authorgroup>
38 </refentryinfo>
39
40 <refmeta>
41 <refentrytitle>systemd.network</refentrytitle>
42 <manvolnum>5</manvolnum>
43 </refmeta>
44
45 <refnamediv>
46 <refname>systemd.network</refname>
47 <refpurpose>Network configuration</refpurpose>
48 </refnamediv>
49
50 <refsynopsisdiv>
51 <para><filename><replaceable>network</replaceable>.network</filename></para>
52 </refsynopsisdiv>
53
54 <refsect1>
55 <title>Description</title>
56
57 <para>Network setup is performed by
58 <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
59 </para>
60
61 <para>Network files must have the extension
62 <filename>.network</filename>; other extensions are ignored.
63 Networks are applied to links whenever the links appear.</para>
64
65 <para>The <filename>.network</filename> files are read from the
66 files located in the system network directory
12b42c76 67 <filename>/usr/lib/systemd/network</filename>, the volatile
798d3a52
ZJS
68 runtime network directory
69 <filename>/run/systemd/network</filename> and the local
70 administration network directory
12b42c76 71 <filename>/etc/systemd/network</filename>. All configuration files
798d3a52
ZJS
72 are collectively sorted and processed in lexical order, regardless
73 of the directories in which they live. However, files with
74 identical filenames replace each other. Files in
75 <filename>/etc</filename> have the highest priority, files in
76 <filename>/run</filename> take precedence over files with the same
12b42c76 77 name in <filename>/usr/lib</filename>. This can be used to
798d3a52 78 override a system-supplied configuration file with a local file if
57e27ec0 79 needed. As a special case, an empty file (file size 0) or symlink
b938cb90 80 with the same name pointing to <filename>/dev/null</filename>
a8eaaee7 81 disables the configuration file entirely (it is "masked").</para>
798d3a52
ZJS
82 </refsect1>
83
84 <refsect1>
85 <title>[Match] Section Options</title>
86
87 <para>The network file contains a <literal>[Match]</literal>
88 section, which determines if a given network file may be applied
89 to a given device; and a <literal>[Network]</literal> section
90 specifying how the device should be configured. The first (in
91 lexical order) of the network files that matches a given device
a22e1850
LP
92 is applied, all later files are ignored, even if they match as
93 well.</para>
798d3a52
ZJS
94
95 <para>A network file is said to match a device if each of the
96 entries in the <literal>[Match]</literal> section matches, or if
97 the section is empty. The following keys are accepted:</para>
98
99 <variablelist class='network-directives'>
100 <varlistentry>
101 <term><varname>MACAddress=</varname></term>
102 <listitem>
103 <para>The hardware address.</para>
104 </listitem>
105 </varlistentry>
106 <varlistentry>
107 <term><varname>Path=</varname></term>
108 <listitem>
5256e00e
TG
109 <para>A whitespace-separated list of shell-style globs
110 matching the persistent path, as exposed by the udev
111 property <literal>ID_PATH</literal>.</para>
798d3a52
ZJS
112 </listitem>
113 </varlistentry>
114 <varlistentry>
115 <term><varname>Driver=</varname></term>
116 <listitem>
5256e00e
TG
117 <para>A whitespace-separated list of shell-style globs
118 matching the driver currently bound to the device, as
798d3a52
ZJS
119 exposed by the udev property <literal>DRIVER</literal>
120 of its parent device, or if that is not set the driver
121 as exposed by <literal>ethtool -i</literal> of the
122 device itself.</para>
123 </listitem>
124 </varlistentry>
125 <varlistentry>
126 <term><varname>Type=</varname></term>
127 <listitem>
5256e00e
TG
128 <para>A whitespace-separated list of shell-style globs
129 matching the device type, as exposed by the udev property
798d3a52
ZJS
130 <literal>DEVTYPE</literal>.</para>
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
138 <literal>INTERFACE</literal>.</para>
798d3a52
ZJS
139 </listitem>
140 </varlistentry>
141 <varlistentry>
142 <term><varname>Host=</varname></term>
143 <listitem>
144 <para>Matches against the hostname or machine ID of the
145 host. See <literal>ConditionHost=</literal> in
146 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
147 for details.
148 </para>
149 </listitem>
150 </varlistentry>
151 <varlistentry>
152 <term><varname>Virtualization=</varname></term>
153 <listitem>
154 <para>Checks whether the system is executed in a virtualized
155 environment and optionally test whether it is a specific
156 implementation. See <literal>ConditionVirtualization=</literal> in
157 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
158 for details.
159 </para>
160 </listitem>
161 </varlistentry>
162 <varlistentry>
163 <term><varname>KernelCommandLine=</varname></term>
164 <listitem>
165 <para>Checks whether a specific kernel command line option is
166 set (or if prefixed with the exclamation mark unset). See
167 <literal>ConditionKernelCommandLine=</literal> in
168 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
169 for details.
170 </para>
171 </listitem>
172 </varlistentry>
173 <varlistentry>
174 <term><varname>Architecture=</varname></term>
175 <listitem>
176 <para>Checks whether the system is running on a specific
177 architecture. See <literal>ConditionArchitecture=</literal> in
178 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
179 for details.
180 </para>
181 </listitem>
182 </varlistentry>
183 </variablelist>
184
185 </refsect1>
186
187 <refsect1>
188 <title>[Link] Section Options</title>
189
190 <para> The <literal>[Link]</literal> section accepts the following keys:</para>
191
192 <variablelist class='network-directives'>
193 <varlistentry>
194 <term><varname>MACAddress=</varname></term>
195 <listitem>
196 <para>The hardware address.</para>
197 </listitem>
198 </varlistentry>
199 <varlistentry>
200 <term><varname>MTUBytes=</varname></term>
201 <listitem>
202 <para>The maximum transmission unit in bytes to set for the
203 device. The usual suffixes K, M, G, are supported and are
204 understood to the base of 1024.</para>
205 </listitem>
206 </varlistentry>
207 </variablelist>
208 </refsect1>
209
210 <refsect1>
211 <title>[Network] Section Options</title>
212
213 <para>The <literal>[Network]</literal> section accepts the following keys:</para>
214
215 <variablelist class='network-directives'>
216 <varlistentry>
217 <term><varname>Description=</varname></term>
218 <listitem>
219 <para>A description of the device. This is only used for
220 presentation purposes.</para>
221 </listitem>
222 </varlistentry>
223 <varlistentry>
224 <term><varname>DHCP=</varname></term>
225 <listitem>
ad943783 226 <para>Enables DHCPv4 and/or DHCPv6 client support. Accepts
798d3a52
ZJS
227 <literal>yes</literal>, <literal>no</literal>,
228 <literal>ipv4</literal>, or <literal>ipv6</literal>.</para>
e88d8021 229
b938cb90 230 <para>Please note that, by default, the domain name
e88d8021
ZJS
231 specified through DHCP is not used for name resolution.
232 See option <option>UseDomains=</option> below.</para>
798d3a52
ZJS
233 </listitem>
234 </varlistentry>
235 <varlistentry>
236 <term><varname>DHCPServer=</varname></term>
237 <listitem>
ad943783
LP
238 <para>A boolean. Enables DHCPv4 server support. Defaults
239 to <literal>no</literal>. Further settings for the DHCP
240 server may be set in the <literal>[DHCPServer]</literal>
241 section described below.</para>
798d3a52
ZJS
242 </listitem>
243 </varlistentry>
244 <varlistentry>
56fd6bf7 245 <term><varname>LinkLocalAddressing=</varname></term>
798d3a52 246 <listitem>
d0d6a4cd
TG
247 <para>Enables link-local address autoconfiguration. Accepts
248 <literal>yes</literal>, <literal>no</literal>,
249 <literal>ipv4</literal>, or <literal>ipv6</literal>. Defaults to
250 <literal>ipv6</literal>.</para>
798d3a52
ZJS
251 </listitem>
252 </varlistentry>
253 <varlistentry>
254 <term><varname>IPv4LLRoute=</varname></term>
255 <listitem>
256 <para>A boolean. When true, sets up the route needed for
257 non-IPv4LL hosts to communicate with IPv4LL-only hosts. Defaults
258 to false.
259 </para>
260 </listitem>
261 </varlistentry>
262 <varlistentry>
113bfde1
TG
263 <term><varname>IPv6Token=</varname></term>
264 <listitem>
265 <para>An IPv6 address with the top 64 bits unset. When set, indicates the
a8eaaee7 266 64-bit interface part of SLAAC IPv6 addresses for this link. By default,
113bfde1
TG
267 it is autogenerated.</para>
268 </listitem>
269 </varlistentry>
270 <varlistentry>
798d3a52
ZJS
271 <term><varname>LLMNR=</varname></term>
272 <listitem>
273 <para>A boolean or <literal>resolve</literal>. When true, enables
b938cb90
JE
274 Link-Local Multicast Name Resolution on the link. When set to
275 <literal>resolve</literal>, only resolution is enabled, but not
798d3a52
ZJS
276 announcement. Defaults to true.</para>
277 </listitem>
278 </varlistentry>
279 <varlistentry>
280 <term><varname>LLDP=</varname></term>
281 <listitem>
282 <para>A boolean. When true, enables LLDP link receive support.
283 </para>
284 </listitem>
285 </varlistentry>
0d4ad91d
AR
286 <varlistentry>
287 <term><varname>BindCarrier=</varname></term>
288 <listitem>
289 <para>A port or a list of ports. When set, controls the
dd2b607b 290 behavior of the current interface. When all ports in the list
0d4ad91d
AR
291 are in an operational down state, the current interface is brought
292 down. When at least one port has carrier, the current interface
293 is brought up.
294 </para>
295 </listitem>
296 </varlistentry>
798d3a52
ZJS
297 <varlistentry>
298 <term><varname>Address=</varname></term>
299 <listitem>
300 <para>A static IPv4 or IPv6 address and its prefix length,
301 separated by a <literal>/</literal> character. Specify
302 this key more than once to configure several addresses.
303 The format of the address must be as described in
3ba3a79d 304 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
798d3a52
ZJS
305 This is a short-hand for an [Address] section only
306 containing an Address key (see below). This option may be
307 specified more than once.
308 </para>
309
310 <para>If the specified address is 0.0.0.0 (for IPv4) or
311 [::] (for IPv6), a new address range of the requested size
312 is automatically allocated from a system-wide pool of
313 unused ranges. The allocated range is checked against all
314 current network interfaces and all known network
315 configuration files to avoid address range conflicts. The
316 default system-wide pool consists of 192.168.0.0/16,
317 172.16.0.0/12 and 10.0.0.0/8 for IPv4, and fc00::/7 for
318 IPv6. This functionality is useful to manage a large
319 number of dynamically created network interfaces with the
320 same network configuration and automatic address range
321 assignment.</para>
322
323 </listitem>
324 </varlistentry>
325 <varlistentry>
326 <term><varname>Gateway=</varname></term>
327 <listitem>
328 <para>The gateway address, which must be in the format
329 described in
3ba3a79d 330 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
798d3a52
ZJS
331 This is a short-hand for a [Route] section only containing
332 a Gateway key. This option may be specified more than
333 once.</para>
334 </listitem>
335 </varlistentry>
336 <varlistentry>
337 <term><varname>DNS=</varname></term>
338 <listitem>
339 <para>A DNS server address, which must be in the format
340 described in
3ba3a79d 341 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
798d3a52
ZJS
342 This option may be specified more than once.</para>
343 </listitem>
344 </varlistentry>
345 <varlistentry>
346 <term><varname>Domains=</varname></term>
347 <listitem>
348 <para>The domains used for DNS resolution over this link.</para>
349 </listitem>
350 </varlistentry>
351 <varlistentry>
352 <term><varname>NTP=</varname></term>
353 <listitem>
354 <para>An NTP server address. This option may be specified more than once.</para>
355 </listitem>
356 </varlistentry>
357 <varlistentry>
358 <term><varname>IPForward=</varname></term>
359 <listitem><para>Configures IP forwarding for the network
b938cb90 360 interface. If enabled, incoming packets on the network
798d3a52
ZJS
361 interface will be forwarded to other interfaces according to
362 the routing table. Takes either a boolean argument, or the
363 values <literal>ipv4</literal> or <literal>ipv6</literal>,
364 which only enables IP forwarding for the specified address
2972cba1
NO
365 family, or <literal>kernel</literal>, which preserves existing sysctl settings.
366 This controls the
4046d836
LP
367 <filename>net.ipv4.conf.&lt;interface&gt;.forwarding</filename>
368 and
369 <filename>net.ipv6.conf.&lt;interface&gt;.forwarding</filename>
370 sysctl options of the network interface (see <ulink
371 url="https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt">ip-sysctl.txt</ulink>
372 for details about sysctl options). Defaults to
373 <literal>no</literal>.</para>
374
2972cba1
NO
375 <para>Note: unless this option is turned on, or set to <literal>kernel</literal>,
376 no IP forwarding is done on this interface, even if this is
4046d836 377 globally turned on in the kernel, with the
e2bccc9d
DH
378 <filename>net.ipv4.ip_forward</filename>,
379 <filename>net.ipv4.conf.all.forwarding</filename>, and
380 <filename>net.ipv6.conf.all.forwarding</filename> sysctl
505c5f6d 381 options.</para>
4046d836 382 </listitem>
798d3a52
ZJS
383 </varlistentry>
384 <varlistentry>
385 <term><varname>IPMasquerade=</varname></term>
386 <listitem><para>Configures IP masquerading for the network
b938cb90 387 interface. If enabled, packets forwarded from the network
798d3a52
ZJS
388 interface will be appear as coming from the local host.
389 Takes a boolean argument. Implies
5c82dd13 390 <varname>IPForward=ipv4</varname>. Defaults to
4046d836 391 <literal>no</literal>.</para></listitem>
798d3a52 392 </varlistentry>
a46e37cb
SS
393 <varlistentry>
394 <term><varname>IPv6PrivacyExtensions=</varname></term>
1f0d9695
LP
395 <listitem><para>Configures use of stateless temporary
396 addresses that change over time (see <ulink
397 url="https://tools.ietf.org/html/rfc4941">RFC 4941</ulink>,
398 Privacy Extensions for Stateless Address Autoconfiguration
399 in IPv6). Takes a boolean or the special values
400 <literal>prefer-public</literal> and
b938cb90 401 <literal>kernel</literal>. When true, enables the privacy
1f0d9695 402 extensions and prefers temporary addresses over public
b938cb90 403 addresses. When <literal>prefer-public</literal>, enables the
1f0d9695
LP
404 privacy extensions, but prefers public addresses over
405 temporary addresses. When false, the privacy extensions
b938cb90 406 remain disabled. When <literal>kernel</literal>, the kernel's
1f0d9695 407 default setting will be left in place. Defaults to
a46e37cb
SS
408 <literal>no</literal>.</para></listitem>
409 </varlistentry>
941d0aa8
SS
410 <varlistentry>
411 <term><varname>IPv6AcceptRouterAdvertisements=</varname></term>
a8eaaee7 412 <listitem><para>Force the setting of the <filename>accept_ra</filename>
ebf98081
ZJS
413 (router advertisements) setting for the interface.
414 When unset, the kernel default is used, and router
415 advertisements are accepted only when local forwarding
416 is disabled for that interface.
417 Takes a boolean. If true, router advertisements are
418 accepted, when false, router advertisements are ignored,
419 independently of the local forwarding state.</para>
420
421 <para>See
422 <ulink url="https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt">ip-sysctl.txt</ulink>
423 in the kernel documentation, but note that systemd's
424 setting of <constant>1</constant> corresponds to
425 kernel's setting of <constant>2</constant>.</para>
426 </listitem>
941d0aa8 427 </varlistentry>
44de7fb1
SS
428 <varlistentry>
429 <term><varname>IPv6DuplicateAddressDetection=</varname></term>
a8eaaee7
JE
430 <listitem><para>Configures the amount of IPv6 Duplicate
431 Address Detection (DAD) probes to send. Defaults to unset.
44de7fb1
SS
432 </para></listitem>
433 </varlistentry>
a86cba89
SS
434 <varlistentry>
435 <term><varname>IPv6HopLimit=</varname></term>
436 <listitem><para>Configures IPv6 Hop Limit. For each router that
437 forwards the packet, the hop limit is decremented by 1. When the
438 hop limit field reaches zero, the packet is discarded.
439 Defaults to unset.
440 </para></listitem>
441 </varlistentry>
798d3a52
ZJS
442 <varlistentry>
443 <term><varname>Bridge=</varname></term>
444 <listitem>
445 <para>The name of the bridge to add the link to.</para>
446 </listitem>
447 </varlistentry>
448 <varlistentry>
449 <term><varname>Bond=</varname></term>
450 <listitem>
451 <para>The name of the bond to add the link to.</para>
452 </listitem>
453 </varlistentry>
454 <varlistentry>
455 <term><varname>VLAN=</varname></term>
456 <listitem>
457 <para>The name of a VLAN to create on the link. This
458 option may be specified more than once.</para>
459 </listitem>
460 </varlistentry>
461 <varlistentry>
462 <term><varname>MACVLAN=</varname></term>
463 <listitem>
464 <para>The name of a MACVLAN to create on the link. This
465 option may be specified more than once.</para>
466 </listitem>
467 </varlistentry>
468 <varlistentry>
469 <term><varname>VXLAN=</varname></term>
470 <listitem>
471 <para>The name of a VXLAN to create on the link. This
472 option may be specified more than once.</para>
473 </listitem>
474 </varlistentry>
475 <varlistentry>
476 <term><varname>Tunnel=</varname></term>
477 <listitem>
478 <para>The name of a Tunnel to create on the link. This
479 option may be specified more than once.</para>
480 </listitem>
481 </varlistentry>
482 </variablelist>
483
484 </refsect1>
485
486 <refsect1>
487 <title>[Address] Section Options</title>
488
489 <para>An <literal>[Address]</literal> section accepts the
490 following keys. Specify several <literal>[Address]</literal>
491 sections to configure several addresses.</para>
492
493 <variablelist class='network-directives'>
494 <varlistentry>
495 <term><varname>Address=</varname></term>
496 <listitem>
497 <para>As in the <literal>[Network]</literal> section. This
498 key is mandatory.</para>
499 </listitem>
500 </varlistentry>
501 <varlistentry>
502 <term><varname>Peer=</varname></term>
503 <listitem>
504 <para>The peer address in a point-to-point connection.
505 Accepts the same format as the <literal>Address</literal>
506 key.</para>
507 </listitem>
508 </varlistentry>
509 <varlistentry>
510 <term><varname>Broadcast=</varname></term>
511 <listitem>
512 <para>The broadcast address, which must be in the format
513 described in
3ba3a79d 514 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
798d3a52
ZJS
515 This key only applies to IPv4 addresses. If it is not
516 given, it is derived from the <literal>Address</literal>
517 key.</para>
518 </listitem>
519 </varlistentry>
520 <varlistentry>
521 <term><varname>Label=</varname></term>
522 <listitem>
523 <para>An address label.</para>
524 </listitem>
525 </varlistentry>
526 </variablelist>
527 </refsect1>
528
529 <refsect1>
530 <title>[Route] Section Options</title>
531 <para>The <literal>[Route]</literal> section accepts the
532 following keys. Specify several <literal>[Route]</literal>
533 sections to configure several routes.</para>
534
535 <variablelist class='network-directives'>
536 <varlistentry>
537 <term><varname>Gateway=</varname></term>
538 <listitem>
539 <para>As in the <literal>[Network]</literal> section.</para>
540 </listitem>
541 </varlistentry>
542 <varlistentry>
543 <term><varname>Destination=</varname></term>
544 <listitem>
545 <para>The destination prefix of the route. Possibly
b938cb90 546 followed by a slash and the prefix length. If omitted, a
798d3a52
ZJS
547 full-length host route is assumed.</para>
548 </listitem>
549 </varlistentry>
550 <varlistentry>
551 <term><varname>Source=</varname></term>
552 <listitem>
553 <para>The source prefix of the route. Possibly followed by
b938cb90 554 a slash and the prefix length. If omitted, a full-length
798d3a52
ZJS
555 host route is assumed.</para>
556 </listitem>
557 </varlistentry>
558 <varlistentry>
559 <term><varname>Metric=</varname></term>
560 <listitem>
b938cb90 561 <para>The metric of the route (an unsigned integer).</para>
798d3a52
ZJS
562 </listitem>
563 </varlistentry>
769b56a3
TG
564 <varlistentry>
565 <term><varname>Scope=</varname></term>
566 <listitem>
a8eaaee7 567 <para>The scope of the route, which can be <literal>global</literal>,
769b56a3
TG
568 <literal>link</literal> or <literal>host</literal>. Defaults to
569 <literal>global</literal>.</para>
570 </listitem>
0d07e595
JK
571 </varlistentry>
572 <varlistentry>
573 <term><varname>PreferredSource=</varname></term>
574 <listitem>
575 <para>The preferred source address of the route. The address
576 must be in the format described in
577 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
578 </listitem>
769b56a3 579 </varlistentry>
798d3a52
ZJS
580 </variablelist>
581 </refsect1>
582
583 <refsect1>
584 <title>[DHCP] Section Options</title>
ad943783
LP
585 <para>The <literal>[DHCP]</literal> section configures the
586 DHCPv4 and DHCP6 client, if it is enabled with the
587 <varname>DHCP=</varname> setting described above:</para>
798d3a52
ZJS
588
589 <variablelist class='network-directives'>
590 <varlistentry>
591 <term><varname>UseDNS=</varname></term>
592 <listitem>
593 <para>When true (the default), the DNS servers received
594 from the DHCP server will be used and take precedence over
595 any statically configured ones.</para>
e88d8021
ZJS
596
597 <para>This corresponds to the <option>nameserver</option>
ad943783
LP
598 option in <citerefentry
599 project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
798d3a52
ZJS
600 </listitem>
601 </varlistentry>
301f4073
MM
602 <varlistentry>
603 <term><varname>UseNTP=</varname></term>
604 <listitem>
605 <para>When true (the default), the NTP servers received
606 from the DHCP server will be used by systemd-timesyncd
607 and take precedence over any statically configured ones.</para>
608 </listitem>
609 </varlistentry>
798d3a52
ZJS
610 <varlistentry>
611 <term><varname>UseMTU=</varname></term>
612 <listitem>
613 <para>When true, the interface maximum transmission unit
614 from the DHCP server will be used on the current link.
615 Defaults to false.</para>
616 </listitem>
617 </varlistentry>
618 <varlistentry>
619 <term><varname>SendHostname=</varname></term>
620 <listitem>
d59be2cf
ZJS
621 <para>When true (the default), the machine's hostname will
622 be sent to the DHCP server.</para>
798d3a52
ZJS
623 </listitem>
624 </varlistentry>
625 <varlistentry>
626 <term><varname>UseHostname=</varname></term>
627 <listitem>
628 <para>When true (the default), the hostname received from
ad943783 629 the DHCP server will be set as the transient hostname of the system
d59be2cf 630 </para>
798d3a52
ZJS
631 </listitem>
632 </varlistentry>
1adc5d0b
SS
633 <varlistentry>
634 <term><varname>Hostname=</varname></term>
635 <listitem>
d59be2cf
ZJS
636 <para>Use this value for the hostname which is sent to the
637 DHCP server, instead of machine's hostname.</para>
1adc5d0b
SS
638 </listitem>
639 </varlistentry>
798d3a52
ZJS
640 <varlistentry>
641 <term><varname>UseDomains=</varname></term>
642 <listitem>
643 <para>When true (not the default), the domain name
644 received from the DHCP server will be used for DNS
e88d8021
ZJS
645 resolution over this link. When a name cannot be resolved
646 as specified, the domain name will be used a suffix and
647 name resolution of that will be attempted.</para>
648
649 <para>This corresponds to the <option>domain</option>
650 option in <citerefentry project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
651 and should not be enabled on untrusted networks.</para>
798d3a52
ZJS
652 </listitem>
653 </varlistentry>
654 <varlistentry>
655 <term><varname>UseRoutes=</varname></term>
656 <listitem>
657 <para>When true (the default), the static routes will be
658 requested from the DHCP server and added to the routing
a8eaaee7 659 table with a metric of 1024.</para>
798d3a52
ZJS
660 </listitem>
661 </varlistentry>
ad943783
LP
662
663 <varlistentry>
664 <term><varname>UseTimezone=</varname></term>
665
666 <listitem><para>When true, the timezone received from the
667 DHCP server will be set as as timezone of the local
668 system. Defaults to <literal>no</literal>.</para></listitem>
669 </varlistentry>
670
798d3a52
ZJS
671 <varlistentry>
672 <term><varname>CriticalConnection=</varname></term>
673 <listitem>
674 <para>When true, the connection will never be torn down
675 even if the DHCP lease expires. This is contrary to the
676 DHCP specification, but may be the best choice if, say,
677 the root filesystem relies on this connection. Defaults to
678 false.</para>
679 </listitem>
680 </varlistentry>
3e43b2cd
JJ
681 <varlistentry>
682 <term><varname>ClientIdentifier=</varname></term>
683 <listitem>
684 <para>DHCP client identifier to use. Either <literal>mac</literal>
685 to use the MAC address of the link or <literal>duid</literal>
4a6970c5 686 (the default) to use a RFC4361-compliant Client ID.</para>
3e43b2cd
JJ
687 </listitem>
688 </varlistentry>
798d3a52
ZJS
689 <varlistentry>
690 <term><varname>VendorClassIdentifier=</varname></term>
691 <listitem>
692 <para>The vendor class identifier used to identify vendor
693 type and configuration.</para>
694 </listitem>
695 </varlistentry>
696 <varlistentry>
697 <term><varname>RequestBroadcast=</varname></term>
698 <listitem>
699 <para>Request the server to use broadcast messages before
700 the IP address has been configured. This is necessary for
701 devices that cannot receive RAW packets, or that cannot
702 receive packets at all before an IP address has been
703 configured. On the other hand, this must not be enabled on
704 networks where broadcasts are filtered out.</para>
705 </listitem>
706 </varlistentry>
707 <varlistentry>
708 <term><varname>RouteMetric=</varname></term>
709 <listitem>
710 <para>Set the routing metric for routes specified by the
711 DHCP server.</para>
712 </listitem>
713 </varlistentry>
ad943783 714 </variablelist>
798d3a52
ZJS
715
716 </refsect1>
717
ad943783
LP
718 <refsect1>
719 <title>[DHCPServer] Section Options</title>
720 <para>The <literal>[DHCPServer]</literal> section contains
721 settings for the DHCP server, if enabled via the
722 <varname>DHCPServer=</varname> option described above:</para>
723
724 <variablelist class='network-directives'>
725
9b3a67c5
TG
726 <varlistentry>
727 <term><varname>PoolOffset=</varname></term>
728 <term><varname>PoolSize=</varname></term>
729
730 <listitem><para>Configures the pool of addresses to hand out. The pool
731 is a contiguous sequence of IP addresses in the subnet configured for
732 the server address, which does not include the subnet nor the broadcast
733 address. <varname>PoolOffset=</varname> takes the offset of the pool
734 from the start of subnet, or zero to use the default value.
735 <varname>PoolSize=</varname> takes the number of IP addresses in the
b938cb90 736 pool or zero to use the default value. By default, the pool starts at
9b3a67c5
TG
737 the first address after the subnet address and takes up the rest of
738 the subnet, excluding the broadcast address. If the pool includes
739 the server address (the default), this is reserved and not handed
740 out to clients.</para></listitem>
741 </varlistentry>
742
ad943783
LP
743 <varlistentry>
744 <term><varname>DefaultLeaseTimeSec=</varname></term>
745 <term><varname>MaxLeaseTimeSec=</varname></term>
746
747 <listitem><para>Control the default and maximum DHCP lease
748 time to pass to clients. These settings take time values in seconds or
749 another common time unit, depending on the suffix. The default
750 lease time is used for clients that did not ask for a specific
751 lease time. If a client asks for a lease time longer than the
b938cb90 752 maximum lease time, it is automatically shortened to the
ad943783
LP
753 specified time. The default lease time defaults to 1h, the
754 maximum lease time to 12h. Shorter lease times are beneficial
755 if the configuration data in DHCP leases changes frequently
756 and clients shall learn the new settings with shorter
757 latencies. Longer lease times reduce the generated DHCP
758 network traffic.</para></listitem>
759 </varlistentry>
760
761 <varlistentry>
762 <term><varname>EmitDNS=</varname></term>
763 <term><varname>DNS=</varname></term>
764
765 <listitem><para>Configures whether the DHCP leases handed out
766 to clients shall contain DNS server information. The
767 <varname>EmitDNS=</varname> setting takes a boolean argument
768 and defaults to <literal>yes</literal>. The DNS servers to
769 pass to clients may be configured with the
770 <varname>DNS=</varname> option, which takes a list of IPv4
771 addresses. If the <varname>EmitDNS=</varname> option is
b938cb90 772 enabled but no servers configured, the servers are
ad943783
LP
773 automatically propagated from an "uplink" interface that has
774 appropriate servers set. The "uplink" interface is determined
775 by the default route of the system with the highest
776 priority. Note that this information is acquired at the time
777 the lease is handed out, and does not take uplink interfaces
778 into account that acquire DNS or NTP server information at a
779 later point. DNS server propagation does not take
780 <filename>/etc/resolv.conf</filename> into account. Also, note
a8eaaee7 781 that the leases are not refreshed if the uplink network
ad943783 782 configuration changes. To ensure clients regularly acquire the
b938cb90 783 most current uplink DNS server information, it is thus
ad943783
LP
784 advisable to shorten the DHCP lease time via
785 <varname>MaxLeaseTimeSec=</varname> described
786 above.</para></listitem>
787 </varlistentry>
788
789 <varlistentry>
790 <term><varname>EmitNTP=</varname></term>
791 <term><varname>NTP=</varname></term>
792
793 <listitem><para>Similar to the <varname>EmitDNS=</varname> and
b938cb90 794 <varname>DNS=</varname> settings described above, these
ad943783
LP
795 settings configure whether and what NTP server information
796 shall be emitted as part of the DHCP lease. The same syntax,
797 propagation semantics and defaults apply as for
798 <varname>EmitDNS=</varname> and
799 <varname>DNS=</varname>.</para></listitem>
800 </varlistentry>
801
802 <varlistentry>
803 <term><varname>EmitTimezone=</varname></term>
804 <term><varname>Timezone=</varname></term>
805
806 <listitem><para>Configures whether the DHCP leases handed out
807 to clients shall contain timezone information. The
808 <varname>EmitTimezone=</varname> setting takes a boolean
809 argument and defaults to <literal>yes</literal>. The
810 <varname>Timezone=</varname> setting takes a timezone string
811 (such as <literal>Europe/Berlin</literal> or
812 <literal>UTC</literal>) to pass to clients. If no explicit
b938cb90 813 timezone is set, the system timezone of the local host is
ad943783
LP
814 propagated, as determined by the
815 <filename>/etc/localtime</filename> symlink.</para></listitem>
816 </varlistentry>
817
818 </variablelist>
819 </refsect1>
820
798d3a52
ZJS
821 <refsect1>
822 <title>[Bridge] Section Options</title>
823 <para>The <literal>[Bridge]</literal> section accepts the
824 following keys.</para>
825 <variablelist class='network-directives'>
165c41a9
SS
826 <varlistentry>
827 <term><varname>UnicastFlood=</varname></term>
828 <listitem>
072f9e4a
ZJS
829 <para>A boolean. Controls whether the bridge should flood
830 traffic for which an FDB entry is missing and the destination
831 is unknown through this port. Defaults to on.
47c7dfe2 832 </para>
165c41a9
SS
833 </listitem>
834 </varlistentry>
835 <varlistentry>
836 <term><varname>HairPin=</varname></term>
837 <listitem>
47c7dfe2
ZJS
838 <para>A boolean. Configures whether traffic may be sent back
839 out of the port on which it was received. By default, this
840 flag is false, and the bridge will not forward traffic back
841 out of the receiving port.</para>
165c41a9
SS
842 </listitem>
843 </varlistentry>
844 <varlistentry>
84c34096 845 <term><varname>UseBPDU=</varname></term>
165c41a9 846 <listitem>
47c7dfe2 847 <para>A boolean. Configures whether STP Bridge Protocol Data Units will be
84c34096 848 processed by the bridge port. Defaults to yes.</para>
165c41a9
SS
849 </listitem>
850 </varlistentry>
851 <varlistentry>
852 <term><varname>FastLeave=</varname></term>
853 <listitem>
47c7dfe2 854 <para>A boolean. This flag allows the bridge to immediately stop multicast
a8eaaee7 855 traffic on a port that receives an IGMP Leave message. It is only used with
47c7dfe2 856 IGMP snooping if enabled on the bridge. Defaults to off.</para>
165c41a9
SS
857 </listitem>
858 </varlistentry>
859 <varlistentry>
23da66bb 860 <term><varname>AllowPortToBeRoot=</varname></term>
165c41a9 861 <listitem>
47c7dfe2
ZJS
862 <para>A boolean. Configures whether a given port is allowed to
863 become a root port. Only used when STP is enabled on the bridge.
23da66bb 864 Defaults to on.</para>
165c41a9
SS
865 </listitem>
866 </varlistentry>
798d3a52
ZJS
867 <varlistentry>
868 <term><varname>Cost=</varname></term>
869 <listitem>
47c7dfe2 870 <para>Sets the "cost" of sending packets of this interface.
a8eaaee7 871 Each port in a bridge may have a different speed and the cost
798d3a52 872 is used to decide which link to use. Faster interfaces
47c7dfe2 873 should have lower costs.</para>
798d3a52
ZJS
874 </listitem>
875 </varlistentry>
876 </variablelist>
877 </refsect1>
798d3a52
ZJS
878 <refsect1>
879 <title>[BridgeFDB] Section Options</title>
880 <para>The <literal>[BridgeFDB]</literal> section manages the
881 forwarding database table of a port and accepts the following
882 keys. Specify several <literal>[BridgeFDB]</literal> sections to
883 configure several static MAC table entries.</para>
884
885 <variablelist class='network-directives'>
886 <varlistentry>
887 <term><varname>MACAddress=</varname></term>
888 <listitem>
889 <para>As in the <literal>[Network]</literal> section. This
890 key is mandatory.</para>
891 </listitem>
892 </varlistentry>
893 <varlistentry>
894 <term><varname>VLANId=</varname></term>
895 <listitem>
a8eaaee7
JE
896 <para>The VLAN ID for the new static MAC table entry. If
897 omitted, no VLAN ID info is appended to the new static MAC
798d3a52
ZJS
898 table entry.</para>
899 </listitem>
900 </varlistentry>
901 </variablelist>
902 </refsect1>
903
904 <refsect1>
905 <title>Example</title>
906 <example>
12b42c76 907 <title>/etc/systemd/network/50-static.network</title>
798d3a52
ZJS
908
909 <programlisting>[Match]
eac684ef
TG
910Name=enp2s0
911
912[Network]
913Address=192.168.0.15/24
914Gateway=192.168.0.1</programlisting>
798d3a52 915 </example>
eac684ef 916
798d3a52 917 <example>
12b42c76 918 <title>/etc/systemd/network/80-dhcp.network</title>
eac684ef 919
798d3a52 920 <programlisting>[Match]
eac684ef
TG
921Name=en*
922
923[Network]
9c8ca3f7 924DHCP=yes</programlisting>
798d3a52 925 </example>
eac684ef 926
798d3a52 927 <example>
6c1695be 928 <title>/etc/systemd/network/25-bridge-static.network</title>
f47c5c47 929
798d3a52 930 <programlisting>[Match]
f47c5c47 931Name=bridge0
932
933[Network]
934Address=192.168.0.15/24
935Gateway=192.168.0.1
936DNS=192.168.0.1</programlisting>
798d3a52 937 </example>
f47c5c47 938
798d3a52 939 <example>
6c1695be 940 <title>/etc/systemd/network/25-bridge-slave-interface.network</title>
f47c5c47 941
798d3a52 942 <programlisting>[Match]
f47c5c47 943Name=enp2s0
944
945[Network]
946Bridge=bridge0</programlisting>
798d3a52
ZJS
947 </example>
948 <example>
6c1695be 949 <title>/etc/systemd/network/25-ipip.network</title>
0a8a0fad 950
798d3a52 951 <programlisting>[Match]
0a8a0fad
TG
952Name=em1
953
954[Network]
955Tunnel=ipip-tun</programlisting>
798d3a52 956 </example>
0a8a0fad 957
798d3a52 958 <example>
6c1695be 959 <title>/etc/systemd/network/25-sit.network</title>
0a8a0fad 960
798d3a52 961 <programlisting>[Match]
0a8a0fad
TG
962Name=em1
963
964[Network]
965Tunnel=sit-tun</programlisting>
798d3a52 966 </example>
0a8a0fad 967
798d3a52 968 <example>
6c1695be 969 <title>/etc/systemd/network/25-gre.network</title>
0a8a0fad 970
798d3a52 971 <programlisting>[Match]
0a8a0fad
TG
972Name=em1
973
974[Network]
975Tunnel=gre-tun</programlisting>
798d3a52 976 </example>
0a8a0fad 977
798d3a52 978 <example>
6c1695be 979 <title>/etc/systemd/network/25-vti.network</title>
0a8a0fad 980
798d3a52 981 <programlisting>[Match]
0a8a0fad
TG
982Name=em1
983
984[Network]
985Tunnel=vti-tun</programlisting>
798d3a52 986 </example>
d94facdc
MH
987
988 <example>
6c1695be 989 <title>/etc/systemd/network/25-bond.network</title>
d94facdc
MH
990
991 <programlisting>[Match]
992Name=bond1
993
994[Network]
995DHCP=yes
996</programlisting>
997 </example>
998
798d3a52
ZJS
999 </refsect1>
1000
1001 <refsect1>
1002 <title>See Also</title>
1003 <para>
1004 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1005 <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
1006 <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1007 <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>
1008 </para>
1009 </refsect1>
eac684ef
TG
1010
1011</refentry>