]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd.network.xml
networkd: dhcp-server - default to manage the whole subnet
[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
ZJS
79 needed. As a special case, an empty file (file size 0) or symlink
80 with the same name pointing to <filename>/dev/null</filename>,
81 disable 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
ZJS
229
230 <para>Please note that by default the domain name
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
266 64 bits interface part of SLAAC IPv6 addresses for this link. By default
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
274 Link-Local Multicast Name Resolution on the link, when set to
275 <literal>resolve</literal> only resolution is enabled, but not
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
360 interface. If enabled incoming packets on the network
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
387 interface. If enabled packets forwarded from the network
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
401 <literal>kernel</literal>. When true enables the privacy
402 extensions and prefers temporary addresses over public
403 addresses. When <literal>prefer-public</literal> enables the
404 privacy extensions, but prefers public addresses over
405 temporary addresses. When false, the privacy extensions
406 remain disabled. When <literal>kernel</literal> the kernel's
407 default setting will be left in place. Defaults to
a46e37cb
SS
408 <literal>no</literal>.</para></listitem>
409 </varlistentry>
798d3a52
ZJS
410 <varlistentry>
411 <term><varname>Bridge=</varname></term>
412 <listitem>
413 <para>The name of the bridge to add the link to.</para>
414 </listitem>
415 </varlistentry>
416 <varlistentry>
417 <term><varname>Bond=</varname></term>
418 <listitem>
419 <para>The name of the bond to add the link to.</para>
420 </listitem>
421 </varlistentry>
422 <varlistentry>
423 <term><varname>VLAN=</varname></term>
424 <listitem>
425 <para>The name of a VLAN to create on the link. This
426 option may be specified more than once.</para>
427 </listitem>
428 </varlistentry>
429 <varlistentry>
430 <term><varname>MACVLAN=</varname></term>
431 <listitem>
432 <para>The name of a MACVLAN to create on the link. This
433 option may be specified more than once.</para>
434 </listitem>
435 </varlistentry>
436 <varlistentry>
437 <term><varname>VXLAN=</varname></term>
438 <listitem>
439 <para>The name of a VXLAN to create on the link. This
440 option may be specified more than once.</para>
441 </listitem>
442 </varlistentry>
443 <varlistentry>
444 <term><varname>Tunnel=</varname></term>
445 <listitem>
446 <para>The name of a Tunnel to create on the link. This
447 option may be specified more than once.</para>
448 </listitem>
449 </varlistentry>
450 </variablelist>
451
452 </refsect1>
453
454 <refsect1>
455 <title>[Address] Section Options</title>
456
457 <para>An <literal>[Address]</literal> section accepts the
458 following keys. Specify several <literal>[Address]</literal>
459 sections to configure several addresses.</para>
460
461 <variablelist class='network-directives'>
462 <varlistentry>
463 <term><varname>Address=</varname></term>
464 <listitem>
465 <para>As in the <literal>[Network]</literal> section. This
466 key is mandatory.</para>
467 </listitem>
468 </varlistentry>
469 <varlistentry>
470 <term><varname>Peer=</varname></term>
471 <listitem>
472 <para>The peer address in a point-to-point connection.
473 Accepts the same format as the <literal>Address</literal>
474 key.</para>
475 </listitem>
476 </varlistentry>
477 <varlistentry>
478 <term><varname>Broadcast=</varname></term>
479 <listitem>
480 <para>The broadcast address, which must be in the format
481 described in
3ba3a79d 482 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
798d3a52
ZJS
483 This key only applies to IPv4 addresses. If it is not
484 given, it is derived from the <literal>Address</literal>
485 key.</para>
486 </listitem>
487 </varlistentry>
488 <varlistentry>
489 <term><varname>Label=</varname></term>
490 <listitem>
491 <para>An address label.</para>
492 </listitem>
493 </varlistentry>
494 </variablelist>
495 </refsect1>
496
497 <refsect1>
498 <title>[Route] Section Options</title>
499 <para>The <literal>[Route]</literal> section accepts the
500 following keys. Specify several <literal>[Route]</literal>
501 sections to configure several routes.</para>
502
503 <variablelist class='network-directives'>
504 <varlistentry>
505 <term><varname>Gateway=</varname></term>
506 <listitem>
507 <para>As in the <literal>[Network]</literal> section.</para>
508 </listitem>
509 </varlistentry>
510 <varlistentry>
511 <term><varname>Destination=</varname></term>
512 <listitem>
513 <para>The destination prefix of the route. Possibly
514 followed by a slash and the prefixlength. If omitted, a
515 full-length host route is assumed.</para>
516 </listitem>
517 </varlistentry>
518 <varlistentry>
519 <term><varname>Source=</varname></term>
520 <listitem>
521 <para>The source prefix of the route. Possibly followed by
522 a slash and the prefixlength. If omitted, a full-length
523 host route is assumed.</para>
524 </listitem>
525 </varlistentry>
526 <varlistentry>
527 <term><varname>Metric=</varname></term>
528 <listitem>
529 <para>The metric of the route. An unsigned integer</para>
530 </listitem>
531 </varlistentry>
769b56a3
TG
532 <varlistentry>
533 <term><varname>Scope=</varname></term>
534 <listitem>
535 <para>The scope of the route. One of the values <literal>global</literal>,
536 <literal>link</literal> or <literal>host</literal>. Defaults to
537 <literal>global</literal>.</para>
538 </listitem>
539 </varlistentry>
798d3a52
ZJS
540 </variablelist>
541 </refsect1>
542
543 <refsect1>
544 <title>[DHCP] Section Options</title>
ad943783
LP
545 <para>The <literal>[DHCP]</literal> section configures the
546 DHCPv4 and DHCP6 client, if it is enabled with the
547 <varname>DHCP=</varname> setting described above:</para>
798d3a52
ZJS
548
549 <variablelist class='network-directives'>
550 <varlistentry>
551 <term><varname>UseDNS=</varname></term>
552 <listitem>
553 <para>When true (the default), the DNS servers received
554 from the DHCP server will be used and take precedence over
555 any statically configured ones.</para>
e88d8021
ZJS
556
557 <para>This corresponds to the <option>nameserver</option>
ad943783
LP
558 option in <citerefentry
559 project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
798d3a52
ZJS
560 </listitem>
561 </varlistentry>
301f4073
MM
562 <varlistentry>
563 <term><varname>UseNTP=</varname></term>
564 <listitem>
565 <para>When true (the default), the NTP servers received
566 from the DHCP server will be used by systemd-timesyncd
567 and take precedence over any statically configured ones.</para>
568 </listitem>
569 </varlistentry>
798d3a52
ZJS
570 <varlistentry>
571 <term><varname>UseMTU=</varname></term>
572 <listitem>
573 <para>When true, the interface maximum transmission unit
574 from the DHCP server will be used on the current link.
575 Defaults to false.</para>
576 </listitem>
577 </varlistentry>
578 <varlistentry>
579 <term><varname>SendHostname=</varname></term>
580 <listitem>
d59be2cf
ZJS
581 <para>When true (the default), the machine's hostname will
582 be sent to the DHCP server.</para>
798d3a52
ZJS
583 </listitem>
584 </varlistentry>
585 <varlistentry>
586 <term><varname>UseHostname=</varname></term>
587 <listitem>
588 <para>When true (the default), the hostname received from
ad943783 589 the DHCP server will be set as the transient hostname of the system
d59be2cf 590 </para>
798d3a52
ZJS
591 </listitem>
592 </varlistentry>
1adc5d0b
SS
593 <varlistentry>
594 <term><varname>Hostname=</varname></term>
595 <listitem>
d59be2cf
ZJS
596 <para>Use this value for the hostname which is sent to the
597 DHCP server, instead of machine's hostname.</para>
1adc5d0b
SS
598 </listitem>
599 </varlistentry>
798d3a52
ZJS
600 <varlistentry>
601 <term><varname>UseDomains=</varname></term>
602 <listitem>
603 <para>When true (not the default), the domain name
604 received from the DHCP server will be used for DNS
e88d8021
ZJS
605 resolution over this link. When a name cannot be resolved
606 as specified, the domain name will be used a suffix and
607 name resolution of that will be attempted.</para>
608
609 <para>This corresponds to the <option>domain</option>
610 option in <citerefentry project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
611 and should not be enabled on untrusted networks.</para>
798d3a52
ZJS
612 </listitem>
613 </varlistentry>
614 <varlistentry>
615 <term><varname>UseRoutes=</varname></term>
616 <listitem>
617 <para>When true (the default), the static routes will be
618 requested from the DHCP server and added to the routing
619 table with metric of 1024.</para>
620 </listitem>
621 </varlistentry>
ad943783
LP
622
623 <varlistentry>
624 <term><varname>UseTimezone=</varname></term>
625
626 <listitem><para>When true, the timezone received from the
627 DHCP server will be set as as timezone of the local
628 system. Defaults to <literal>no</literal>.</para></listitem>
629 </varlistentry>
630
798d3a52
ZJS
631 <varlistentry>
632 <term><varname>CriticalConnection=</varname></term>
633 <listitem>
634 <para>When true, the connection will never be torn down
635 even if the DHCP lease expires. This is contrary to the
636 DHCP specification, but may be the best choice if, say,
637 the root filesystem relies on this connection. Defaults to
638 false.</para>
639 </listitem>
640 </varlistentry>
3e43b2cd
JJ
641 <varlistentry>
642 <term><varname>ClientIdentifier=</varname></term>
643 <listitem>
644 <para>DHCP client identifier to use. Either <literal>mac</literal>
645 to use the MAC address of the link or <literal>duid</literal>
4a6970c5 646 (the default) to use a RFC4361-compliant Client ID.</para>
3e43b2cd
JJ
647 </listitem>
648 </varlistentry>
798d3a52
ZJS
649 <varlistentry>
650 <term><varname>VendorClassIdentifier=</varname></term>
651 <listitem>
652 <para>The vendor class identifier used to identify vendor
653 type and configuration.</para>
654 </listitem>
655 </varlistentry>
656 <varlistentry>
657 <term><varname>RequestBroadcast=</varname></term>
658 <listitem>
659 <para>Request the server to use broadcast messages before
660 the IP address has been configured. This is necessary for
661 devices that cannot receive RAW packets, or that cannot
662 receive packets at all before an IP address has been
663 configured. On the other hand, this must not be enabled on
664 networks where broadcasts are filtered out.</para>
665 </listitem>
666 </varlistentry>
667 <varlistentry>
668 <term><varname>RouteMetric=</varname></term>
669 <listitem>
670 <para>Set the routing metric for routes specified by the
671 DHCP server.</para>
672 </listitem>
673 </varlistentry>
ad943783 674 </variablelist>
798d3a52
ZJS
675
676 </refsect1>
677
ad943783
LP
678 <refsect1>
679 <title>[DHCPServer] Section Options</title>
680 <para>The <literal>[DHCPServer]</literal> section contains
681 settings for the DHCP server, if enabled via the
682 <varname>DHCPServer=</varname> option described above:</para>
683
684 <variablelist class='network-directives'>
685
686 <varlistentry>
687 <term><varname>DefaultLeaseTimeSec=</varname></term>
688 <term><varname>MaxLeaseTimeSec=</varname></term>
689
690 <listitem><para>Control the default and maximum DHCP lease
691 time to pass to clients. These settings take time values in seconds or
692 another common time unit, depending on the suffix. The default
693 lease time is used for clients that did not ask for a specific
694 lease time. If a client asks for a lease time longer than the
695 maximum lease time it is automatically shortened to the
696 specified time. The default lease time defaults to 1h, the
697 maximum lease time to 12h. Shorter lease times are beneficial
698 if the configuration data in DHCP leases changes frequently
699 and clients shall learn the new settings with shorter
700 latencies. Longer lease times reduce the generated DHCP
701 network traffic.</para></listitem>
702 </varlistentry>
703
704 <varlistentry>
705 <term><varname>EmitDNS=</varname></term>
706 <term><varname>DNS=</varname></term>
707
708 <listitem><para>Configures whether the DHCP leases handed out
709 to clients shall contain DNS server information. The
710 <varname>EmitDNS=</varname> setting takes a boolean argument
711 and defaults to <literal>yes</literal>. The DNS servers to
712 pass to clients may be configured with the
713 <varname>DNS=</varname> option, which takes a list of IPv4
714 addresses. If the <varname>EmitDNS=</varname> option is
715 enabled but no servers configured the servers are
716 automatically propagated from an "uplink" interface that has
717 appropriate servers set. The "uplink" interface is determined
718 by the default route of the system with the highest
719 priority. Note that this information is acquired at the time
720 the lease is handed out, and does not take uplink interfaces
721 into account that acquire DNS or NTP server information at a
722 later point. DNS server propagation does not take
723 <filename>/etc/resolv.conf</filename> into account. Also, note
724 that the leases are not refreshed if uplink network
725 configuration changes. To ensure clients regularly acquire the
726 most current uplink DNS server information it is thus
727 advisable to shorten the DHCP lease time via
728 <varname>MaxLeaseTimeSec=</varname> described
729 above.</para></listitem>
730 </varlistentry>
731
732 <varlistentry>
733 <term><varname>EmitNTP=</varname></term>
734 <term><varname>NTP=</varname></term>
735
736 <listitem><para>Similar to the <varname>EmitDNS=</varname> and
737 <varname>DNS=</varname> settings described above these
738 settings configure whether and what NTP server information
739 shall be emitted as part of the DHCP lease. The same syntax,
740 propagation semantics and defaults apply as for
741 <varname>EmitDNS=</varname> and
742 <varname>DNS=</varname>.</para></listitem>
743 </varlistentry>
744
745 <varlistentry>
746 <term><varname>EmitTimezone=</varname></term>
747 <term><varname>Timezone=</varname></term>
748
749 <listitem><para>Configures whether the DHCP leases handed out
750 to clients shall contain timezone information. The
751 <varname>EmitTimezone=</varname> setting takes a boolean
752 argument and defaults to <literal>yes</literal>. The
753 <varname>Timezone=</varname> setting takes a timezone string
754 (such as <literal>Europe/Berlin</literal> or
755 <literal>UTC</literal>) to pass to clients. If no explicit
756 timezone is set the system timezone of the local host is
757 propagated, as determined by the
758 <filename>/etc/localtime</filename> symlink.</para></listitem>
759 </varlistentry>
760
761 </variablelist>
762 </refsect1>
763
798d3a52
ZJS
764 <refsect1>
765 <title>[Bridge] Section Options</title>
766 <para>The <literal>[Bridge]</literal> section accepts the
767 following keys.</para>
768 <variablelist class='network-directives'>
165c41a9
SS
769 <varlistentry>
770 <term><varname>UnicastFlood=</varname></term>
771 <listitem>
072f9e4a
ZJS
772 <para>A boolean. Controls whether the bridge should flood
773 traffic for which an FDB entry is missing and the destination
774 is unknown through this port. Defaults to on.
47c7dfe2 775 </para>
165c41a9
SS
776 </listitem>
777 </varlistentry>
778 <varlistentry>
779 <term><varname>HairPin=</varname></term>
780 <listitem>
47c7dfe2
ZJS
781 <para>A boolean. Configures whether traffic may be sent back
782 out of the port on which it was received. By default, this
783 flag is false, and the bridge will not forward traffic back
784 out of the receiving port.</para>
165c41a9
SS
785 </listitem>
786 </varlistentry>
787 <varlistentry>
84c34096 788 <term><varname>UseBPDU=</varname></term>
165c41a9 789 <listitem>
47c7dfe2 790 <para>A boolean. Configures whether STP Bridge Protocol Data Units will be
84c34096 791 processed by the bridge port. Defaults to yes.</para>
165c41a9
SS
792 </listitem>
793 </varlistentry>
794 <varlistentry>
795 <term><varname>FastLeave=</varname></term>
796 <listitem>
47c7dfe2 797 <para>A boolean. This flag allows the bridge to immediately stop multicast
165c41a9 798 traffic on a port that receives IGMP Leave message. It is only used with
47c7dfe2 799 IGMP snooping if enabled on the bridge. Defaults to off.</para>
165c41a9
SS
800 </listitem>
801 </varlistentry>
802 <varlistentry>
23da66bb 803 <term><varname>AllowPortToBeRoot=</varname></term>
165c41a9 804 <listitem>
47c7dfe2
ZJS
805 <para>A boolean. Configures whether a given port is allowed to
806 become a root port. Only used when STP is enabled on the bridge.
23da66bb 807 Defaults to on.</para>
165c41a9
SS
808 </listitem>
809 </varlistentry>
798d3a52
ZJS
810 <varlistentry>
811 <term><varname>Cost=</varname></term>
812 <listitem>
47c7dfe2
ZJS
813 <para>Sets the "cost" of sending packets of this interface.
814 Each port in a bridge may have different speed and the cost
798d3a52 815 is used to decide which link to use. Faster interfaces
47c7dfe2 816 should have lower costs.</para>
798d3a52
ZJS
817 </listitem>
818 </varlistentry>
819 </variablelist>
820 </refsect1>
798d3a52
ZJS
821 <refsect1>
822 <title>[BridgeFDB] Section Options</title>
823 <para>The <literal>[BridgeFDB]</literal> section manages the
824 forwarding database table of a port and accepts the following
825 keys. Specify several <literal>[BridgeFDB]</literal> sections to
826 configure several static MAC table entries.</para>
827
828 <variablelist class='network-directives'>
829 <varlistentry>
830 <term><varname>MACAddress=</varname></term>
831 <listitem>
832 <para>As in the <literal>[Network]</literal> section. This
833 key is mandatory.</para>
834 </listitem>
835 </varlistentry>
836 <varlistentry>
837 <term><varname>VLANId=</varname></term>
838 <listitem>
839 <para>The VLAN Id for the new static MAC table entry. If
840 omitted, no VLAN Id info is appended to the new static MAC
841 table entry.</para>
842 </listitem>
843 </varlistentry>
844 </variablelist>
845 </refsect1>
846
847 <refsect1>
848 <title>Example</title>
849 <example>
12b42c76 850 <title>/etc/systemd/network/50-static.network</title>
798d3a52
ZJS
851
852 <programlisting>[Match]
eac684ef
TG
853Name=enp2s0
854
855[Network]
856Address=192.168.0.15/24
857Gateway=192.168.0.1</programlisting>
798d3a52 858 </example>
eac684ef 859
798d3a52 860 <example>
12b42c76 861 <title>/etc/systemd/network/80-dhcp.network</title>
eac684ef 862
798d3a52 863 <programlisting>[Match]
eac684ef
TG
864Name=en*
865
866[Network]
9c8ca3f7 867DHCP=yes</programlisting>
798d3a52 868 </example>
eac684ef 869
798d3a52 870 <example>
12b42c76 871 <title>/etc/systemd/network/bridge-static.network</title>
f47c5c47 872
798d3a52 873 <programlisting>[Match]
f47c5c47 874Name=bridge0
875
876[Network]
877Address=192.168.0.15/24
878Gateway=192.168.0.1
879DNS=192.168.0.1</programlisting>
798d3a52 880 </example>
f47c5c47 881
798d3a52 882 <example>
12b42c76 883 <title>/etc/systemd/network/bridge-slave-interface.network</title>
f47c5c47 884
798d3a52 885 <programlisting>[Match]
f47c5c47 886Name=enp2s0
887
888[Network]
889Bridge=bridge0</programlisting>
798d3a52
ZJS
890 </example>
891 <example>
12b42c76 892 <title>/etc/systemd/network/ipip.network</title>
0a8a0fad 893
798d3a52 894 <programlisting>[Match]
0a8a0fad
TG
895Name=em1
896
897[Network]
898Tunnel=ipip-tun</programlisting>
798d3a52 899 </example>
0a8a0fad 900
798d3a52 901 <example>
12b42c76 902 <title>/etc/systemd/network/sit.network</title>
0a8a0fad 903
798d3a52 904 <programlisting>[Match]
0a8a0fad
TG
905Name=em1
906
907[Network]
908Tunnel=sit-tun</programlisting>
798d3a52 909 </example>
0a8a0fad 910
798d3a52 911 <example>
12b42c76 912 <title>/etc/systemd/network/gre.network</title>
0a8a0fad 913
798d3a52 914 <programlisting>[Match]
0a8a0fad
TG
915Name=em1
916
917[Network]
918Tunnel=gre-tun</programlisting>
798d3a52 919 </example>
0a8a0fad 920
798d3a52 921 <example>
12b42c76 922 <title>/etc/systemd/network/vti.network</title>
0a8a0fad 923
798d3a52 924 <programlisting>[Match]
0a8a0fad
TG
925Name=em1
926
927[Network]
928Tunnel=vti-tun</programlisting>
798d3a52 929 </example>
d94facdc
MH
930
931 <example>
932 <title>/etc/systemd/network/bond.network</title>
933
934 <programlisting>[Match]
935Name=bond1
936
937[Network]
938DHCP=yes
939</programlisting>
940 </example>
941
798d3a52
ZJS
942 </refsect1>
943
944 <refsect1>
945 <title>See Also</title>
946 <para>
947 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
948 <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
949 <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
950 <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>
951 </para>
952 </refsect1>
eac684ef
TG
953
954</refentry>