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