]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd.network.xml
networkd: dhcp-server - allow configuration of the pool
[thirdparty/systemd.git] / man / systemd.network.xml
1 <?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5 <!--
6 This file is part of systemd.
7
8 Copyright 2013 Tom Gundersen
9
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 -->
23
24 <refentry id="systemd.network" conditional='ENABLE_NETWORKD'>
25
26 <refentryinfo>
27 <title>systemd.network</title>
28 <productname>systemd</productname>
29
30 <authorgroup>
31 <author>
32 <contrib>Developer</contrib>
33 <firstname>Tom</firstname>
34 <surname>Gundersen</surname>
35 <email>teg@jklm.no</email>
36 </author>
37 </authorgroup>
38 </refentryinfo>
39
40 <refmeta>
41 <refentrytitle>systemd.network</refentrytitle>
42 <manvolnum>5</manvolnum>
43 </refmeta>
44
45 <refnamediv>
46 <refname>systemd.network</refname>
47 <refpurpose>Network configuration</refpurpose>
48 </refnamediv>
49
50 <refsynopsisdiv>
51 <para><filename><replaceable>network</replaceable>.network</filename></para>
52 </refsynopsisdiv>
53
54 <refsect1>
55 <title>Description</title>
56
57 <para>Network setup is performed by
58 <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
59 </para>
60
61 <para>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
67 <filename>/usr/lib/systemd/network</filename>, the volatile
68 runtime network directory
69 <filename>/run/systemd/network</filename> and the local
70 administration network directory
71 <filename>/etc/systemd/network</filename>. All configuration files
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
77 name in <filename>/usr/lib</filename>. This can be used to
78 override a system-supplied configuration file with a local file if
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>
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
92 is applied, all later files are ignored, even if they match as
93 well.</para>
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>
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>
112 </listitem>
113 </varlistentry>
114 <varlistentry>
115 <term><varname>Driver=</varname></term>
116 <listitem>
117 <para>A whitespace-separated list of shell-style globs
118 matching the driver currently bound to the device, as
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>
128 <para>A whitespace-separated list of shell-style globs
129 matching the device type, as exposed by the udev property
130 <literal>DEVTYPE</literal>.</para>
131 </listitem>
132 </varlistentry>
133 <varlistentry>
134 <term><varname>Name=</varname></term>
135 <listitem>
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>
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>
226 <para>Enables DHCPv4 and/or DHCPv6 client support. Accepts
227 <literal>yes</literal>, <literal>no</literal>,
228 <literal>ipv4</literal>, or <literal>ipv6</literal>.</para>
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>
233 </listitem>
234 </varlistentry>
235 <varlistentry>
236 <term><varname>DHCPServer=</varname></term>
237 <listitem>
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>
242 </listitem>
243 </varlistentry>
244 <varlistentry>
245 <term><varname>LinkLocalAddressing=</varname></term>
246 <listitem>
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>
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>
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>
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>
286 <varlistentry>
287 <term><varname>BindCarrier=</varname></term>
288 <listitem>
289 <para>A port or a list of ports. When set, controls the
290 behavior of the current interface. When all ports in the list
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>
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
304 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
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
330 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
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
341 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
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
365 family, or <literal>kernel</literal>, which preserves existing sysctl settings.
366 This controls the
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
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
377 globally turned on in the kernel, with the
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
381 options.</para>
382 </listitem>
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
390 <varname>IPForward=ipv4</varname>. Defaults to
391 <literal>no</literal>.</para></listitem>
392 </varlistentry>
393 <varlistentry>
394 <term><varname>IPv6PrivacyExtensions=</varname></term>
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
408 <literal>no</literal>.</para></listitem>
409 </varlistentry>
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
482 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
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>
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>
540 </variablelist>
541 </refsect1>
542
543 <refsect1>
544 <title>[DHCP] Section Options</title>
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>
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>
556
557 <para>This corresponds to the <option>nameserver</option>
558 option in <citerefentry
559 project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
560 </listitem>
561 </varlistentry>
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>
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>
581 <para>When true (the default), the machine's hostname will
582 be sent to the DHCP server.</para>
583 </listitem>
584 </varlistentry>
585 <varlistentry>
586 <term><varname>UseHostname=</varname></term>
587 <listitem>
588 <para>When true (the default), the hostname received from
589 the DHCP server will be set as the transient hostname of the system
590 </para>
591 </listitem>
592 </varlistentry>
593 <varlistentry>
594 <term><varname>Hostname=</varname></term>
595 <listitem>
596 <para>Use this value for the hostname which is sent to the
597 DHCP server, instead of machine's hostname.</para>
598 </listitem>
599 </varlistentry>
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
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>
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>
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
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>
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>
646 (the default) to use a RFC4361-compliant Client ID.</para>
647 </listitem>
648 </varlistentry>
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>
674 </variablelist>
675
676 </refsect1>
677
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>PoolOffset=</varname></term>
688 <term><varname>PoolSize=</varname></term>
689
690 <listitem><para>Configures the pool of addresses to hand out. The pool
691 is a contiguous sequence of IP addresses in the subnet configured for
692 the server address, which does not include the subnet nor the broadcast
693 address. <varname>PoolOffset=</varname> takes the offset of the pool
694 from the start of subnet, or zero to use the default value.
695 <varname>PoolSize=</varname> takes the number of IP addresses in the
696 pool or zero to use the default value. By default the pool starts at
697 the first address after the subnet address and takes up the rest of
698 the subnet, excluding the broadcast address. If the pool includes
699 the server address (the default), this is reserved and not handed
700 out to clients.</para></listitem>
701 </varlistentry>
702
703 <varlistentry>
704 <term><varname>DefaultLeaseTimeSec=</varname></term>
705 <term><varname>MaxLeaseTimeSec=</varname></term>
706
707 <listitem><para>Control the default and maximum DHCP lease
708 time to pass to clients. These settings take time values in seconds or
709 another common time unit, depending on the suffix. The default
710 lease time is used for clients that did not ask for a specific
711 lease time. If a client asks for a lease time longer than the
712 maximum lease time it is automatically shortened to the
713 specified time. The default lease time defaults to 1h, the
714 maximum lease time to 12h. Shorter lease times are beneficial
715 if the configuration data in DHCP leases changes frequently
716 and clients shall learn the new settings with shorter
717 latencies. Longer lease times reduce the generated DHCP
718 network traffic.</para></listitem>
719 </varlistentry>
720
721 <varlistentry>
722 <term><varname>EmitDNS=</varname></term>
723 <term><varname>DNS=</varname></term>
724
725 <listitem><para>Configures whether the DHCP leases handed out
726 to clients shall contain DNS server information. The
727 <varname>EmitDNS=</varname> setting takes a boolean argument
728 and defaults to <literal>yes</literal>. The DNS servers to
729 pass to clients may be configured with the
730 <varname>DNS=</varname> option, which takes a list of IPv4
731 addresses. If the <varname>EmitDNS=</varname> option is
732 enabled but no servers configured the servers are
733 automatically propagated from an "uplink" interface that has
734 appropriate servers set. The "uplink" interface is determined
735 by the default route of the system with the highest
736 priority. Note that this information is acquired at the time
737 the lease is handed out, and does not take uplink interfaces
738 into account that acquire DNS or NTP server information at a
739 later point. DNS server propagation does not take
740 <filename>/etc/resolv.conf</filename> into account. Also, note
741 that the leases are not refreshed if uplink network
742 configuration changes. To ensure clients regularly acquire the
743 most current uplink DNS server information it is thus
744 advisable to shorten the DHCP lease time via
745 <varname>MaxLeaseTimeSec=</varname> described
746 above.</para></listitem>
747 </varlistentry>
748
749 <varlistentry>
750 <term><varname>EmitNTP=</varname></term>
751 <term><varname>NTP=</varname></term>
752
753 <listitem><para>Similar to the <varname>EmitDNS=</varname> and
754 <varname>DNS=</varname> settings described above these
755 settings configure whether and what NTP server information
756 shall be emitted as part of the DHCP lease. The same syntax,
757 propagation semantics and defaults apply as for
758 <varname>EmitDNS=</varname> and
759 <varname>DNS=</varname>.</para></listitem>
760 </varlistentry>
761
762 <varlistentry>
763 <term><varname>EmitTimezone=</varname></term>
764 <term><varname>Timezone=</varname></term>
765
766 <listitem><para>Configures whether the DHCP leases handed out
767 to clients shall contain timezone information. The
768 <varname>EmitTimezone=</varname> setting takes a boolean
769 argument and defaults to <literal>yes</literal>. The
770 <varname>Timezone=</varname> setting takes a timezone string
771 (such as <literal>Europe/Berlin</literal> or
772 <literal>UTC</literal>) to pass to clients. If no explicit
773 timezone is set the system timezone of the local host is
774 propagated, as determined by the
775 <filename>/etc/localtime</filename> symlink.</para></listitem>
776 </varlistentry>
777
778 </variablelist>
779 </refsect1>
780
781 <refsect1>
782 <title>[Bridge] Section Options</title>
783 <para>The <literal>[Bridge]</literal> section accepts the
784 following keys.</para>
785 <variablelist class='network-directives'>
786 <varlistentry>
787 <term><varname>UnicastFlood=</varname></term>
788 <listitem>
789 <para>A boolean. Controls whether the bridge should flood
790 traffic for which an FDB entry is missing and the destination
791 is unknown through this port. Defaults to on.
792 </para>
793 </listitem>
794 </varlistentry>
795 <varlistentry>
796 <term><varname>HairPin=</varname></term>
797 <listitem>
798 <para>A boolean. Configures whether traffic may be sent back
799 out of the port on which it was received. By default, this
800 flag is false, and the bridge will not forward traffic back
801 out of the receiving port.</para>
802 </listitem>
803 </varlistentry>
804 <varlistentry>
805 <term><varname>UseBPDU=</varname></term>
806 <listitem>
807 <para>A boolean. Configures whether STP Bridge Protocol Data Units will be
808 processed by the bridge port. Defaults to yes.</para>
809 </listitem>
810 </varlistentry>
811 <varlistentry>
812 <term><varname>FastLeave=</varname></term>
813 <listitem>
814 <para>A boolean. This flag allows the bridge to immediately stop multicast
815 traffic on a port that receives IGMP Leave message. It is only used with
816 IGMP snooping if enabled on the bridge. Defaults to off.</para>
817 </listitem>
818 </varlistentry>
819 <varlistentry>
820 <term><varname>AllowPortToBeRoot=</varname></term>
821 <listitem>
822 <para>A boolean. Configures whether a given port is allowed to
823 become a root port. Only used when STP is enabled on the bridge.
824 Defaults to on.</para>
825 </listitem>
826 </varlistentry>
827 <varlistentry>
828 <term><varname>Cost=</varname></term>
829 <listitem>
830 <para>Sets the "cost" of sending packets of this interface.
831 Each port in a bridge may have different speed and the cost
832 is used to decide which link to use. Faster interfaces
833 should have lower costs.</para>
834 </listitem>
835 </varlistentry>
836 </variablelist>
837 </refsect1>
838 <refsect1>
839 <title>[BridgeFDB] Section Options</title>
840 <para>The <literal>[BridgeFDB]</literal> section manages the
841 forwarding database table of a port and accepts the following
842 keys. Specify several <literal>[BridgeFDB]</literal> sections to
843 configure several static MAC table entries.</para>
844
845 <variablelist class='network-directives'>
846 <varlistentry>
847 <term><varname>MACAddress=</varname></term>
848 <listitem>
849 <para>As in the <literal>[Network]</literal> section. This
850 key is mandatory.</para>
851 </listitem>
852 </varlistentry>
853 <varlistentry>
854 <term><varname>VLANId=</varname></term>
855 <listitem>
856 <para>The VLAN Id for the new static MAC table entry. If
857 omitted, no VLAN Id info is appended to the new static MAC
858 table entry.</para>
859 </listitem>
860 </varlistentry>
861 </variablelist>
862 </refsect1>
863
864 <refsect1>
865 <title>Example</title>
866 <example>
867 <title>/etc/systemd/network/50-static.network</title>
868
869 <programlisting>[Match]
870 Name=enp2s0
871
872 [Network]
873 Address=192.168.0.15/24
874 Gateway=192.168.0.1</programlisting>
875 </example>
876
877 <example>
878 <title>/etc/systemd/network/80-dhcp.network</title>
879
880 <programlisting>[Match]
881 Name=en*
882
883 [Network]
884 DHCP=yes</programlisting>
885 </example>
886
887 <example>
888 <title>/etc/systemd/network/bridge-static.network</title>
889
890 <programlisting>[Match]
891 Name=bridge0
892
893 [Network]
894 Address=192.168.0.15/24
895 Gateway=192.168.0.1
896 DNS=192.168.0.1</programlisting>
897 </example>
898
899 <example>
900 <title>/etc/systemd/network/bridge-slave-interface.network</title>
901
902 <programlisting>[Match]
903 Name=enp2s0
904
905 [Network]
906 Bridge=bridge0</programlisting>
907 </example>
908 <example>
909 <title>/etc/systemd/network/ipip.network</title>
910
911 <programlisting>[Match]
912 Name=em1
913
914 [Network]
915 Tunnel=ipip-tun</programlisting>
916 </example>
917
918 <example>
919 <title>/etc/systemd/network/sit.network</title>
920
921 <programlisting>[Match]
922 Name=em1
923
924 [Network]
925 Tunnel=sit-tun</programlisting>
926 </example>
927
928 <example>
929 <title>/etc/systemd/network/gre.network</title>
930
931 <programlisting>[Match]
932 Name=em1
933
934 [Network]
935 Tunnel=gre-tun</programlisting>
936 </example>
937
938 <example>
939 <title>/etc/systemd/network/vti.network</title>
940
941 <programlisting>[Match]
942 Name=em1
943
944 [Network]
945 Tunnel=vti-tun</programlisting>
946 </example>
947
948 <example>
949 <title>/etc/systemd/network/bond.network</title>
950
951 <programlisting>[Match]
952 Name=bond1
953
954 [Network]
955 DHCP=yes
956 </programlisting>
957 </example>
958
959 </refsect1>
960
961 <refsect1>
962 <title>See Also</title>
963 <para>
964 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
965 <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
966 <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
967 <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>
968 </para>
969 </refsect1>
970
971 </refentry>