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