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