]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/networkd.conf.xml
network/dhcp-server: introduce PersistLeases= setting
[thirdparty/systemd.git] / man / networkd.conf.xml
CommitLineData
514094f9 1<?xml version='1.0'?>
3a54a157 2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
eea10b26 3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
413708d1
VK
4
5<!--
db9ecf05 6 SPDX-License-Identifier: LGPL-2.1-or-later
572eb058 7
96b2fb93 8 Copyright © 2014 Vinay Kulkarni
413708d1
VK
9-->
10
11<refentry id="networkd.conf" conditional='ENABLE_NETWORKD'
12 xmlns:xi="http://www.w3.org/2001/XInclude">
13 <refentryinfo>
14 <title>networkd.conf</title>
15 <productname>systemd</productname>
413708d1
VK
16 </refentryinfo>
17
18 <refmeta>
19 <refentrytitle>networkd.conf</refentrytitle>
20 <manvolnum>5</manvolnum>
21 </refmeta>
22
23 <refnamediv>
24 <refname>networkd.conf</refname>
25 <refname>networkd.conf.d</refname>
26 <refpurpose>Global Network configuration files</refpurpose>
27 </refnamediv>
28
29 <refsynopsisdiv>
73e97bb0
ZJS
30 <para><simplelist>
31 <member><filename>/etc/systemd/networkd.conf</filename></member>
b83a59f8
ZJS
32 <member><filename>/run/systemd/networkd.conf</filename></member>
33 <member><filename>/usr/lib/systemd/networkd.conf</filename></member>
73e97bb0
ZJS
34 <member><filename>/etc/systemd/networkd.conf.d/*.conf</filename></member>
35 <member><filename>/usr/lib/systemd/networkd.conf.d/*.conf</filename></member>
36 </simplelist></para>
413708d1
VK
37 </refsynopsisdiv>
38
39 <refsect1>
40 <title>Description</title>
41
8835a6ff 42 <para>These configuration files control global network parameters.</para>
413708d1
VK
43 </refsect1>
44
45 <xi:include href="standard-conf.xml" xpointer="main-conf" />
46
c9fdaed0
YW
47 <refsect1>
48 <title>[Network] Section Options</title>
49
bdac5608 50 <para>The following options are available in the [Network] section:</para>
c9fdaed0
YW
51
52 <variablelist class='network-directives'>
53 <varlistentry>
54 <term><varname>SpeedMeter=</varname></term>
55 <listitem><para>Takes a boolean. If set to yes, then <command>systemd-networkd</command>
56 measures the traffic of each interface, and
d91b9bbc 57 <command>networkctl status <replaceable>INTERFACE</replaceable></command> shows the measured speed.
ec07c3c8
AK
58 Defaults to no.</para>
59
60 <xi:include href="version-info.xml" xpointer="v244"/></listitem>
c9fdaed0
YW
61 </varlistentry>
62
63 <varlistentry>
64 <term><varname>SpeedMeterIntervalSec=</varname></term>
65 <listitem><para>Specifies the time interval to calculate the traffic speed of each interface.
ec07c3c8
AK
66 If <varname>SpeedMeter=no</varname>, the value is ignored. Defaults to 10sec.</para>
67
68 <xi:include href="version-info.xml" xpointer="v244"/></listitem>
c9fdaed0 69 </varlistentry>
5d3b8017 70
d94dfe70
YW
71 <varlistentry>
72 <term><varname>ManageForeignRoutingPolicyRules=</varname></term>
73 <listitem><para>A boolean. When true, <command>systemd-networkd</command> will remove rules
74 that are not configured in .network files (except for rules with protocol
75 <literal>kernel</literal>). When false, it will not remove any foreign rules, keeping them even
76 if they are not configured in a .network file. Defaults to yes.
ec07c3c8
AK
77 </para>
78
79 <xi:include href="version-info.xml" xpointer="v249"/></listitem>
d94dfe70
YW
80 </varlistentry>
81
5d3b8017
SS
82 <varlistentry>
83 <term><varname>ManageForeignRoutes=</varname></term>
3fe23a96
YW
84 <listitem><para>A boolean. When true, <command>systemd-networkd</command> will remove routes
85 that are not configured in .network files (except for routes with protocol
86 <literal>kernel</literal>, <literal>dhcp</literal> when <varname>KeepConfiguration=</varname>
87 is true or <literal>dhcp</literal>, and <literal>static</literal> when
88 <varname>KeepConfiguration=</varname> is true or <literal>static</literal>). When false, it will
89 not remove any foreign routes, keeping them even if they are not configured in a .network file.
ec07c3c8
AK
90 Defaults to yes.</para>
91
92 <xi:include href="version-info.xml" xpointer="v246"/></listitem>
5d3b8017
SS
93 </varlistentry>
94
bbc05bec
YW
95 <varlistentry>
96 <term><varname>ManageForeignNextHops=</varname></term>
97 <listitem><para>A boolean. When true, <command>systemd-networkd</command> will remove nexthops
98 that are not configured in .network files (except for routes with protocol
99 <literal>kernel</literal>). When false, it will
100 not remove any foreign nexthops, keeping them even if they are not configured in a .network file.
101 Defaults to yes.</para>
102
103 <xi:include href="version-info.xml" xpointer="v256"/></listitem>
104 </varlistentry>
105
c038ce46
SS
106 <varlistentry>
107 <term><varname>RouteTable=</varname></term>
310eff72
YW
108 <listitem><para>Defines the route table name. Takes a whitespace-separated list of the pairs of
109 route table name and number. The route table name and number in each pair are separated with a
110 colon, i.e., <literal><replaceable>name</replaceable>:<replaceable>number</replaceable></literal>.
111 The route table name must not be <literal>default</literal>, <literal>main</literal>, or
112 <literal>local</literal>, as these route table names are predefined with route table number 253,
e8e91a81
YW
113 254, and 255, respectively. The route table number must be an integer in the range 1…4294967295,
114 except for predefined numbers 253, 254, and 255. This setting can be specified multiple times.
115 If an empty string is specified, then the list specified earlier are cleared. Defaults to unset.
ec07c3c8
AK
116 </para>
117
118 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
c038ce46
SS
119 </varlistentry>
120
3976c430
YW
121 <varlistentry>
122 <term><varname>IPv4Forwarding=</varname></term>
123 <listitem>
124 <para>Configures IPv4 packet forwarding for the system. Takes a boolean value. This controls the
125 <filename>net.ipv4.conf.default.forwarding</filename> and
126 <filename>net.ipv4.conf.all.forwarding</filename>sysctl options. See
127 <ulink url="https://docs.kernel.org/networking/ip-sysctl.html">IP Sysctl</ulink>
128 for more details about the sysctl options. Defaults to unset and the sysctl options will not be
129 changed.</para>
130
131 <xi:include href="version-info.xml" xpointer="v256"/>
132 </listitem>
133 </varlistentry>
134
135 <varlistentry>
136 <term><varname>IPv6Forwarding=</varname></term>
137 <listitem>
138 <para>Configures IPv6 packet forwarding for the system. Takes a boolean value. This controls the
139 <filename>net.ipv6.conf.default.forwarding</filename> and
140 <filename>net.ipv6.conf.all.forwarding</filename> sysctl options. See
141 <ulink url="https://docs.kernel.org/networking/ip-sysctl.html">IP Sysctl</ulink>
142 for more details about the sysctl options. Defaults to unset and the sysctl options will not be
143 changed.</para>
144
145 <xi:include href="version-info.xml" xpointer="v256"/>
146 </listitem>
147 </varlistentry>
148
932ef6ec
YW
149 <varlistentry>
150 <term><varname>IPv6PrivacyExtensions=</varname></term>
151 <listitem>
152 <para>Specifies the default value for per-network <varname>IPv6PrivacyExtensions=</varname>.
153 Takes a boolean or the special values <literal>prefer-public</literal> and
154 <literal>kernel</literal>. See for details in
155 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
156 Defaults to <literal>no</literal>.</para>
ec07c3c8
AK
157
158 <xi:include href="version-info.xml" xpointer="v254"/>
932ef6ec
YW
159 </listitem>
160 </varlistentry>
c9fdaed0
YW
161 </variablelist>
162 </refsect1>
163
413708d1 164 <refsect1>
4e26a5ba
YW
165 <title>[DHCPv4] Section Options</title>
166
167 <para>This section configures the DHCP Unique Identifier (DUID) value used by DHCP protocol. DHCPv4
168 client protocol sends IAID and DUID to the DHCP server when acquiring a dynamic IPv4 address if
169 <option>ClientIdentifier=duid</option>. IAID and DUID allows a DHCP server to uniquely identify the
170 machine and the interface requesting a DHCP IP address. To configure IAID and ClientIdentifier, see
e2e08e77
ZJS
171 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
172 </para>
413708d1 173
e2e08e77 174 <para>The following options are understood:</para>
413708d1
VK
175
176 <variablelist class='network-directives'>
e2e08e77
ZJS
177 <varlistentry>
178 <term><varname>DUIDType=</varname></term>
179 <listitem><para>Specifies how the DUID should be generated. See
180 <ulink url="https://tools.ietf.org/html/rfc3315#section-9">RFC 3315</ulink>
181 for a description of all the options.</para>
182
80500bb5 183 <para>This takes an integer in the range 0…65535, or one of the following string values:
e2e08e77
ZJS
184 <variablelist>
185 <varlistentry>
319b94bc 186 <term><option>vendor</option></term>
e2e08e77
ZJS
187 <listitem><para>If <literal>DUIDType=vendor</literal>, then the DUID value will be generated using
188 <literal>43793</literal> as the vendor identifier (systemd) and hashed contents of
189 <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
190 This is the default if <varname>DUIDType=</varname> is not specified.
aefdc112
AK
191 </para>
192
193 <xi:include href="version-info.xml" xpointer="v230"/></listitem>
e2e08e77
ZJS
194 </varlistentry>
195
196 <varlistentry>
319b94bc
YW
197 <term><option>uuid</option></term>
198 <listitem><para>If <literal>DUIDType=uuid</literal>, and <varname>DUIDRawData=</varname> is not set,
199 then the product UUID is used as a DUID value. If a system does not have valid product UUID, then
200 an application-specific
201 <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>
202 is used as a DUID value. About the application-specific machine ID, see
203 <citerefentry><refentrytitle>sd_id128_get_machine_app_specific</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
aefdc112
AK
204 </para>
205
206 <xi:include href="version-info.xml" xpointer="v230"/></listitem>
319b94bc
YW
207 </varlistentry>
208
209 <varlistentry>
8fa266c2 210 <term><option>link-layer-time[:<replaceable>TIME</replaceable>]</option></term>
319b94bc 211 <term><option>link-layer</option></term>
8fa266c2
YW
212 <listitem><para>If <literal>link-layer-time</literal> or <literal>link-layer</literal> is specified,
213 then the MAC address of the interface is used as a DUID value. The value <literal>link-layer-time</literal>
214 can take additional time value after a colon, e.g. <literal>link-layer-time:2018-01-23 12:34:56 UTC</literal>.
215 The default time value is <literal>2000-01-01 00:00:00 UTC</literal>.
aefdc112
AK
216 </para>
217
218 <xi:include href="version-info.xml" xpointer="v240"/></listitem>
e2e08e77
ZJS
219 </varlistentry>
220 </variablelist>
221 </para>
222
223 <para>In all cases, <varname>DUIDRawData=</varname> can be used to override the
aefdc112
AK
224 actual DUID value that is used.</para>
225
226 <xi:include href="version-info.xml" xpointer="v230"/></listitem>
e2e08e77 227 </varlistentry>
413708d1 228
413708d1 229 <varlistentry>
e2e08e77
ZJS
230 <term><varname>DUIDRawData=</varname></term>
231 <listitem><para>Specifies the DHCP DUID value as a single newline-terminated, hexadecimal string, with each
232 byte separated by <literal>:</literal>. The DUID that is sent is composed of the DUID type specified by
233 <varname>DUIDType=</varname> and the value configured here.</para>
234
319b94bc
YW
235 <para>The DUID value specified here overrides the DUID that
236 <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
237 generates from the machine ID. To configure DUID per-network, see
2ac5fe95 238 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
e2e08e77
ZJS
239 The configured DHCP DUID should conform to the specification in
240 <ulink url="http://tools.ietf.org/html/rfc3315#section-9">RFC 3315</ulink>,
241 <ulink url="http://tools.ietf.org/html/rfc6355">RFC 6355</ulink>. To configure IAID, see
242 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum>
243 </citerefentry>.</para>
244
245 <example>
246 <title>A <option>DUIDType=vendor</option> with a custom value</title>
247
248 <programlisting>DUIDType=vendor
249DUIDRawData=00:00:ab:11:f9:2a:c2:77:29:f9:5c:00</programlisting>
250
251 <para>This specifies a 14 byte DUID, with the type DUID-EN (<literal>00:02</literal>), enterprise number
252 43793 (<literal>00:00:ab:11</literal>), and identifier value <literal>f9:2a:c2:77:29:f9:5c:00</literal>.
253 </para>
254 </example>
aefdc112
AK
255
256 <xi:include href="version-info.xml" xpointer="v230"/>
e2e08e77 257 </listitem>
413708d1
VK
258 </varlistentry>
259 </variablelist>
260 </refsect1>
261
4e26a5ba
YW
262 <refsect1>
263 <title>[DHCPv6] Section Options</title>
264
265 <para>This section configures the DHCP Unique Identifier (DUID) value used by DHCPv6 protocol.
266 DHCPv6 client protocol sends the DHCP Unique Identifier and the interface Identity Association
267 Identifier (IAID) to a DHCPv6 server when acquiring a dynamic IPv6 address. IAID and DUID allows a
268 DHCPv6 server to uniquely identify the machine and the interface requesting a DHCP IP address. To
269 configure IAID, see
270 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
271 </para>
272
273 <para>The following options are understood:</para>
274
275 <variablelist class='network-directives'>
276 <varlistentry>
277 <term><varname>DUIDType=</varname></term>
278 <term><varname>DUIDRawData=</varname></term>
ec07c3c8
AK
279 <listitem><para>As in the [DHCPv4] section.</para>
280
281 <xi:include href="version-info.xml" xpointer="v249"/></listitem>
4e26a5ba
YW
282 </varlistentry>
283 </variablelist>
284 </refsect1>
285
a3ed665a
YW
286 <refsect1>
287 <title>[DHCPServer] Section Options</title>
288
289 <para>This section configures the default setting of the DHCP server. The following options are available
290 in the [DHCPServer] section:</para>
291
292 <variablelist class='network-directives'>
293 <varlistentry>
294 <term><varname>PersistLeases=</varname></term>
295 <listitem>
296 <para>Specifies the default value for per-network <varname>PersistLeases=</varname>.
297 Takes a boolean. See for details in
298 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
299 Defaults to <literal>yes</literal>.</para>
300
301 <xi:include href="version-info.xml" xpointer="v256"/>
302 </listitem>
303 </varlistentry>
304 </variablelist>
305 </refsect1>
306
413708d1
VK
307 <refsect1>
308 <title>See Also</title>
13a69c12
DT
309 <para><simplelist type="inline">
310 <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
311 <member><citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
312 <member><citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
313 <member><citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
314 <member><citerefentry><refentrytitle>sd_id128_get_machine_app_specific</refentrytitle><manvolnum>3</manvolnum></citerefentry></member>
315 </simplelist></para>
413708d1
VK
316 </refsect1>
317
318</refentry>