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