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