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