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