]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd.network.xml
test-execute: Add tests for new PassEnvironment= directive
[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>Note that DHCPv6 will by default be triggered by Router
231 Advertisment, if that is enabled, regardless of this parameter.
232 By enabling DHCPv6 support explicitly, the DHCPv6 client will
233 be started regardless of the presence of routers on the link,
234 or what flags the routers pass. See
235 <literal>IPv6AcceptRouterAdvertisements=</literal>.</para>
236
237 <para>Furthermore, note that by default the domain name
238 specified through DHCP is not used for name resolution.
239 See option <option>UseDomains=</option> below.</para>
240 </listitem>
241 </varlistentry>
242 <varlistentry>
243 <term><varname>DHCPServer=</varname></term>
244 <listitem>
245 <para>A boolean. Enables DHCPv4 server support. Defaults
246 to <literal>no</literal>. Further settings for the DHCP
247 server may be set in the <literal>[DHCPServer]</literal>
248 section described below.</para>
249 </listitem>
250 </varlistentry>
251 <varlistentry>
252 <term><varname>LinkLocalAddressing=</varname></term>
253 <listitem>
254 <para>Enables link-local address autoconfiguration. Accepts
255 <literal>yes</literal>, <literal>no</literal>,
256 <literal>ipv4</literal>, or <literal>ipv6</literal>. Defaults to
257 <literal>ipv6</literal>.</para>
258 </listitem>
259 </varlistentry>
260 <varlistentry>
261 <term><varname>IPv4LLRoute=</varname></term>
262 <listitem>
263 <para>A boolean. When true, sets up the route needed for
264 non-IPv4LL hosts to communicate with IPv4LL-only hosts. Defaults
265 to false.
266 </para>
267 </listitem>
268 </varlistentry>
269 <varlistentry>
270 <term><varname>IPv6Token=</varname></term>
271 <listitem>
272 <para>An IPv6 address with the top 64 bits unset. When set, indicates the
273 64-bit interface part of SLAAC IPv6 addresses for this link. By default,
274 it is autogenerated.</para>
275 </listitem>
276 </varlistentry>
277 <varlistentry>
278 <term><varname>LLMNR=</varname></term>
279 <listitem>
280 <para>A boolean or <literal>resolve</literal>. When true, enables
281 Link-Local Multicast Name Resolution on the link. When set to
282 <literal>resolve</literal>, only resolution is enabled, but not
283 announcement. Defaults to true.</para>
284 </listitem>
285 </varlistentry>
286 <varlistentry>
287 <term><varname>LLDP=</varname></term>
288 <listitem>
289 <para>A boolean. When true, enables LLDP link receive support.
290 </para>
291 </listitem>
292 </varlistentry>
293 <varlistentry>
294 <term><varname>BindCarrier=</varname></term>
295 <listitem>
296 <para>A port or a list of ports. When set, controls the
297 behavior of the current interface. When all ports in the list
298 are in an operational down state, the current interface is brought
299 down. When at least one port has carrier, the current interface
300 is brought up.
301 </para>
302 </listitem>
303 </varlistentry>
304 <varlistentry>
305 <term><varname>Address=</varname></term>
306 <listitem>
307 <para>A static IPv4 or IPv6 address and its prefix length,
308 separated by a <literal>/</literal> character. Specify
309 this key more than once to configure several addresses.
310 The format of the address must be as described in
311 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
312 This is a short-hand for an [Address] section only
313 containing an Address key (see below). This option may be
314 specified more than once.
315 </para>
316
317 <para>If the specified address is 0.0.0.0 (for IPv4) or
318 [::] (for IPv6), a new address range of the requested size
319 is automatically allocated from a system-wide pool of
320 unused ranges. The allocated range is checked against all
321 current network interfaces and all known network
322 configuration files to avoid address range conflicts. The
323 default system-wide pool consists of 192.168.0.0/16,
324 172.16.0.0/12 and 10.0.0.0/8 for IPv4, and fc00::/7 for
325 IPv6. This functionality is useful to manage a large
326 number of dynamically created network interfaces with the
327 same network configuration and automatic address range
328 assignment.</para>
329
330 </listitem>
331 </varlistentry>
332 <varlistentry>
333 <term><varname>Gateway=</varname></term>
334 <listitem>
335 <para>The gateway address, which must be in the format
336 described in
337 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
338 This is a short-hand for a [Route] section only containing
339 a Gateway key. This option may be specified more than
340 once.</para>
341 </listitem>
342 </varlistentry>
343 <varlistentry>
344 <term><varname>DNS=</varname></term>
345 <listitem>
346 <para>A DNS server address, which must be in the format
347 described in
348 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
349 This option may be specified more than once.</para>
350 </listitem>
351 </varlistentry>
352 <varlistentry>
353 <term><varname>Domains=</varname></term>
354 <listitem>
355 <para>The domains used for DNS resolution over this link.</para>
356 </listitem>
357 </varlistentry>
358 <varlistentry>
359 <term><varname>NTP=</varname></term>
360 <listitem>
361 <para>An NTP server address. This option may be specified more than once.</para>
362 </listitem>
363 </varlistentry>
364 <varlistentry>
365 <term><varname>IPForward=</varname></term>
366 <listitem><para>Configures IP forwarding for the network
367 interface. If enabled, incoming packets on the network
368 interface will be forwarded to other interfaces according to
369 the routing table. Takes either a boolean argument, or the
370 values <literal>ipv4</literal> or <literal>ipv6</literal>,
371 which only enables IP forwarding for the specified address
372 family, or <literal>kernel</literal>, which preserves existing sysctl settings.
373 This controls the
374 <filename>net.ipv4.conf.&lt;interface&gt;.forwarding</filename>
375 and
376 <filename>net.ipv6.conf.&lt;interface&gt;.forwarding</filename>
377 sysctl options of the network interface (see <ulink
378 url="https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt">ip-sysctl.txt</ulink>
379 for details about sysctl options). Defaults to
380 <literal>no</literal>.</para>
381
382 <para>Note: unless this option is turned on, or set to <literal>kernel</literal>,
383 no IP forwarding is done on this interface, even if this is
384 globally turned on in the kernel, with the
385 <filename>net.ipv4.ip_forward</filename>,
386 <filename>net.ipv4.conf.all.forwarding</filename>, and
387 <filename>net.ipv6.conf.all.forwarding</filename> sysctl
388 options.</para>
389 </listitem>
390 </varlistentry>
391 <varlistentry>
392 <term><varname>IPMasquerade=</varname></term>
393 <listitem><para>Configures IP masquerading for the network
394 interface. If enabled, packets forwarded from the network
395 interface will be appear as coming from the local host.
396 Takes a boolean argument. Implies
397 <varname>IPForward=ipv4</varname>. Defaults to
398 <literal>no</literal>.</para></listitem>
399 </varlistentry>
400 <varlistentry>
401 <term><varname>IPv6PrivacyExtensions=</varname></term>
402 <listitem><para>Configures use of stateless temporary
403 addresses that change over time (see <ulink
404 url="https://tools.ietf.org/html/rfc4941">RFC 4941</ulink>,
405 Privacy Extensions for Stateless Address Autoconfiguration
406 in IPv6). Takes a boolean or the special values
407 <literal>prefer-public</literal> and
408 <literal>kernel</literal>. When true, enables the privacy
409 extensions and prefers temporary addresses over public
410 addresses. When <literal>prefer-public</literal>, enables the
411 privacy extensions, but prefers public addresses over
412 temporary addresses. When false, the privacy extensions
413 remain disabled. When <literal>kernel</literal>, the kernel's
414 default setting will be left in place. Defaults to
415 <literal>no</literal>.</para></listitem>
416 </varlistentry>
417 <varlistentry>
418 <term><varname>IPv6AcceptRouterAdvertisements=</varname></term>
419 <listitem><para>Force the setting of the <filename>accept_ra</filename>
420 (router advertisements) setting for the interface.
421 When unset, the kernel default is used, and router
422 advertisements are accepted only when local forwarding
423 is disabled for that interface.
424 When router advertisements are accepted, they will
425 trigger the start of the DHCPv6 client if the relevant
426 flags are passed, or if no routers are found on the link.
427 Takes a boolean. If true, router advertisements are
428 accepted, when false, router advertisements are ignored,
429 independently of the local forwarding state.</para>
430
431 <para>See
432 <ulink url="https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt">ip-sysctl.txt</ulink>
433 in the kernel documentation, but note that systemd's
434 setting of <constant>1</constant> corresponds to
435 kernel's setting of <constant>2</constant>.</para>
436 </listitem>
437 </varlistentry>
438 <varlistentry>
439 <term><varname>IPv6DuplicateAddressDetection=</varname></term>
440 <listitem><para>Configures the amount of IPv6 Duplicate
441 Address Detection (DAD) probes to send. Defaults to unset.
442 </para></listitem>
443 </varlistentry>
444 <varlistentry>
445 <term><varname>IPv6HopLimit=</varname></term>
446 <listitem><para>Configures IPv6 Hop Limit. For each router that
447 forwards the packet, the hop limit is decremented by 1. When the
448 hop limit field reaches zero, the packet is discarded.
449 Defaults to unset.
450 </para></listitem>
451 </varlistentry>
452 <varlistentry>
453 <term><varname>Bridge=</varname></term>
454 <listitem>
455 <para>The name of the bridge to add the link to.</para>
456 </listitem>
457 </varlistentry>
458 <varlistentry>
459 <term><varname>Bond=</varname></term>
460 <listitem>
461 <para>The name of the bond to add the link to.</para>
462 </listitem>
463 </varlistentry>
464 <varlistentry>
465 <term><varname>VLAN=</varname></term>
466 <listitem>
467 <para>The name of a VLAN to create on the link. This
468 option may be specified more than once.</para>
469 </listitem>
470 </varlistentry>
471 <varlistentry>
472 <term><varname>MACVLAN=</varname></term>
473 <listitem>
474 <para>The name of a MACVLAN to create on the link. This
475 option may be specified more than once.</para>
476 </listitem>
477 </varlistentry>
478 <varlistentry>
479 <term><varname>VXLAN=</varname></term>
480 <listitem>
481 <para>The name of a VXLAN to create on the link. This
482 option may be specified more than once.</para>
483 </listitem>
484 </varlistentry>
485 <varlistentry>
486 <term><varname>Tunnel=</varname></term>
487 <listitem>
488 <para>The name of a Tunnel to create on the link. This
489 option may be specified more than once.</para>
490 </listitem>
491 </varlistentry>
492 </variablelist>
493
494 </refsect1>
495
496 <refsect1>
497 <title>[Address] Section Options</title>
498
499 <para>An <literal>[Address]</literal> section accepts the
500 following keys. Specify several <literal>[Address]</literal>
501 sections to configure several addresses.</para>
502
503 <variablelist class='network-directives'>
504 <varlistentry>
505 <term><varname>Address=</varname></term>
506 <listitem>
507 <para>As in the <literal>[Network]</literal> section. This
508 key is mandatory.</para>
509 </listitem>
510 </varlistentry>
511 <varlistentry>
512 <term><varname>Peer=</varname></term>
513 <listitem>
514 <para>The peer address in a point-to-point connection.
515 Accepts the same format as the <literal>Address</literal>
516 key.</para>
517 </listitem>
518 </varlistentry>
519 <varlistentry>
520 <term><varname>Broadcast=</varname></term>
521 <listitem>
522 <para>The broadcast address, which must be in the format
523 described in
524 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
525 This key only applies to IPv4 addresses. If it is not
526 given, it is derived from the <literal>Address</literal>
527 key.</para>
528 </listitem>
529 </varlistentry>
530 <varlistentry>
531 <term><varname>Label=</varname></term>
532 <listitem>
533 <para>An address label.</para>
534 </listitem>
535 </varlistentry>
536 </variablelist>
537 </refsect1>
538
539 <refsect1>
540 <title>[Route] Section Options</title>
541 <para>The <literal>[Route]</literal> section accepts the
542 following keys. Specify several <literal>[Route]</literal>
543 sections to configure several routes.</para>
544
545 <variablelist class='network-directives'>
546 <varlistentry>
547 <term><varname>Gateway=</varname></term>
548 <listitem>
549 <para>As in the <literal>[Network]</literal> section.</para>
550 </listitem>
551 </varlistentry>
552 <varlistentry>
553 <term><varname>Destination=</varname></term>
554 <listitem>
555 <para>The destination prefix of the route. Possibly
556 followed by a slash and the prefix length. If omitted, a
557 full-length host route is assumed.</para>
558 </listitem>
559 </varlistentry>
560 <varlistentry>
561 <term><varname>Source=</varname></term>
562 <listitem>
563 <para>The source prefix of the route. Possibly followed by
564 a slash and the prefix length. If omitted, a full-length
565 host route is assumed.</para>
566 </listitem>
567 </varlistentry>
568 <varlistentry>
569 <term><varname>Metric=</varname></term>
570 <listitem>
571 <para>The metric of the route (an unsigned integer).</para>
572 </listitem>
573 </varlistentry>
574 <varlistentry>
575 <term><varname>Scope=</varname></term>
576 <listitem>
577 <para>The scope of the route, which can be <literal>global</literal>,
578 <literal>link</literal> or <literal>host</literal>. Defaults to
579 <literal>global</literal>.</para>
580 </listitem>
581 </varlistentry>
582 <varlistentry>
583 <term><varname>PreferredSource=</varname></term>
584 <listitem>
585 <para>The preferred source address of the route. The address
586 must be in the format described in
587 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
588 </listitem>
589 </varlistentry>
590 </variablelist>
591 </refsect1>
592
593 <refsect1>
594 <title>[DHCP] Section Options</title>
595 <para>The <literal>[DHCP]</literal> section configures the
596 DHCPv4 and DHCP6 client, if it is enabled with the
597 <varname>DHCP=</varname> setting described above:</para>
598
599 <variablelist class='network-directives'>
600 <varlistentry>
601 <term><varname>UseDNS=</varname></term>
602 <listitem>
603 <para>When true (the default), the DNS servers received
604 from the DHCP server will be used and take precedence over
605 any statically configured ones.</para>
606
607 <para>This corresponds to the <option>nameserver</option>
608 option in <citerefentry
609 project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
610 </listitem>
611 </varlistentry>
612 <varlistentry>
613 <term><varname>UseNTP=</varname></term>
614 <listitem>
615 <para>When true (the default), the NTP servers received
616 from the DHCP server will be used by systemd-timesyncd
617 and take precedence over any statically configured ones.</para>
618 </listitem>
619 </varlistentry>
620 <varlistentry>
621 <term><varname>UseMTU=</varname></term>
622 <listitem>
623 <para>When true, the interface maximum transmission unit
624 from the DHCP server will be used on the current link.
625 Defaults to false.</para>
626 </listitem>
627 </varlistentry>
628 <varlistentry>
629 <term><varname>SendHostname=</varname></term>
630 <listitem>
631 <para>When true (the default), the machine's hostname will
632 be sent to the DHCP server.</para>
633 </listitem>
634 </varlistentry>
635 <varlistentry>
636 <term><varname>UseHostname=</varname></term>
637 <listitem>
638 <para>When true (the default), the hostname received from
639 the DHCP server will be set as the transient hostname of the system
640 </para>
641 </listitem>
642 </varlistentry>
643 <varlistentry>
644 <term><varname>Hostname=</varname></term>
645 <listitem>
646 <para>Use this value for the hostname which is sent to the
647 DHCP server, instead of machine's hostname.</para>
648 </listitem>
649 </varlistentry>
650 <varlistentry>
651 <term><varname>UseDomains=</varname></term>
652 <listitem>
653 <para>When true (not the default), the domain name
654 received from the DHCP server will be used for DNS
655 resolution over this link. When a name cannot be resolved
656 as specified, the domain name will be used a suffix and
657 name resolution of that will be attempted.</para>
658
659 <para>This corresponds to the <option>domain</option>
660 option in <citerefentry project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
661 and should not be enabled on untrusted networks.</para>
662 </listitem>
663 </varlistentry>
664 <varlistentry>
665 <term><varname>UseRoutes=</varname></term>
666 <listitem>
667 <para>When true (the default), the static routes will be
668 requested from the DHCP server and added to the routing
669 table with a metric of 1024.</para>
670 </listitem>
671 </varlistentry>
672
673 <varlistentry>
674 <term><varname>UseTimezone=</varname></term>
675
676 <listitem><para>When true, the timezone received from the
677 DHCP server will be set as as timezone of the local
678 system. Defaults to <literal>no</literal>.</para></listitem>
679 </varlistentry>
680
681 <varlistentry>
682 <term><varname>CriticalConnection=</varname></term>
683 <listitem>
684 <para>When true, the connection will never be torn down
685 even if the DHCP lease expires. This is contrary to the
686 DHCP specification, but may be the best choice if, say,
687 the root filesystem relies on this connection. Defaults to
688 false.</para>
689 </listitem>
690 </varlistentry>
691 <varlistentry>
692 <term><varname>ClientIdentifier=</varname></term>
693 <listitem>
694 <para>DHCP client identifier to use. Either <literal>mac</literal>
695 to use the MAC address of the link or <literal>duid</literal>
696 (the default) to use a RFC4361-compliant Client ID.</para>
697 </listitem>
698 </varlistentry>
699 <varlistentry>
700 <term><varname>VendorClassIdentifier=</varname></term>
701 <listitem>
702 <para>The vendor class identifier used to identify vendor
703 type and configuration.</para>
704 </listitem>
705 </varlistentry>
706 <varlistentry>
707 <term><varname>RequestBroadcast=</varname></term>
708 <listitem>
709 <para>Request the server to use broadcast messages before
710 the IP address has been configured. This is necessary for
711 devices that cannot receive RAW packets, or that cannot
712 receive packets at all before an IP address has been
713 configured. On the other hand, this must not be enabled on
714 networks where broadcasts are filtered out.</para>
715 </listitem>
716 </varlistentry>
717 <varlistentry>
718 <term><varname>RouteMetric=</varname></term>
719 <listitem>
720 <para>Set the routing metric for routes specified by the
721 DHCP server.</para>
722 </listitem>
723 </varlistentry>
724 </variablelist>
725
726 </refsect1>
727
728 <refsect1>
729 <title>[DHCPServer] Section Options</title>
730 <para>The <literal>[DHCPServer]</literal> section contains
731 settings for the DHCP server, if enabled via the
732 <varname>DHCPServer=</varname> option described above:</para>
733
734 <variablelist class='network-directives'>
735
736 <varlistentry>
737 <term><varname>PoolOffset=</varname></term>
738 <term><varname>PoolSize=</varname></term>
739
740 <listitem><para>Configures the pool of addresses to hand out. The pool
741 is a contiguous sequence of IP addresses in the subnet configured for
742 the server address, which does not include the subnet nor the broadcast
743 address. <varname>PoolOffset=</varname> takes the offset of the pool
744 from the start of subnet, or zero to use the default value.
745 <varname>PoolSize=</varname> takes the number of IP addresses in the
746 pool or zero to use the default value. By default, the pool starts at
747 the first address after the subnet address and takes up the rest of
748 the subnet, excluding the broadcast address. If the pool includes
749 the server address (the default), this is reserved and not handed
750 out to clients.</para></listitem>
751 </varlistentry>
752
753 <varlistentry>
754 <term><varname>DefaultLeaseTimeSec=</varname></term>
755 <term><varname>MaxLeaseTimeSec=</varname></term>
756
757 <listitem><para>Control the default and maximum DHCP lease
758 time to pass to clients. These settings take time values in seconds or
759 another common time unit, depending on the suffix. The default
760 lease time is used for clients that did not ask for a specific
761 lease time. If a client asks for a lease time longer than the
762 maximum lease time, it is automatically shortened to the
763 specified time. The default lease time defaults to 1h, the
764 maximum lease time to 12h. Shorter lease times are beneficial
765 if the configuration data in DHCP leases changes frequently
766 and clients shall learn the new settings with shorter
767 latencies. Longer lease times reduce the generated DHCP
768 network traffic.</para></listitem>
769 </varlistentry>
770
771 <varlistentry>
772 <term><varname>EmitDNS=</varname></term>
773 <term><varname>DNS=</varname></term>
774
775 <listitem><para>Configures whether the DHCP leases handed out
776 to clients shall contain DNS server information. The
777 <varname>EmitDNS=</varname> setting takes a boolean argument
778 and defaults to <literal>yes</literal>. The DNS servers to
779 pass to clients may be configured with the
780 <varname>DNS=</varname> option, which takes a list of IPv4
781 addresses. If the <varname>EmitDNS=</varname> option is
782 enabled but no servers configured, the servers are
783 automatically propagated from an "uplink" interface that has
784 appropriate servers set. The "uplink" interface is determined
785 by the default route of the system with the highest
786 priority. Note that this information is acquired at the time
787 the lease is handed out, and does not take uplink interfaces
788 into account that acquire DNS or NTP server information at a
789 later point. DNS server propagation does not take
790 <filename>/etc/resolv.conf</filename> into account. Also, note
791 that the leases are not refreshed if the uplink network
792 configuration changes. To ensure clients regularly acquire the
793 most current uplink DNS server information, it is thus
794 advisable to shorten the DHCP lease time via
795 <varname>MaxLeaseTimeSec=</varname> described
796 above.</para></listitem>
797 </varlistentry>
798
799 <varlistentry>
800 <term><varname>EmitNTP=</varname></term>
801 <term><varname>NTP=</varname></term>
802
803 <listitem><para>Similar to the <varname>EmitDNS=</varname> and
804 <varname>DNS=</varname> settings described above, these
805 settings configure whether and what NTP server information
806 shall be emitted as part of the DHCP lease. The same syntax,
807 propagation semantics and defaults apply as for
808 <varname>EmitDNS=</varname> and
809 <varname>DNS=</varname>.</para></listitem>
810 </varlistentry>
811
812 <varlistentry>
813 <term><varname>EmitTimezone=</varname></term>
814 <term><varname>Timezone=</varname></term>
815
816 <listitem><para>Configures whether the DHCP leases handed out
817 to clients shall contain timezone information. The
818 <varname>EmitTimezone=</varname> setting takes a boolean
819 argument and defaults to <literal>yes</literal>. The
820 <varname>Timezone=</varname> setting takes a timezone string
821 (such as <literal>Europe/Berlin</literal> or
822 <literal>UTC</literal>) to pass to clients. If no explicit
823 timezone is set, the system timezone of the local host is
824 propagated, as determined by the
825 <filename>/etc/localtime</filename> symlink.</para></listitem>
826 </varlistentry>
827
828 </variablelist>
829 </refsect1>
830
831 <refsect1>
832 <title>[Bridge] Section Options</title>
833 <para>The <literal>[Bridge]</literal> section accepts the
834 following keys.</para>
835 <variablelist class='network-directives'>
836 <varlistentry>
837 <term><varname>UnicastFlood=</varname></term>
838 <listitem>
839 <para>A boolean. Controls whether the bridge should flood
840 traffic for which an FDB entry is missing and the destination
841 is unknown through this port. Defaults to on.
842 </para>
843 </listitem>
844 </varlistentry>
845 <varlistentry>
846 <term><varname>HairPin=</varname></term>
847 <listitem>
848 <para>A boolean. Configures whether traffic may be sent back
849 out of the port on which it was received. By default, this
850 flag is false, and the bridge will not forward traffic back
851 out of the receiving port.</para>
852 </listitem>
853 </varlistentry>
854 <varlistentry>
855 <term><varname>UseBPDU=</varname></term>
856 <listitem>
857 <para>A boolean. Configures whether STP Bridge Protocol Data Units will be
858 processed by the bridge port. Defaults to yes.</para>
859 </listitem>
860 </varlistentry>
861 <varlistentry>
862 <term><varname>FastLeave=</varname></term>
863 <listitem>
864 <para>A boolean. This flag allows the bridge to immediately stop multicast
865 traffic on a port that receives an IGMP Leave message. It is only used with
866 IGMP snooping if enabled on the bridge. Defaults to off.</para>
867 </listitem>
868 </varlistentry>
869 <varlistentry>
870 <term><varname>AllowPortToBeRoot=</varname></term>
871 <listitem>
872 <para>A boolean. Configures whether a given port is allowed to
873 become a root port. Only used when STP is enabled on the bridge.
874 Defaults to on.</para>
875 </listitem>
876 </varlistentry>
877 <varlistentry>
878 <term><varname>Cost=</varname></term>
879 <listitem>
880 <para>Sets the "cost" of sending packets of this interface.
881 Each port in a bridge may have a different speed and the cost
882 is used to decide which link to use. Faster interfaces
883 should have lower costs.</para>
884 </listitem>
885 </varlistentry>
886 </variablelist>
887 </refsect1>
888 <refsect1>
889 <title>[BridgeFDB] Section Options</title>
890 <para>The <literal>[BridgeFDB]</literal> section manages the
891 forwarding database table of a port and accepts the following
892 keys. Specify several <literal>[BridgeFDB]</literal> sections to
893 configure several static MAC table entries.</para>
894
895 <variablelist class='network-directives'>
896 <varlistentry>
897 <term><varname>MACAddress=</varname></term>
898 <listitem>
899 <para>As in the <literal>[Network]</literal> section. This
900 key is mandatory.</para>
901 </listitem>
902 </varlistentry>
903 <varlistentry>
904 <term><varname>VLANId=</varname></term>
905 <listitem>
906 <para>The VLAN ID for the new static MAC table entry. If
907 omitted, no VLAN ID info is appended to the new static MAC
908 table entry.</para>
909 </listitem>
910 </varlistentry>
911 </variablelist>
912 </refsect1>
913
914 <refsect1>
915 <title>Example</title>
916 <example>
917 <title>/etc/systemd/network/50-static.network</title>
918
919 <programlisting>[Match]
920 Name=enp2s0
921
922 [Network]
923 Address=192.168.0.15/24
924 Gateway=192.168.0.1</programlisting>
925 </example>
926
927 <example>
928 <title>/etc/systemd/network/80-dhcp.network</title>
929
930 <programlisting>[Match]
931 Name=en*
932
933 [Network]
934 DHCP=yes</programlisting>
935 </example>
936
937 <example>
938 <title>/etc/systemd/network/25-bridge-static.network</title>
939
940 <programlisting>[Match]
941 Name=bridge0
942
943 [Network]
944 Address=192.168.0.15/24
945 Gateway=192.168.0.1
946 DNS=192.168.0.1</programlisting>
947 </example>
948
949 <example>
950 <title>/etc/systemd/network/25-bridge-slave-interface.network</title>
951
952 <programlisting>[Match]
953 Name=enp2s0
954
955 [Network]
956 Bridge=bridge0</programlisting>
957 </example>
958 <example>
959 <title>/etc/systemd/network/25-ipip.network</title>
960
961 <programlisting>[Match]
962 Name=em1
963
964 [Network]
965 Tunnel=ipip-tun</programlisting>
966 </example>
967
968 <example>
969 <title>/etc/systemd/network/25-sit.network</title>
970
971 <programlisting>[Match]
972 Name=em1
973
974 [Network]
975 Tunnel=sit-tun</programlisting>
976 </example>
977
978 <example>
979 <title>/etc/systemd/network/25-gre.network</title>
980
981 <programlisting>[Match]
982 Name=em1
983
984 [Network]
985 Tunnel=gre-tun</programlisting>
986 </example>
987
988 <example>
989 <title>/etc/systemd/network/25-vti.network</title>
990
991 <programlisting>[Match]
992 Name=em1
993
994 [Network]
995 Tunnel=vti-tun</programlisting>
996 </example>
997
998 <example>
999 <title>/etc/systemd/network/25-bond.network</title>
1000
1001 <programlisting>[Match]
1002 Name=bond1
1003
1004 [Network]
1005 DHCP=yes
1006 </programlisting>
1007 </example>
1008
1009 </refsect1>
1010
1011 <refsect1>
1012 <title>See Also</title>
1013 <para>
1014 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1015 <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
1016 <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1017 <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>
1018 </para>
1019 </refsect1>
1020
1021 </refentry>