]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd.network.xml
networkd: Add EmitRouter= option for DHCP Server (#3251)
[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
83 <para>Note that an interface without any static IPv6 addresses configured, and neither DHCPv6 nor IPv6LL enabled,
84 shall be considered to have no IPv6 support. IPv6 will be automatically disabled for that interface by writing "1"
85 to <filename>/proc/sys/net/ipv6/conf/<replaceable>ifname</replaceable>/disable_ipv6</filename>.
86 </para>
87 </refsect1>
88
89 <refsect1>
90 <title>[Match] Section Options</title>
91
92 <para>The network file contains a <literal>[Match]</literal>
93 section, which determines if a given network file may be applied
94 to a given device; and a <literal>[Network]</literal> section
95 specifying how the device should be configured. The first (in
96 lexical order) of the network files that matches a given device
97 is applied, all later files are ignored, even if they match as
98 well.</para>
99
100 <para>A network file is said to match a device if each of the
101 entries in the <literal>[Match]</literal> section matches, or if
102 the section is empty. The following keys are accepted:</para>
103
104 <variablelist class='network-directives'>
105 <varlistentry>
106 <term><varname>MACAddress=</varname></term>
107 <listitem>
108 <para>The hardware address.</para>
109 </listitem>
110 </varlistentry>
111 <varlistentry>
112 <term><varname>Path=</varname></term>
113 <listitem>
114 <para>A whitespace-separated list of shell-style globs
115 matching the persistent path, as exposed by the udev
116 property <literal>ID_PATH</literal>.</para>
117 </listitem>
118 </varlistentry>
119 <varlistentry>
120 <term><varname>Driver=</varname></term>
121 <listitem>
122 <para>A whitespace-separated list of shell-style globs
123 matching the driver currently bound to the device, as
124 exposed by the udev property <literal>DRIVER</literal>
125 of its parent device, or if that is not set the driver
126 as exposed by <literal>ethtool -i</literal> of the
127 device itself.</para>
128 </listitem>
129 </varlistentry>
130 <varlistentry>
131 <term><varname>Type=</varname></term>
132 <listitem>
133 <para>A whitespace-separated list of shell-style globs
134 matching the device type, as exposed by the udev property
135 <literal>DEVTYPE</literal>.</para>
136 </listitem>
137 </varlistentry>
138 <varlistentry>
139 <term><varname>Name=</varname></term>
140 <listitem>
141 <para>A whitespace-separated list of shell-style globs
142 matching the device name, as exposed by the udev property
143 <literal>INTERFACE</literal>.</para>
144 </listitem>
145 </varlistentry>
146 <varlistentry>
147 <term><varname>Host=</varname></term>
148 <listitem>
149 <para>Matches against the hostname or machine ID of the
150 host. See <literal>ConditionHost=</literal> in
151 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
152 for details.
153 </para>
154 </listitem>
155 </varlistentry>
156 <varlistentry>
157 <term><varname>Virtualization=</varname></term>
158 <listitem>
159 <para>Checks whether the system is executed in a virtualized
160 environment and optionally test whether it is a specific
161 implementation. See <literal>ConditionVirtualization=</literal> in
162 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
163 for details.
164 </para>
165 </listitem>
166 </varlistentry>
167 <varlistentry>
168 <term><varname>KernelCommandLine=</varname></term>
169 <listitem>
170 <para>Checks whether a specific kernel command line option is
171 set (or if prefixed with the exclamation mark unset). See
172 <literal>ConditionKernelCommandLine=</literal> in
173 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
174 for details.
175 </para>
176 </listitem>
177 </varlistentry>
178 <varlistentry>
179 <term><varname>Architecture=</varname></term>
180 <listitem>
181 <para>Checks whether the system is running on a specific
182 architecture. See <literal>ConditionArchitecture=</literal> in
183 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
184 for details.
185 </para>
186 </listitem>
187 </varlistentry>
188 </variablelist>
189
190 </refsect1>
191
192 <refsect1>
193 <title>[Link] Section Options</title>
194
195 <para> The <literal>[Link]</literal> section accepts the following keys:</para>
196
197 <variablelist class='network-directives'>
198 <varlistentry>
199 <term><varname>MACAddress=</varname></term>
200 <listitem>
201 <para>The hardware address.</para>
202 </listitem>
203 </varlistentry>
204 <varlistentry>
205 <term><varname>MTUBytes=</varname></term>
206 <listitem>
207 <para>The maximum transmission unit in bytes to set for the
208 device. The usual suffixes K, M, G, are supported and are
209 understood to the base of 1024.</para>
210 <para>Note that if IPv6 is enabled on the interface, and the MTU is chosen
211 below 1280 (the minimum MTU for IPv6) it will automatically be increased to this value.</para>
212 </listitem>
213 </varlistentry>
214 </variablelist>
215 </refsect1>
216
217 <refsect1>
218 <title>[Network] Section Options</title>
219
220 <para>The <literal>[Network]</literal> section accepts the following keys:</para>
221
222 <variablelist class='network-directives'>
223 <varlistentry>
224 <term><varname>Description=</varname></term>
225 <listitem>
226 <para>A description of the device. This is only used for
227 presentation purposes.</para>
228 </listitem>
229 </varlistentry>
230 <varlistentry>
231 <term><varname>DHCP=</varname></term>
232 <listitem>
233 <para>Enables DHCPv4 and/or DHCPv6 client support. Accepts
234 <literal>yes</literal>, <literal>no</literal>,
235 <literal>ipv4</literal>, or <literal>ipv6</literal>.</para>
236
237 <para>Note that DHCPv6 will by default be triggered by Router
238 Advertisement, if that is enabled, regardless of this parameter.
239 By enabling DHCPv6 support explicitly, the DHCPv6 client will
240 be started regardless of the presence of routers on the link,
241 or what flags the routers pass. See
242 <literal>IPv6AcceptRouterAdvertisements=</literal>.</para>
243
244 <para>Furthermore, note that by default the domain name
245 specified through DHCP is not used for name resolution.
246 See option <option>UseDomains=</option> below.</para>
247
248 <para>See the <literal>[DHCP]</literal> section below for further configuration options for the DHCP client
249 support.</para>
250 </listitem>
251 </varlistentry>
252 <varlistentry>
253 <term><varname>DHCPServer=</varname></term>
254 <listitem>
255 <para>A boolean. Enables DHCPv4 server support. Defaults
256 to <literal>no</literal>. Further settings for the DHCP
257 server may be set in the <literal>[DHCPServer]</literal>
258 section described below.</para>
259 </listitem>
260 </varlistentry>
261 <varlistentry>
262 <term><varname>LinkLocalAddressing=</varname></term>
263 <listitem>
264 <para>Enables link-local address autoconfiguration. Accepts
265 <literal>yes</literal>, <literal>no</literal>,
266 <literal>ipv4</literal>, or <literal>ipv6</literal>. Defaults to
267 <literal>ipv6</literal>.</para>
268 </listitem>
269 </varlistentry>
270 <varlistentry>
271 <term><varname>IPv4LLRoute=</varname></term>
272 <listitem>
273 <para>A boolean. When true, sets up the route needed for
274 non-IPv4LL hosts to communicate with IPv4LL-only hosts. Defaults
275 to false.
276 </para>
277 </listitem>
278 </varlistentry>
279 <varlistentry>
280 <term><varname>IPv6Token=</varname></term>
281 <listitem>
282 <para>An IPv6 address with the top 64 bits unset. When set, indicates the
283 64-bit interface part of SLAAC IPv6 addresses for this link. Note that
284 the token is only ever used for SLAAC, and not for DHCPv6 addresses, even
285 in the case DHCP is requested by router advertisement. By default, the
286 token is autogenerated.</para>
287 </listitem>
288 </varlistentry>
289 <varlistentry>
290 <term><varname>LLMNR=</varname></term>
291 <listitem>
292 <para>A boolean or <literal>resolve</literal>. When true,
293 enables <ulink
294 url="https://tools.ietf.org/html/rfc4795">Link-Local
295 Multicast Name Resolution</ulink> on the link. When set to
296 <literal>resolve</literal>, only resolution is enabled,
297 but not host registration and announcement. Defaults to
298 true. This setting is read by
299 <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
300 </listitem>
301 </varlistentry>
302 <varlistentry>
303 <term><varname>MulticastDNS=</varname></term>
304 <listitem>
305 <para>A boolean or <literal>resolve</literal>. When true,
306 enables <ulink
307 url="https://tools.ietf.org/html/rfc6762">Multicast
308 DNS</ulink> support on the link. When set to
309 <literal>resolve</literal>, only resolution is enabled,
310 but not host or service registration and
311 announcement. Defaults to false. This setting is read by
312 <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
313 </listitem>
314 </varlistentry>
315 <varlistentry>
316 <term><varname>DNSSEC=</varname></term>
317 <listitem>
318 <para>A boolean or
319 <literal>allow-downgrade</literal>. When true, enables
320 <ulink
321 url="https://tools.ietf.org/html/rfc4033">DNSSEC</ulink>
322 DNS validation support on the link. When set to
323 <literal>allow-downgrade</literal>, compatibility with
324 non-DNSSEC capable networks is increased, by automatically
325 turning off DNSEC in this case. This option defines a
326 per-interface setting for
327 <citerefentry><refentrytitle>resolved.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>'s
328 global <varname>DNSSEC=</varname> option. Defaults to
329 false. This setting is read by
330 <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
331 </listitem>
332 </varlistentry>
333 <varlistentry>
334 <term><varname>DNSSECNegativeTrustAnchors=</varname></term>
335 <listitem><para>A space-separated list of DNSSEC negative
336 trust anchor domains. If specified and DNSSEC is enabled,
337 look-ups done via the interface's DNS server will be subject
338 to the list of negative trust anchors, and not require
339 authentication for the specified domains, or anything below
340 it. Use this to disable DNSSEC authentication for specific
341 private domains, that cannot be proven valid using the
342 Internet DNS hierarchy. Defaults to the empty list. This
343 setting is read by
344 <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
345 </listitem>
346 </varlistentry>
347 <varlistentry>
348 <term><varname>LLDP=</varname></term>
349 <listitem>
350 <para>Controls support for Ethernet LLDP packet reception. LLDP is a link-layer protocol commonly
351 implemented on professional routers and bridges which announces which physical port a system is connected
352 to, as well as other related data. Accepts a boolean or the special value
353 <literal>routers-only</literal>. When true, incoming LLDP packets are accepted and a database of all LLDP
354 neighbors maintained. If <literal>routers-only</literal> is set only LLDP data of various types of routers
355 is collected and LLDP data about other types of devices ignored (such as stations, telephones and
356 others). If false, LLDP reception is disabled. Defaults to <literal>routers-only</literal>. Use
357 <citerefentry><refentrytitle>networkctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> to query the
358 collected neighbor data. LLDP is only available on Ethernet links. See <varname>EmitLLDP=</varname> below
359 for enabling LLDP packet emission from the local system.
360 </para>
361 </listitem>
362 </varlistentry>
363 <varlistentry>
364 <term><varname>EmitLLDP=</varname></term>
365 <listitem>
366 <para>Controls support for Ethernet LLDP packet emission. Accepts a boolean parameter or the special values
367 <literal>nearest-bridge</literal>, <literal>non-tpmr-bridge</literal> and
368 <literal>customer-bridge</literal>. Defaults to false, which turns off LLDP packet emission. If not false,
369 a short LLDP packet with information about the local system is sent out in regular intervals on the
370 link. The LLDP packet will contain information about the local host name, the local machine ID (as stored
371 in <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>) and the
372 local interface name, as well as the pretty hostname of the system (as set in
373 <citerefentry><refentrytitle>machine-info</refentrytitle><manvolnum>5</manvolnum></citerefentry>). LLDP
374 emission is only available on Ethernet links. Note that this setting passes data suitable for
375 identification of host to the network and should thus not be enabled on untrusted networks, where such
376 identification data should not be made available. Use this option to permit other systems to identify on
377 which interfaces they are connected to this system. The three special values control propagation of the
378 LLDP packets. The <literal>nearest-bridge</literal> setting permits propagation only to the nearest
379 connected bridge, <literal>non-tpmr-bridge</literal> permits propagation across Two-Port MAC Relays, but
380 not any other bridges, and <literal>customer-bridge</literal> permits propagation until a customer bridge
381 is reached. For details about these concepts, see <ulink
382 url="http://standards.ieee.org/getieee802/download/802.1AB-2009.pdf">IEEE 802.1AB-2009</ulink>. Note that
383 configuring this setting to true is equivalent to <literal>nearest-bridge</literal>, the recommended and
384 most restricted level of propagation. See <varname>LLDP=</varname> above for an option to enable LLDP
385 reception.</para>
386 </listitem>
387 </varlistentry>
388 <varlistentry>
389 <term><varname>BindCarrier=</varname></term>
390 <listitem>
391 <para>A link name or a list of link names. When set, controls the behavior of the current
392 link. When all links in the list are in an operational down state, the current link is brought
393 down. When at least one link has carrier, the current interface is brought up.
394 </para>
395 </listitem>
396 </varlistentry>
397 <varlistentry>
398 <term><varname>Address=</varname></term>
399 <listitem>
400 <para>A static IPv4 or IPv6 address and its prefix length,
401 separated by a <literal>/</literal> character. Specify
402 this key more than once to configure several addresses.
403 The format of the address must be as described in
404 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
405 This is a short-hand for an [Address] section only
406 containing an Address key (see below). This option may be
407 specified more than once.
408 </para>
409
410 <para>If the specified address is 0.0.0.0 (for IPv4) or
411 [::] (for IPv6), a new address range of the requested size
412 is automatically allocated from a system-wide pool of
413 unused ranges. The allocated range is checked against all
414 current network interfaces and all known network
415 configuration files to avoid address range conflicts. The
416 default system-wide pool consists of 192.168.0.0/16,
417 172.16.0.0/12 and 10.0.0.0/8 for IPv4, and fc00::/7 for
418 IPv6. This functionality is useful to manage a large
419 number of dynamically created network interfaces with the
420 same network configuration and automatic address range
421 assignment.</para>
422
423 </listitem>
424 </varlistentry>
425 <varlistentry>
426 <term><varname>Gateway=</varname></term>
427 <listitem>
428 <para>The gateway address, which must be in the format
429 described in
430 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
431 This is a short-hand for a [Route] section only containing
432 a Gateway key. This option may be specified more than
433 once.</para>
434 </listitem>
435 </varlistentry>
436 <varlistentry>
437 <term><varname>DNS=</varname></term>
438 <listitem>
439 <para>A DNS server address, which must be in the format
440 described in
441 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
442 This option may be specified more than once. This setting is read by
443 <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
444 </listitem>
445 </varlistentry>
446 <varlistentry>
447 <term><varname>Domains=</varname></term>
448 <listitem>
449 <para>The domains used for DNS host name resolution on this link. Takes a list of DNS domain names which
450 are used as search suffixes for extending single-label host names (host names containing no dots) to become
451 fully qualified domain names (FQDNs). If a single-label host name is resolved on this interface, each of
452 the specified search domains are appended to it in turn, converting it into a fully qualified domain name,
453 until one of them may be successfully resolved.</para>
454
455 <para>The specified domains are also used for routing of DNS queries: look-ups for host names ending in the
456 domains specified here are preferably routed to the DNS servers configured for this interface. If a domain
457 name is prefixed with <literal>~</literal>, the domain name becomes a pure "routing" domain, is used for
458 DNS query routing purposes only and is not used in the described domain search logic. By specifying a
459 routing domain of <literal>~.</literal> (the tilde indicating definition of a routing domain, the dot
460 referring to the DNS root domain which is the implied suffix of all valid DNS names) it is possible to
461 route all DNS traffic preferably to the DNS server specified for this interface. The route domain logic is
462 particularly useful on multi-homed hosts with DNS servers serving particular private DNS zones on each
463 interface.</para>
464
465 <para>This setting is read by
466 <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
467 </listitem>
468 </varlistentry>
469 <varlistentry>
470 <term><varname>NTP=</varname></term>
471 <listitem>
472 <para>An NTP server address. This option may be specified more than once. This setting is read by
473 <citerefentry><refentrytitle>systemd-timesyncd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
474 </listitem>
475 </varlistentry>
476 <varlistentry>
477 <term><varname>IPForward=</varname></term>
478 <listitem><para>Configures IP packet forwarding for the
479 system. If enabled, incoming packets on any network
480 interface will be forwarded to any other interfaces
481 according to the routing table. Takes either a boolean
482 argument, or the values <literal>ipv4</literal> or
483 <literal>ipv6</literal>, which only enable IP packet
484 forwarding for the specified address family. This controls
485 the <filename>net.ipv4.ip_forward</filename> and
486 <filename>net.ipv6.conf.all.forwarding</filename> sysctl
487 options of the network interface (see <ulink
488 url="https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt">ip-sysctl.txt</ulink>
489 for details about sysctl options). Defaults to
490 <literal>no</literal>.</para>
491
492 <para>Note: this setting controls a global kernel option,
493 and does so one way only: if a network that has this setting
494 enabled is set up the global setting is turned on. However,
495 it is never turned off again, even after all networks with
496 this setting enabled are shut down again.</para>
497
498 <para>To allow IP packet forwarding only between specific
499 network interfaces use a firewall.</para>
500 </listitem>
501 </varlistentry>
502 <varlistentry>
503 <term><varname>IPMasquerade=</varname></term>
504 <listitem><para>Configures IP masquerading for the network
505 interface. If enabled, packets forwarded from the network
506 interface will be appear as coming from the local host.
507 Takes a boolean argument. Implies
508 <varname>IPForward=ipv4</varname>. Defaults to
509 <literal>no</literal>.</para></listitem>
510 </varlistentry>
511 <varlistentry>
512 <term><varname>IPv6PrivacyExtensions=</varname></term>
513 <listitem><para>Configures use of stateless temporary
514 addresses that change over time (see <ulink
515 url="https://tools.ietf.org/html/rfc4941">RFC 4941</ulink>,
516 Privacy Extensions for Stateless Address Autoconfiguration
517 in IPv6). Takes a boolean or the special values
518 <literal>prefer-public</literal> and
519 <literal>kernel</literal>. When true, enables the privacy
520 extensions and prefers temporary addresses over public
521 addresses. When <literal>prefer-public</literal>, enables the
522 privacy extensions, but prefers public addresses over
523 temporary addresses. When false, the privacy extensions
524 remain disabled. When <literal>kernel</literal>, the kernel's
525 default setting will be left in place. Defaults to
526 <literal>no</literal>.</para></listitem>
527 </varlistentry>
528 <varlistentry>
529 <term><varname>IPv6AcceptRouterAdvertisements=</varname></term>
530 <listitem><para>Force the setting of the <filename>accept_ra</filename>
531 (router advertisements) setting for the interface.
532 When unset, the kernel default is used, and router
533 advertisements are accepted only when local forwarding
534 is disabled for that interface.
535 When router advertisements are accepted, they will
536 trigger the start of the DHCPv6 client if the relevant
537 flags are passed, or if no routers are found on the link.
538 Takes a boolean. If true, router advertisements are
539 accepted, when false, router advertisements are ignored,
540 independently of the local forwarding state.</para>
541
542 <para>See
543 <ulink url="https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt">ip-sysctl.txt</ulink>
544 in the kernel documentation, but note that systemd's
545 setting of <constant>1</constant> corresponds to
546 kernel's setting of <constant>2</constant>.</para>
547 </listitem>
548 </varlistentry>
549 <varlistentry>
550 <term><varname>IPv6DuplicateAddressDetection=</varname></term>
551 <listitem><para>Configures the amount of IPv6 Duplicate
552 Address Detection (DAD) probes to send. Defaults to unset.
553 </para></listitem>
554 </varlistentry>
555 <varlistentry>
556 <term><varname>IPv6HopLimit=</varname></term>
557 <listitem><para>Configures IPv6 Hop Limit. For each router that
558 forwards the packet, the hop limit is decremented by 1. When the
559 hop limit field reaches zero, the packet is discarded.
560 Defaults to unset.
561 </para></listitem>
562 </varlistentry>
563 <varlistentry>
564 <term><varname>ProxyARP=</varname></term>
565 <listitem><para>A boolean. Configures proxy ARP. Proxy ARP is the technique in which one host,
566 usually a router, answers ARP requests intended for another machine. By "faking" its identity,
567 the router accepts responsibility for routing packets to the "real" destination. (see <ulink
568 url="https://tools.ietf.org/html/rfc1027">RFC 1027</ulink>.
569 Defaults to unset.
570 </para></listitem>
571 </varlistentry>
572 <varlistentry>
573 <term><varname>Bridge=</varname></term>
574 <listitem>
575 <para>The name of the bridge to add the link to.</para>
576 </listitem>
577 </varlistentry>
578 <varlistentry>
579 <term><varname>Bond=</varname></term>
580 <listitem>
581 <para>The name of the bond to add the link to.</para>
582 </listitem>
583 </varlistentry>
584 <varlistentry>
585 <term><varname>VLAN=</varname></term>
586 <listitem>
587 <para>The name of a VLAN to create on the link. This
588 option may be specified more than once.</para>
589 </listitem>
590 </varlistentry>
591 <varlistentry>
592 <term><varname>MACVLAN=</varname></term>
593 <listitem>
594 <para>The name of a MACVLAN to create on the link. This
595 option may be specified more than once.</para>
596 </listitem>
597 </varlistentry>
598 <varlistentry>
599 <term><varname>VXLAN=</varname></term>
600 <listitem>
601 <para>The name of a VXLAN to create on the link. This
602 option may be specified more than once.</para>
603 </listitem>
604 </varlistentry>
605 <varlistentry>
606 <term><varname>Tunnel=</varname></term>
607 <listitem>
608 <para>The name of a Tunnel to create on the link. This
609 option may be specified more than once.</para>
610 </listitem>
611 </varlistentry>
612 </variablelist>
613
614 </refsect1>
615
616 <refsect1>
617 <title>[Address] Section Options</title>
618
619 <para>An <literal>[Address]</literal> section accepts the
620 following keys. Specify several <literal>[Address]</literal>
621 sections to configure several addresses.</para>
622
623 <variablelist class='network-directives'>
624 <varlistentry>
625 <term><varname>Address=</varname></term>
626 <listitem>
627 <para>As in the <literal>[Network]</literal> section. This
628 key is mandatory.</para>
629 </listitem>
630 </varlistentry>
631 <varlistentry>
632 <term><varname>Peer=</varname></term>
633 <listitem>
634 <para>The peer address in a point-to-point connection.
635 Accepts the same format as the <literal>Address</literal>
636 key.</para>
637 </listitem>
638 </varlistentry>
639 <varlistentry>
640 <term><varname>Broadcast=</varname></term>
641 <listitem>
642 <para>The broadcast address, which must be in the format
643 described in
644 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
645 This key only applies to IPv4 addresses. If it is not
646 given, it is derived from the <literal>Address</literal>
647 key.</para>
648 </listitem>
649 </varlistentry>
650 <varlistentry>
651 <term><varname>Label=</varname></term>
652 <listitem>
653 <para>An address label.</para>
654 </listitem>
655 </varlistentry>
656 <varlistentry>
657 <term><varname>PreferredLifetime=</varname></term>
658 <listitem>
659 <para>Allows the default "preferred lifetime" of the address to be overridden.
660 Only three settings are accepted: <literal>forever</literal> or <literal>infinity</literal>
661 which is the default and means that the address never expires, and <literal>0</literal> which means
662 that the address is considered immediately "expired" and will not be used,
663 unless explicitly requested. A setting of PreferredLifetime=0 is useful for
664 addresses which are added to be used only by a specific application,
665 which is then configured to use them explicitly.</para>
666 </listitem>
667 </varlistentry>
668 </variablelist>
669 </refsect1>
670
671 <refsect1>
672 <title>[Route] Section Options</title>
673 <para>The <literal>[Route]</literal> section accepts the
674 following keys. Specify several <literal>[Route]</literal>
675 sections to configure several routes.</para>
676
677 <variablelist class='network-directives'>
678 <varlistentry>
679 <term><varname>Gateway=</varname></term>
680 <listitem>
681 <para>As in the <literal>[Network]</literal> section.</para>
682 </listitem>
683 </varlistentry>
684 <varlistentry>
685 <term><varname>Destination=</varname></term>
686 <listitem>
687 <para>The destination prefix of the route. Possibly
688 followed by a slash and the prefix length. If omitted, a
689 full-length host route is assumed.</para>
690 </listitem>
691 </varlistentry>
692 <varlistentry>
693 <term><varname>Source=</varname></term>
694 <listitem>
695 <para>The source prefix of the route. Possibly followed by
696 a slash and the prefix length. If omitted, a full-length
697 host route is assumed.</para>
698 </listitem>
699 </varlistentry>
700 <varlistentry>
701 <term><varname>Metric=</varname></term>
702 <listitem>
703 <para>The metric of the route (an unsigned integer).</para>
704 </listitem>
705 </varlistentry>
706 <varlistentry>
707 <term><varname>Scope=</varname></term>
708 <listitem>
709 <para>The scope of the route, which can be <literal>global</literal>,
710 <literal>link</literal> or <literal>host</literal>. Defaults to
711 <literal>global</literal>.</para>
712 </listitem>
713 </varlistentry>
714 <varlistentry>
715 <term><varname>PreferredSource=</varname></term>
716 <listitem>
717 <para>The preferred source address of the route. The address
718 must be in the format described in
719 <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
720 </listitem>
721 </varlistentry>
722 <varlistentry>
723 <term><varname>Table=<replaceable>num</replaceable></varname></term>
724 <listitem>
725 <para>The table identifier for the route (a number between 1 and 4294967295, or 0 to unset).
726 The table can be retrieved using <command>ip route show table <replaceable>num</replaceable></command>.
727 </para>
728 </listitem>
729 </varlistentry>
730 </variablelist>
731 </refsect1>
732
733 <refsect1>
734 <title>[DHCP] Section Options</title>
735 <para>The <literal>[DHCP]</literal> section configures the
736 DHCPv4 and DHCP6 client, if it is enabled with the
737 <varname>DHCP=</varname> setting described above:</para>
738
739 <variablelist class='network-directives'>
740 <varlistentry>
741 <term><varname>UseDNS=</varname></term>
742 <listitem>
743 <para>When true (the default), the DNS servers received
744 from the DHCP server will be used and take precedence over
745 any statically configured ones.</para>
746
747 <para>This corresponds to the <option>nameserver</option>
748 option in <citerefentry
749 project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
750 </listitem>
751 </varlistentry>
752 <varlistentry>
753 <term><varname>UseNTP=</varname></term>
754 <listitem>
755 <para>When true (the default), the NTP servers received
756 from the DHCP server will be used by systemd-timesyncd
757 and take precedence over any statically configured ones.</para>
758 </listitem>
759 </varlistentry>
760 <varlistentry>
761 <term><varname>UseMTU=</varname></term>
762 <listitem>
763 <para>When true, the interface maximum transmission unit
764 from the DHCP server will be used on the current link.
765 Defaults to false.</para>
766 </listitem>
767 </varlistentry>
768 <varlistentry>
769 <term><varname>SendHostname=</varname></term>
770 <listitem>
771 <para>When true (the default), the machine's hostname will
772 be sent to the DHCP server.</para>
773 </listitem>
774 </varlistentry>
775 <varlistentry>
776 <term><varname>UseHostname=</varname></term>
777 <listitem>
778 <para>When true (the default), the hostname received from
779 the DHCP server will be set as the transient hostname of the system
780 </para>
781 </listitem>
782 </varlistentry>
783 <varlistentry>
784 <term><varname>Hostname=</varname></term>
785 <listitem>
786 <para>Use this value for the hostname which is sent to the
787 DHCP server, instead of machine's hostname.</para>
788 </listitem>
789 </varlistentry>
790 <varlistentry>
791 <term><varname>UseDomains=</varname></term>
792 <listitem>
793 <para>Takes a boolean argument, or the special value <literal>route</literal>. When true, the domain name
794 received from the DHCP server will be used as DNS search domain over this link, similar to the effect of
795 the <option>Domains=</option> setting. If set to <literal>route</literal>, the domain name received from
796 the DHCP server will be used for routing DNS queries only, but not for searching, similar to the effect of
797 the <option>Domains=</option> setting when the argument is prefixed with <literal>~</literal>. Defaults to
798 false.</para>
799
800 <para>It is recommended to enable this option only on trusted networks, as setting this affects resolution
801 of all host names, in particular to single-label names. It is generally safer to use the supplied domain
802 only as routing domain, rather than as search domain, in order to not have it affect local resolution of
803 single-label names.</para>
804
805 <para>When set to true, this setting corresponds to the <option>domain</option> option in <citerefentry
806 project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
807 </listitem>
808 </varlistentry>
809 <varlistentry>
810 <term><varname>UseRoutes=</varname></term>
811 <listitem>
812 <para>When true (the default), the static routes will be
813 requested from the DHCP server and added to the routing
814 table with a metric of 1024.</para>
815 </listitem>
816 </varlistentry>
817
818 <varlistentry>
819 <term><varname>UseTimezone=</varname></term>
820
821 <listitem><para>When true, the timezone received from the
822 DHCP server will be set as timezone of the local
823 system. Defaults to <literal>no</literal>.</para></listitem>
824 </varlistentry>
825
826 <varlistentry>
827 <term><varname>CriticalConnection=</varname></term>
828 <listitem>
829 <para>When true, the connection will never be torn down
830 even if the DHCP lease expires. This is contrary to the
831 DHCP specification, but may be the best choice if, say,
832 the root filesystem relies on this connection. Defaults to
833 false.</para>
834 </listitem>
835 </varlistentry>
836
837 <varlistentry>
838 <term><varname>ClientIdentifier=</varname></term>
839 <listitem>
840 <para>The DHCPv4 client identifier to use. Either <literal>mac</literal> to use the MAC address of the link
841 or <literal>duid</literal> (the default, see below) to use a RFC4361-compliant Client ID.</para>
842 </listitem>
843 </varlistentry>
844
845 <varlistentry>
846 <term><varname>VendorClassIdentifier=</varname></term>
847 <listitem>
848 <para>The vendor class identifier used to identify vendor
849 type and configuration.</para>
850 </listitem>
851 </varlistentry>
852
853 <varlistentry>
854 <term><varname>DUIDType=</varname></term>
855 <listitem>
856 <para>Override the global <varname>DUIDType</varname> setting for this network. See
857 <citerefentry><refentrytitle>networkd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
858 for a description of possible values.</para>
859 </listitem>
860 </varlistentry>
861
862 <varlistentry>
863 <term><varname>DUIDRawData=</varname></term>
864 <listitem>
865 <para>Override the global <varname>DUIDRawData</varname> setting for this network. See
866 <citerefentry><refentrytitle>networkd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
867 for a description of possible values.</para>
868 </listitem>
869 </varlistentry>
870
871 <varlistentry>
872 <term><varname>IAID=</varname></term>
873 <listitem>
874 <para>The DHCP Identity Association Identifier (IAID) for the interface, a 32-bit unsigned integer.</para>
875 </listitem>
876 </varlistentry>
877
878 <varlistentry>
879 <term><varname>RequestBroadcast=</varname></term>
880 <listitem>
881 <para>Request the server to use broadcast messages before
882 the IP address has been configured. This is necessary for
883 devices that cannot receive RAW packets, or that cannot
884 receive packets at all before an IP address has been
885 configured. On the other hand, this must not be enabled on
886 networks where broadcasts are filtered out.</para>
887 </listitem>
888 </varlistentry>
889
890 <varlistentry>
891 <term><varname>RouteMetric=</varname></term>
892 <listitem>
893 <para>Set the routing metric for routes specified by the
894 DHCP server.</para>
895 </listitem>
896 </varlistentry>
897 </variablelist>
898 </refsect1>
899
900 <refsect1>
901 <title>[DHCPServer] Section Options</title>
902 <para>The <literal>[DHCPServer]</literal> section contains
903 settings for the DHCP server, if enabled via the
904 <varname>DHCPServer=</varname> option described above:</para>
905
906 <variablelist class='network-directives'>
907
908 <varlistentry>
909 <term><varname>PoolOffset=</varname></term>
910 <term><varname>PoolSize=</varname></term>
911
912 <listitem><para>Configures the pool of addresses to hand out. The pool
913 is a contiguous sequence of IP addresses in the subnet configured for
914 the server address, which does not include the subnet nor the broadcast
915 address. <varname>PoolOffset=</varname> takes the offset of the pool
916 from the start of subnet, or zero to use the default value.
917 <varname>PoolSize=</varname> takes the number of IP addresses in the
918 pool or zero to use the default value. By default, the pool starts at
919 the first address after the subnet address and takes up the rest of
920 the subnet, excluding the broadcast address. If the pool includes
921 the server address (the default), this is reserved and not handed
922 out to clients.</para></listitem>
923 </varlistentry>
924
925 <varlistentry>
926 <term><varname>DefaultLeaseTimeSec=</varname></term>
927 <term><varname>MaxLeaseTimeSec=</varname></term>
928
929 <listitem><para>Control the default and maximum DHCP lease
930 time to pass to clients. These settings take time values in seconds or
931 another common time unit, depending on the suffix. The default
932 lease time is used for clients that did not ask for a specific
933 lease time. If a client asks for a lease time longer than the
934 maximum lease time, it is automatically shortened to the
935 specified time. The default lease time defaults to 1h, the
936 maximum lease time to 12h. Shorter lease times are beneficial
937 if the configuration data in DHCP leases changes frequently
938 and clients shall learn the new settings with shorter
939 latencies. Longer lease times reduce the generated DHCP
940 network traffic.</para></listitem>
941 </varlistentry>
942
943 <varlistentry>
944 <term><varname>EmitDNS=</varname></term>
945 <term><varname>DNS=</varname></term>
946
947 <listitem><para>Configures whether the DHCP leases handed out
948 to clients shall contain DNS server information. The
949 <varname>EmitDNS=</varname> setting takes a boolean argument
950 and defaults to <literal>yes</literal>. The DNS servers to
951 pass to clients may be configured with the
952 <varname>DNS=</varname> option, which takes a list of IPv4
953 addresses. If the <varname>EmitDNS=</varname> option is
954 enabled but no servers configured, the servers are
955 automatically propagated from an "uplink" interface that has
956 appropriate servers set. The "uplink" interface is determined
957 by the default route of the system with the highest
958 priority. Note that this information is acquired at the time
959 the lease is handed out, and does not take uplink interfaces
960 into account that acquire DNS or NTP server information at a
961 later point. DNS server propagation does not take
962 <filename>/etc/resolv.conf</filename> into account. Also, note
963 that the leases are not refreshed if the uplink network
964 configuration changes. To ensure clients regularly acquire the
965 most current uplink DNS server information, it is thus
966 advisable to shorten the DHCP lease time via
967 <varname>MaxLeaseTimeSec=</varname> described
968 above.</para></listitem>
969 </varlistentry>
970
971 <varlistentry>
972 <term><varname>EmitNTP=</varname></term>
973 <term><varname>NTP=</varname></term>
974
975 <listitem><para>Similar to the <varname>EmitDNS=</varname> and
976 <varname>DNS=</varname> settings described above, these
977 settings configure whether and what NTP server information
978 shall be emitted as part of the DHCP lease. The same syntax,
979 propagation semantics and defaults apply as for
980 <varname>EmitDNS=</varname> and
981 <varname>DNS=</varname>.</para></listitem>
982 </varlistentry>
983
984 <varlistentry>
985 <term><varname>EmitRouter=</varname></term>
986
987 <listitem><para>Similar to the <varname>EmitDNS=</varname>
988 setting described above, this setting configures whether the
989 DHCP lease should contain the router option. The same syntax,
990 propagation semantics and defaults apply as for
991 <varname>EmitDNS=</varname>.</para></listitem>
992 </varlistentry>
993
994 <varlistentry>
995 <term><varname>EmitTimezone=</varname></term>
996 <term><varname>Timezone=</varname></term>
997
998 <listitem><para>Configures whether the DHCP leases handed out
999 to clients shall contain timezone information. The
1000 <varname>EmitTimezone=</varname> setting takes a boolean
1001 argument and defaults to <literal>yes</literal>. The
1002 <varname>Timezone=</varname> setting takes a timezone string
1003 (such as <literal>Europe/Berlin</literal> or
1004 <literal>UTC</literal>) to pass to clients. If no explicit
1005 timezone is set, the system timezone of the local host is
1006 propagated, as determined by the
1007 <filename>/etc/localtime</filename> symlink.</para></listitem>
1008 </varlistentry>
1009
1010 </variablelist>
1011 </refsect1>
1012
1013 <refsect1>
1014 <title>[Bridge] Section Options</title>
1015 <para>The <literal>[Bridge]</literal> section accepts the
1016 following keys.</para>
1017 <variablelist class='network-directives'>
1018 <varlistentry>
1019 <term><varname>UnicastFlood=</varname></term>
1020 <listitem>
1021 <para>A boolean. Controls whether the bridge should flood
1022 traffic for which an FDB entry is missing and the destination
1023 is unknown through this port. Defaults to on.
1024 </para>
1025 </listitem>
1026 </varlistentry>
1027 <varlistentry>
1028 <term><varname>HairPin=</varname></term>
1029 <listitem>
1030 <para>A boolean. Configures whether traffic may be sent back
1031 out of the port on which it was received. By default, this
1032 flag is false, and the bridge will not forward traffic back
1033 out of the receiving port.</para>
1034 </listitem>
1035 </varlistentry>
1036 <varlistentry>
1037 <term><varname>UseBPDU=</varname></term>
1038 <listitem>
1039 <para>A boolean. Configures whether STP Bridge Protocol Data Units will be
1040 processed by the bridge port. Defaults to yes.</para>
1041 </listitem>
1042 </varlistentry>
1043 <varlistentry>
1044 <term><varname>FastLeave=</varname></term>
1045 <listitem>
1046 <para>A boolean. This flag allows the bridge to immediately stop multicast
1047 traffic on a port that receives an IGMP Leave message. It is only used with
1048 IGMP snooping if enabled on the bridge. Defaults to off.</para>
1049 </listitem>
1050 </varlistentry>
1051 <varlistentry>
1052 <term><varname>AllowPortToBeRoot=</varname></term>
1053 <listitem>
1054 <para>A boolean. Configures whether a given port is allowed to
1055 become a root port. Only used when STP is enabled on the bridge.
1056 Defaults to on.</para>
1057 </listitem>
1058 </varlistentry>
1059 <varlistentry>
1060 <term><varname>Cost=</varname></term>
1061 <listitem>
1062 <para>Sets the "cost" of sending packets of this interface.
1063 Each port in a bridge may have a different speed and the cost
1064 is used to decide which link to use. Faster interfaces
1065 should have lower costs.</para>
1066 </listitem>
1067 </varlistentry>
1068 </variablelist>
1069 </refsect1>
1070 <refsect1>
1071 <title>[BridgeFDB] Section Options</title>
1072 <para>The <literal>[BridgeFDB]</literal> section manages the
1073 forwarding database table of a port and accepts the following
1074 keys. Specify several <literal>[BridgeFDB]</literal> sections to
1075 configure several static MAC table entries.</para>
1076
1077 <variablelist class='network-directives'>
1078 <varlistentry>
1079 <term><varname>MACAddress=</varname></term>
1080 <listitem>
1081 <para>As in the <literal>[Network]</literal> section. This
1082 key is mandatory.</para>
1083 </listitem>
1084 </varlistentry>
1085 <varlistentry>
1086 <term><varname>VLANId=</varname></term>
1087 <listitem>
1088 <para>The VLAN ID for the new static MAC table entry. If
1089 omitted, no VLAN ID info is appended to the new static MAC
1090 table entry.</para>
1091 </listitem>
1092 </varlistentry>
1093 </variablelist>
1094 </refsect1>
1095
1096 <refsect1>
1097 <title>Example</title>
1098 <example>
1099 <title>/etc/systemd/network/50-static.network</title>
1100
1101 <programlisting>[Match]
1102 Name=enp2s0
1103
1104 [Network]
1105 Address=192.168.0.15/24
1106 Gateway=192.168.0.1</programlisting>
1107 </example>
1108
1109 <example>
1110 <title>/etc/systemd/network/80-dhcp.network</title>
1111
1112 <programlisting>[Match]
1113 Name=en*
1114
1115 [Network]
1116 DHCP=yes</programlisting>
1117 </example>
1118
1119 <example>
1120 <title>/etc/systemd/network/25-bridge-static.network</title>
1121
1122 <programlisting>[Match]
1123 Name=bridge0
1124
1125 [Network]
1126 Address=192.168.0.15/24
1127 Gateway=192.168.0.1
1128 DNS=192.168.0.1</programlisting>
1129 </example>
1130
1131 <example>
1132 <title>/etc/systemd/network/25-bridge-slave-interface.network</title>
1133
1134 <programlisting>[Match]
1135 Name=enp2s0
1136
1137 [Network]
1138 Bridge=bridge0</programlisting>
1139 </example>
1140 <example>
1141 <title>/etc/systemd/network/25-ipip.network</title>
1142
1143 <programlisting>[Match]
1144 Name=em1
1145
1146 [Network]
1147 Tunnel=ipip-tun</programlisting>
1148 </example>
1149
1150 <example>
1151 <title>/etc/systemd/network/25-sit.network</title>
1152
1153 <programlisting>[Match]
1154 Name=em1
1155
1156 [Network]
1157 Tunnel=sit-tun</programlisting>
1158 </example>
1159
1160 <example>
1161 <title>/etc/systemd/network/25-gre.network</title>
1162
1163 <programlisting>[Match]
1164 Name=em1
1165
1166 [Network]
1167 Tunnel=gre-tun</programlisting>
1168 </example>
1169
1170 <example>
1171 <title>/etc/systemd/network/25-vti.network</title>
1172
1173 <programlisting>[Match]
1174 Name=em1
1175
1176 [Network]
1177 Tunnel=vti-tun</programlisting>
1178 </example>
1179
1180 <example>
1181 <title>/etc/systemd/network/25-bond.network</title>
1182
1183 <programlisting>[Match]
1184 Name=bond1
1185
1186 [Network]
1187 DHCP=yes
1188 </programlisting>
1189 </example>
1190
1191 </refsect1>
1192
1193 <refsect1>
1194 <title>See Also</title>
1195 <para>
1196 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1197 <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
1198 <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1199 <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1200 <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
1201 </para>
1202 </refsect1>
1203
1204 </refentry>