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