]>
Commit | Line | Data |
---|---|---|
eac684ef TG |
1 | <?xml version='1.0'?> <!--*-nxml-*--> |
2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" | |
681eb9cf FB |
3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ |
4 | <!ENTITY % entities SYSTEM "custom-entities.ent" > | |
5 | %entities; | |
6 | ]> | |
eac684ef TG |
7 | |
8 | <!-- | |
9 | This file is part of systemd. | |
10 | ||
11 | Copyright 2013 Tom Gundersen | |
12 | ||
13 | systemd is free software; you can redistribute it and/or modify it | |
14 | under the terms of the GNU Lesser General Public License as published by | |
15 | the Free Software Foundation; either version 2.1 of the License, or | |
16 | (at your option) any later version. | |
17 | ||
18 | systemd is distributed in the hope that it will be useful, but | |
19 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
21 | Lesser General Public License for more details. | |
22 | ||
23 | You should have received a copy of the GNU Lesser General Public License | |
24 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
25 | --> | |
26 | ||
27 | <refentry id="systemd.network" conditional='ENABLE_NETWORKD'> | |
28 | ||
798d3a52 ZJS |
29 | <refentryinfo> |
30 | <title>systemd.network</title> | |
31 | <productname>systemd</productname> | |
32 | ||
33 | <authorgroup> | |
34 | <author> | |
35 | <contrib>Developer</contrib> | |
36 | <firstname>Tom</firstname> | |
37 | <surname>Gundersen</surname> | |
38 | <email>teg@jklm.no</email> | |
39 | </author> | |
40 | </authorgroup> | |
41 | </refentryinfo> | |
42 | ||
43 | <refmeta> | |
44 | <refentrytitle>systemd.network</refentrytitle> | |
45 | <manvolnum>5</manvolnum> | |
46 | </refmeta> | |
47 | ||
48 | <refnamediv> | |
49 | <refname>systemd.network</refname> | |
50 | <refpurpose>Network configuration</refpurpose> | |
51 | </refnamediv> | |
52 | ||
53 | <refsynopsisdiv> | |
54 | <para><filename><replaceable>network</replaceable>.network</filename></para> | |
55 | </refsynopsisdiv> | |
56 | ||
57 | <refsect1> | |
58 | <title>Description</title> | |
59 | ||
60 | <para>Network setup is performed by | |
61 | <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>. | |
62 | </para> | |
63 | ||
64 | <para>Network files must have the extension | |
65 | <filename>.network</filename>; other extensions are ignored. | |
66 | Networks are applied to links whenever the links appear.</para> | |
67 | ||
68 | <para>The <filename>.network</filename> files are read from the | |
69 | files located in the system network directory | |
681eb9cf | 70 | <filename>&rootlibexecdir;/network</filename>, the volatile |
798d3a52 ZJS |
71 | runtime network directory |
72 | <filename>/run/systemd/network</filename> and the local | |
73 | administration network directory | |
681eb9cf | 74 | <filename>&pkgsysconfdir;/network</filename>. All configuration files |
798d3a52 ZJS |
75 | are collectively sorted and processed in lexical order, regardless |
76 | of the directories in which they live. However, files with | |
77 | identical filenames replace each other. Files in | |
78 | <filename>/etc</filename> have the highest priority, files in | |
79 | <filename>/run</filename> take precedence over files with the same | |
7d2e33a4 | 80 | name in <filename>&rootprefix;/lib</filename>. This can be used to |
798d3a52 ZJS |
81 | override a system-supplied configuration file with a local file if |
82 | needed; a symlink in <filename>/etc</filename> with the same name | |
7d2e33a4 | 83 | as a configuration file in <filename>&rootprefix;/lib</filename>, pointing |
798d3a52 ZJS |
84 | to <filename>/dev/null</filename>, disables the configuration file |
85 | entirely.</para> | |
86 | ||
87 | </refsect1> | |
88 | ||
89 | <refsect1> | |
90 | <title>[Match] Section Options</title> | |
91 | ||
92 | <para>The network file contains a <literal>[Match]</literal> | |
93 | section, which determines if a given network file may be applied | |
94 | to a given device; and a <literal>[Network]</literal> section | |
95 | specifying how the device should be configured. The first (in | |
96 | lexical order) of the network files that matches a given device | |
a22e1850 LP |
97 | is applied, all later files are ignored, even if they match as |
98 | well.</para> | |
798d3a52 ZJS |
99 | |
100 | <para>A network file is said to match a device if each of the | |
101 | entries in the <literal>[Match]</literal> section matches, or if | |
102 | the section is empty. The following keys are accepted:</para> | |
103 | ||
104 | <variablelist class='network-directives'> | |
105 | <varlistentry> | |
106 | <term><varname>MACAddress=</varname></term> | |
107 | <listitem> | |
108 | <para>The hardware address.</para> | |
109 | </listitem> | |
110 | </varlistentry> | |
111 | <varlistentry> | |
112 | <term><varname>Path=</varname></term> | |
113 | <listitem> | |
5256e00e TG |
114 | <para>A whitespace-separated list of shell-style globs |
115 | matching the persistent path, as exposed by the udev | |
116 | property <literal>ID_PATH</literal>.</para> | |
798d3a52 ZJS |
117 | </listitem> |
118 | </varlistentry> | |
119 | <varlistentry> | |
120 | <term><varname>Driver=</varname></term> | |
121 | <listitem> | |
5256e00e TG |
122 | <para>A whitespace-separated list of shell-style globs |
123 | matching the driver currently bound to the device, as | |
798d3a52 ZJS |
124 | exposed by the udev property <literal>DRIVER</literal> |
125 | of its parent device, or if that is not set the driver | |
126 | as exposed by <literal>ethtool -i</literal> of the | |
127 | device itself.</para> | |
128 | </listitem> | |
129 | </varlistentry> | |
130 | <varlistentry> | |
131 | <term><varname>Type=</varname></term> | |
132 | <listitem> | |
5256e00e TG |
133 | <para>A whitespace-separated list of shell-style globs |
134 | matching the device type, as exposed by the udev property | |
798d3a52 ZJS |
135 | <literal>DEVTYPE</literal>.</para> |
136 | </listitem> | |
137 | </varlistentry> | |
138 | <varlistentry> | |
139 | <term><varname>Name=</varname></term> | |
140 | <listitem> | |
5256e00e TG |
141 | <para>A whitespace-separated list of shell-style globs |
142 | matching the device name, as exposed by the udev property | |
143 | <literal>INTERFACE</literal>.</para> | |
798d3a52 ZJS |
144 | </listitem> |
145 | </varlistentry> | |
146 | <varlistentry> | |
147 | <term><varname>Host=</varname></term> | |
148 | <listitem> | |
149 | <para>Matches against the hostname or machine ID of the | |
150 | host. See <literal>ConditionHost=</literal> in | |
151 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
152 | for details. | |
153 | </para> | |
154 | </listitem> | |
155 | </varlistentry> | |
156 | <varlistentry> | |
157 | <term><varname>Virtualization=</varname></term> | |
158 | <listitem> | |
159 | <para>Checks whether the system is executed in a virtualized | |
160 | environment and optionally test whether it is a specific | |
161 | implementation. See <literal>ConditionVirtualization=</literal> in | |
162 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
163 | for details. | |
164 | </para> | |
165 | </listitem> | |
166 | </varlistentry> | |
167 | <varlistentry> | |
168 | <term><varname>KernelCommandLine=</varname></term> | |
169 | <listitem> | |
170 | <para>Checks whether a specific kernel command line option is | |
171 | set (or if prefixed with the exclamation mark unset). See | |
172 | <literal>ConditionKernelCommandLine=</literal> in | |
173 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
174 | for details. | |
175 | </para> | |
176 | </listitem> | |
177 | </varlistentry> | |
178 | <varlistentry> | |
179 | <term><varname>Architecture=</varname></term> | |
180 | <listitem> | |
181 | <para>Checks whether the system is running on a specific | |
182 | architecture. See <literal>ConditionArchitecture=</literal> in | |
183 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
184 | for details. | |
185 | </para> | |
186 | </listitem> | |
187 | </varlistentry> | |
188 | </variablelist> | |
189 | ||
190 | </refsect1> | |
191 | ||
192 | <refsect1> | |
193 | <title>[Link] Section Options</title> | |
194 | ||
195 | <para> The <literal>[Link]</literal> section accepts the following keys:</para> | |
196 | ||
197 | <variablelist class='network-directives'> | |
198 | <varlistentry> | |
199 | <term><varname>MACAddress=</varname></term> | |
200 | <listitem> | |
201 | <para>The hardware address.</para> | |
202 | </listitem> | |
203 | </varlistentry> | |
204 | <varlistentry> | |
205 | <term><varname>MTUBytes=</varname></term> | |
206 | <listitem> | |
207 | <para>The maximum transmission unit in bytes to set for the | |
208 | device. The usual suffixes K, M, G, are supported and are | |
209 | understood to the base of 1024.</para> | |
210 | </listitem> | |
211 | </varlistentry> | |
212 | </variablelist> | |
213 | </refsect1> | |
214 | ||
215 | <refsect1> | |
216 | <title>[Network] Section Options</title> | |
217 | ||
218 | <para>The <literal>[Network]</literal> section accepts the following keys:</para> | |
219 | ||
220 | <variablelist class='network-directives'> | |
221 | <varlistentry> | |
222 | <term><varname>Description=</varname></term> | |
223 | <listitem> | |
224 | <para>A description of the device. This is only used for | |
225 | presentation purposes.</para> | |
226 | </listitem> | |
227 | </varlistentry> | |
228 | <varlistentry> | |
229 | <term><varname>DHCP=</varname></term> | |
230 | <listitem> | |
231 | <para>Enables DHCPv4 and/or DHCPv6 support. Accepts | |
232 | <literal>yes</literal>, <literal>no</literal>, | |
233 | <literal>ipv4</literal>, or <literal>ipv6</literal>.</para> | |
e88d8021 ZJS |
234 | |
235 | <para>Please note that by default the domain name | |
236 | specified through DHCP is not used for name resolution. | |
237 | See option <option>UseDomains=</option> below.</para> | |
798d3a52 ZJS |
238 | </listitem> |
239 | </varlistentry> | |
240 | <varlistentry> | |
241 | <term><varname>DHCPServer=</varname></term> | |
242 | <listitem> | |
243 | <para>A boolean. Enables a basic DHCPv4 server on the | |
244 | device. Mostly useful for handing out leases to container | |
245 | instances.</para> | |
246 | </listitem> | |
247 | </varlistentry> | |
248 | <varlistentry> | |
56fd6bf7 | 249 | <term><varname>LinkLocalAddressing=</varname></term> |
798d3a52 | 250 | <listitem> |
d0d6a4cd TG |
251 | <para>Enables link-local address autoconfiguration. Accepts |
252 | <literal>yes</literal>, <literal>no</literal>, | |
253 | <literal>ipv4</literal>, or <literal>ipv6</literal>. Defaults to | |
254 | <literal>ipv6</literal>.</para> | |
798d3a52 ZJS |
255 | </listitem> |
256 | </varlistentry> | |
257 | <varlistentry> | |
258 | <term><varname>IPv4LLRoute=</varname></term> | |
259 | <listitem> | |
260 | <para>A boolean. When true, sets up the route needed for | |
261 | non-IPv4LL hosts to communicate with IPv4LL-only hosts. Defaults | |
262 | to false. | |
263 | </para> | |
264 | </listitem> | |
265 | </varlistentry> | |
266 | <varlistentry> | |
113bfde1 TG |
267 | <term><varname>IPv6Token=</varname></term> |
268 | <listitem> | |
269 | <para>An IPv6 address with the top 64 bits unset. When set, indicates the | |
270 | 64 bits interface part of SLAAC IPv6 addresses for this link. By default | |
271 | it is autogenerated.</para> | |
272 | </listitem> | |
273 | </varlistentry> | |
274 | <varlistentry> | |
798d3a52 ZJS |
275 | <term><varname>LLMNR=</varname></term> |
276 | <listitem> | |
277 | <para>A boolean or <literal>resolve</literal>. When true, enables | |
278 | Link-Local Multicast Name Resolution on the link, when set to | |
279 | <literal>resolve</literal> only resolution is enabled, but not | |
280 | announcement. Defaults to true.</para> | |
281 | </listitem> | |
282 | </varlistentry> | |
283 | <varlistentry> | |
284 | <term><varname>LLDP=</varname></term> | |
285 | <listitem> | |
286 | <para>A boolean. When true, enables LLDP link receive support. | |
287 | </para> | |
288 | </listitem> | |
289 | </varlistentry> | |
0d4ad91d AR |
290 | <varlistentry> |
291 | <term><varname>BindCarrier=</varname></term> | |
292 | <listitem> | |
293 | <para>A port or a list of ports. When set, controls the | |
294 | behaviour of the current interface. When all ports in the list | |
295 | are in an operational down state, the current interface is brought | |
296 | down. When at least one port has carrier, the current interface | |
297 | is brought up. | |
298 | </para> | |
299 | </listitem> | |
300 | </varlistentry> | |
798d3a52 ZJS |
301 | <varlistentry> |
302 | <term><varname>Address=</varname></term> | |
303 | <listitem> | |
304 | <para>A static IPv4 or IPv6 address and its prefix length, | |
305 | separated by a <literal>/</literal> character. Specify | |
306 | this key more than once to configure several addresses. | |
307 | The format of the address must be as described in | |
3ba3a79d | 308 | <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>. |
798d3a52 ZJS |
309 | This is a short-hand for an [Address] section only |
310 | containing an Address key (see below). This option may be | |
311 | specified more than once. | |
312 | </para> | |
313 | ||
314 | <para>If the specified address is 0.0.0.0 (for IPv4) or | |
315 | [::] (for IPv6), a new address range of the requested size | |
316 | is automatically allocated from a system-wide pool of | |
317 | unused ranges. The allocated range is checked against all | |
318 | current network interfaces and all known network | |
319 | configuration files to avoid address range conflicts. The | |
320 | default system-wide pool consists of 192.168.0.0/16, | |
321 | 172.16.0.0/12 and 10.0.0.0/8 for IPv4, and fc00::/7 for | |
322 | IPv6. This functionality is useful to manage a large | |
323 | number of dynamically created network interfaces with the | |
324 | same network configuration and automatic address range | |
325 | assignment.</para> | |
326 | ||
327 | </listitem> | |
328 | </varlistentry> | |
329 | <varlistentry> | |
330 | <term><varname>Gateway=</varname></term> | |
331 | <listitem> | |
332 | <para>The gateway address, which must be in the format | |
333 | described in | |
3ba3a79d | 334 | <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>. |
798d3a52 ZJS |
335 | This is a short-hand for a [Route] section only containing |
336 | a Gateway key. This option may be specified more than | |
337 | once.</para> | |
338 | </listitem> | |
339 | </varlistentry> | |
340 | <varlistentry> | |
341 | <term><varname>DNS=</varname></term> | |
342 | <listitem> | |
343 | <para>A DNS server address, which must be in the format | |
344 | described in | |
3ba3a79d | 345 | <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>. |
798d3a52 ZJS |
346 | This option may be specified more than once.</para> |
347 | </listitem> | |
348 | </varlistentry> | |
349 | <varlistentry> | |
350 | <term><varname>Domains=</varname></term> | |
351 | <listitem> | |
352 | <para>The domains used for DNS resolution over this link.</para> | |
353 | </listitem> | |
354 | </varlistentry> | |
355 | <varlistentry> | |
356 | <term><varname>NTP=</varname></term> | |
357 | <listitem> | |
358 | <para>An NTP server address. This option may be specified more than once.</para> | |
359 | </listitem> | |
360 | </varlistentry> | |
361 | <varlistentry> | |
362 | <term><varname>IPForward=</varname></term> | |
363 | <listitem><para>Configures IP forwarding for the network | |
364 | interface. If enabled incoming packets on the network | |
365 | interface will be forwarded to other interfaces according to | |
366 | the routing table. Takes either a boolean argument, or the | |
367 | values <literal>ipv4</literal> or <literal>ipv6</literal>, | |
368 | which only enables IP forwarding for the specified address | |
2972cba1 NO |
369 | family, or <literal>kernel</literal>, which preserves existing sysctl settings. |
370 | This controls the | |
4046d836 LP |
371 | <filename>net.ipv4.conf.<interface>.forwarding</filename> |
372 | and | |
373 | <filename>net.ipv6.conf.<interface>.forwarding</filename> | |
374 | sysctl options of the network interface (see <ulink | |
375 | url="https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt">ip-sysctl.txt</ulink> | |
376 | for details about sysctl options). Defaults to | |
377 | <literal>no</literal>.</para> | |
378 | ||
2972cba1 NO |
379 | <para>Note: unless this option is turned on, or set to <literal>kernel</literal>, |
380 | no IP forwarding is done on this interface, even if this is | |
4046d836 LP |
381 | globally turned on in the kernel, with the |
382 | <filename>net.ipv4.ip_forward</filename> and | |
383 | <filename>net.ipv4.ip_forward</filename> sysctl | |
505c5f6d | 384 | options.</para> |
4046d836 | 385 | </listitem> |
798d3a52 ZJS |
386 | </varlistentry> |
387 | <varlistentry> | |
388 | <term><varname>IPMasquerade=</varname></term> | |
389 | <listitem><para>Configures IP masquerading for the network | |
390 | interface. If enabled packets forwarded from the network | |
391 | interface will be appear as coming from the local host. | |
392 | Takes a boolean argument. Implies | |
5c82dd13 | 393 | <varname>IPForward=ipv4</varname>. Defaults to |
4046d836 | 394 | <literal>no</literal>.</para></listitem> |
798d3a52 ZJS |
395 | </varlistentry> |
396 | <varlistentry> | |
397 | <term><varname>Bridge=</varname></term> | |
398 | <listitem> | |
399 | <para>The name of the bridge to add the link to.</para> | |
400 | </listitem> | |
401 | </varlistentry> | |
402 | <varlistentry> | |
403 | <term><varname>Bond=</varname></term> | |
404 | <listitem> | |
405 | <para>The name of the bond to add the link to.</para> | |
406 | </listitem> | |
407 | </varlistentry> | |
408 | <varlistentry> | |
409 | <term><varname>VLAN=</varname></term> | |
410 | <listitem> | |
411 | <para>The name of a VLAN to create on the link. This | |
412 | option may be specified more than once.</para> | |
413 | </listitem> | |
414 | </varlistentry> | |
415 | <varlistentry> | |
416 | <term><varname>MACVLAN=</varname></term> | |
417 | <listitem> | |
418 | <para>The name of a MACVLAN to create on the link. This | |
419 | option may be specified more than once.</para> | |
420 | </listitem> | |
421 | </varlistentry> | |
422 | <varlistentry> | |
423 | <term><varname>VXLAN=</varname></term> | |
424 | <listitem> | |
425 | <para>The name of a VXLAN to create on the link. This | |
426 | option may be specified more than once.</para> | |
427 | </listitem> | |
428 | </varlistentry> | |
429 | <varlistentry> | |
430 | <term><varname>Tunnel=</varname></term> | |
431 | <listitem> | |
432 | <para>The name of a Tunnel to create on the link. This | |
433 | option may be specified more than once.</para> | |
434 | </listitem> | |
435 | </varlistentry> | |
436 | </variablelist> | |
437 | ||
438 | </refsect1> | |
439 | ||
440 | <refsect1> | |
441 | <title>[Address] Section Options</title> | |
442 | ||
443 | <para>An <literal>[Address]</literal> section accepts the | |
444 | following keys. Specify several <literal>[Address]</literal> | |
445 | sections to configure several addresses.</para> | |
446 | ||
447 | <variablelist class='network-directives'> | |
448 | <varlistentry> | |
449 | <term><varname>Address=</varname></term> | |
450 | <listitem> | |
451 | <para>As in the <literal>[Network]</literal> section. This | |
452 | key is mandatory.</para> | |
453 | </listitem> | |
454 | </varlistentry> | |
455 | <varlistentry> | |
456 | <term><varname>Peer=</varname></term> | |
457 | <listitem> | |
458 | <para>The peer address in a point-to-point connection. | |
459 | Accepts the same format as the <literal>Address</literal> | |
460 | key.</para> | |
461 | </listitem> | |
462 | </varlistentry> | |
463 | <varlistentry> | |
464 | <term><varname>Broadcast=</varname></term> | |
465 | <listitem> | |
466 | <para>The broadcast address, which must be in the format | |
467 | described in | |
3ba3a79d | 468 | <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>. |
798d3a52 ZJS |
469 | This key only applies to IPv4 addresses. If it is not |
470 | given, it is derived from the <literal>Address</literal> | |
471 | key.</para> | |
472 | </listitem> | |
473 | </varlistentry> | |
474 | <varlistentry> | |
475 | <term><varname>Label=</varname></term> | |
476 | <listitem> | |
477 | <para>An address label.</para> | |
478 | </listitem> | |
479 | </varlistentry> | |
480 | </variablelist> | |
481 | </refsect1> | |
482 | ||
483 | <refsect1> | |
484 | <title>[Route] Section Options</title> | |
485 | <para>The <literal>[Route]</literal> section accepts the | |
486 | following keys. Specify several <literal>[Route]</literal> | |
487 | sections to configure several routes.</para> | |
488 | ||
489 | <variablelist class='network-directives'> | |
490 | <varlistentry> | |
491 | <term><varname>Gateway=</varname></term> | |
492 | <listitem> | |
493 | <para>As in the <literal>[Network]</literal> section.</para> | |
494 | </listitem> | |
495 | </varlistentry> | |
496 | <varlistentry> | |
497 | <term><varname>Destination=</varname></term> | |
498 | <listitem> | |
499 | <para>The destination prefix of the route. Possibly | |
500 | followed by a slash and the prefixlength. If omitted, a | |
501 | full-length host route is assumed.</para> | |
502 | </listitem> | |
503 | </varlistentry> | |
504 | <varlistentry> | |
505 | <term><varname>Source=</varname></term> | |
506 | <listitem> | |
507 | <para>The source prefix of the route. Possibly followed by | |
508 | a slash and the prefixlength. If omitted, a full-length | |
509 | host route is assumed.</para> | |
510 | </listitem> | |
511 | </varlistentry> | |
512 | <varlistentry> | |
513 | <term><varname>Metric=</varname></term> | |
514 | <listitem> | |
515 | <para>The metric of the route. An unsigned integer</para> | |
516 | </listitem> | |
517 | </varlistentry> | |
769b56a3 TG |
518 | <varlistentry> |
519 | <term><varname>Scope=</varname></term> | |
520 | <listitem> | |
521 | <para>The scope of the route. One of the values <literal>global</literal>, | |
522 | <literal>link</literal> or <literal>host</literal>. Defaults to | |
523 | <literal>global</literal>.</para> | |
524 | </listitem> | |
525 | </varlistentry> | |
798d3a52 ZJS |
526 | </variablelist> |
527 | </refsect1> | |
528 | ||
529 | <refsect1> | |
530 | <title>[DHCP] Section Options</title> | |
531 | <para>The <literal>[DHCP]</literal> section accepts the following keys:</para> | |
532 | ||
533 | <variablelist class='network-directives'> | |
534 | <varlistentry> | |
535 | <term><varname>UseDNS=</varname></term> | |
536 | <listitem> | |
537 | <para>When true (the default), the DNS servers received | |
538 | from the DHCP server will be used and take precedence over | |
539 | any statically configured ones.</para> | |
e88d8021 ZJS |
540 | |
541 | <para>This corresponds to the <option>nameserver</option> | |
542 | option in <citerefentry project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para> | |
798d3a52 ZJS |
543 | </listitem> |
544 | </varlistentry> | |
301f4073 MM |
545 | <varlistentry> |
546 | <term><varname>UseNTP=</varname></term> | |
547 | <listitem> | |
548 | <para>When true (the default), the NTP servers received | |
549 | from the DHCP server will be used by systemd-timesyncd | |
550 | and take precedence over any statically configured ones.</para> | |
551 | </listitem> | |
552 | </varlistentry> | |
798d3a52 ZJS |
553 | <varlistentry> |
554 | <term><varname>UseMTU=</varname></term> | |
555 | <listitem> | |
556 | <para>When true, the interface maximum transmission unit | |
557 | from the DHCP server will be used on the current link. | |
558 | Defaults to false.</para> | |
559 | </listitem> | |
560 | </varlistentry> | |
561 | <varlistentry> | |
562 | <term><varname>SendHostname=</varname></term> | |
563 | <listitem> | |
564 | <para>When true (the default), the machine's hostname will be sent to the DHCP | |
565 | server</para> | |
566 | </listitem> | |
567 | </varlistentry> | |
568 | <varlistentry> | |
569 | <term><varname>UseHostname=</varname></term> | |
570 | <listitem> | |
571 | <para>When true (the default), the hostname received from | |
572 | the DHCP server will be used as the transient | |
573 | hostname.</para> | |
574 | </listitem> | |
575 | </varlistentry> | |
576 | <varlistentry> | |
577 | <term><varname>UseDomains=</varname></term> | |
578 | <listitem> | |
579 | <para>When true (not the default), the domain name | |
580 | received from the DHCP server will be used for DNS | |
e88d8021 ZJS |
581 | resolution over this link. When a name cannot be resolved |
582 | as specified, the domain name will be used a suffix and | |
583 | name resolution of that will be attempted.</para> | |
584 | ||
585 | <para>This corresponds to the <option>domain</option> | |
586 | option in <citerefentry project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
587 | and should not be enabled on untrusted networks.</para> | |
798d3a52 ZJS |
588 | </listitem> |
589 | </varlistentry> | |
590 | <varlistentry> | |
591 | <term><varname>UseRoutes=</varname></term> | |
592 | <listitem> | |
593 | <para>When true (the default), the static routes will be | |
594 | requested from the DHCP server and added to the routing | |
595 | table with metric of 1024.</para> | |
596 | </listitem> | |
597 | </varlistentry> | |
598 | <varlistentry> | |
599 | <term><varname>CriticalConnection=</varname></term> | |
600 | <listitem> | |
601 | <para>When true, the connection will never be torn down | |
602 | even if the DHCP lease expires. This is contrary to the | |
603 | DHCP specification, but may be the best choice if, say, | |
604 | the root filesystem relies on this connection. Defaults to | |
605 | false.</para> | |
606 | </listitem> | |
607 | </varlistentry> | |
3e43b2cd JJ |
608 | <varlistentry> |
609 | <term><varname>ClientIdentifier=</varname></term> | |
610 | <listitem> | |
611 | <para>DHCP client identifier to use. Either <literal>mac</literal> | |
612 | to use the MAC address of the link or <literal>duid</literal> | |
4a6970c5 | 613 | (the default) to use a RFC4361-compliant Client ID.</para> |
3e43b2cd JJ |
614 | </listitem> |
615 | </varlistentry> | |
798d3a52 ZJS |
616 | <varlistentry> |
617 | <term><varname>VendorClassIdentifier=</varname></term> | |
618 | <listitem> | |
619 | <para>The vendor class identifier used to identify vendor | |
620 | type and configuration.</para> | |
621 | </listitem> | |
622 | </varlistentry> | |
623 | <varlistentry> | |
624 | <term><varname>RequestBroadcast=</varname></term> | |
625 | <listitem> | |
626 | <para>Request the server to use broadcast messages before | |
627 | the IP address has been configured. This is necessary for | |
628 | devices that cannot receive RAW packets, or that cannot | |
629 | receive packets at all before an IP address has been | |
630 | configured. On the other hand, this must not be enabled on | |
631 | networks where broadcasts are filtered out.</para> | |
632 | </listitem> | |
633 | </varlistentry> | |
634 | <varlistentry> | |
635 | <term><varname>RouteMetric=</varname></term> | |
636 | <listitem> | |
637 | <para>Set the routing metric for routes specified by the | |
638 | DHCP server.</para> | |
639 | </listitem> | |
640 | </varlistentry> | |
641 | </variablelist> | |
642 | ||
643 | </refsect1> | |
644 | ||
645 | <refsect1> | |
646 | <title>[Bridge] Section Options</title> | |
647 | <para>The <literal>[Bridge]</literal> section accepts the | |
648 | following keys.</para> | |
649 | <variablelist class='network-directives'> | |
650 | <varlistentry> | |
651 | <term><varname>Cost=</varname></term> | |
652 | <listitem> | |
653 | <para>Each port in a bridge may have different speed. Cost | |
654 | is used to decide which link to use. Faster interfaces | |
655 | should have lower costs</para> | |
656 | </listitem> | |
657 | </varlistentry> | |
658 | </variablelist> | |
659 | </refsect1> | |
660 | ||
661 | <refsect1> | |
662 | <title>[BridgeFDB] Section Options</title> | |
663 | <para>The <literal>[BridgeFDB]</literal> section manages the | |
664 | forwarding database table of a port and accepts the following | |
665 | keys. Specify several <literal>[BridgeFDB]</literal> sections to | |
666 | configure several static MAC table entries.</para> | |
667 | ||
668 | <variablelist class='network-directives'> | |
669 | <varlistentry> | |
670 | <term><varname>MACAddress=</varname></term> | |
671 | <listitem> | |
672 | <para>As in the <literal>[Network]</literal> section. This | |
673 | key is mandatory.</para> | |
674 | </listitem> | |
675 | </varlistentry> | |
676 | <varlistentry> | |
677 | <term><varname>VLANId=</varname></term> | |
678 | <listitem> | |
679 | <para>The VLAN Id for the new static MAC table entry. If | |
680 | omitted, no VLAN Id info is appended to the new static MAC | |
681 | table entry.</para> | |
682 | </listitem> | |
683 | </varlistentry> | |
684 | </variablelist> | |
685 | </refsect1> | |
686 | ||
687 | <refsect1> | |
688 | <title>Example</title> | |
689 | <example> | |
681eb9cf | 690 | <title>&pkgsysconfdir;/network/50-static.network</title> |
798d3a52 ZJS |
691 | |
692 | <programlisting>[Match] | |
eac684ef TG |
693 | Name=enp2s0 |
694 | ||
695 | [Network] | |
696 | Address=192.168.0.15/24 | |
697 | Gateway=192.168.0.1</programlisting> | |
798d3a52 | 698 | </example> |
eac684ef | 699 | |
798d3a52 | 700 | <example> |
681eb9cf | 701 | <title>&pkgsysconfdir;/network/80-dhcp.network</title> |
eac684ef | 702 | |
798d3a52 | 703 | <programlisting>[Match] |
eac684ef TG |
704 | Name=en* |
705 | ||
706 | [Network] | |
9c8ca3f7 | 707 | DHCP=yes</programlisting> |
798d3a52 | 708 | </example> |
eac684ef | 709 | |
798d3a52 | 710 | <example> |
681eb9cf | 711 | <title>&pkgsysconfdir;/network/bridge-static.network</title> |
f47c5c47 | 712 | |
798d3a52 | 713 | <programlisting>[Match] |
f47c5c47 | 714 | Name=bridge0 |
715 | ||
716 | [Network] | |
717 | Address=192.168.0.15/24 | |
718 | Gateway=192.168.0.1 | |
719 | DNS=192.168.0.1</programlisting> | |
798d3a52 | 720 | </example> |
f47c5c47 | 721 | |
798d3a52 | 722 | <example> |
681eb9cf | 723 | <title>&pkgsysconfdir;/network/bridge-slave-interface.network</title> |
f47c5c47 | 724 | |
798d3a52 | 725 | <programlisting>[Match] |
f47c5c47 | 726 | Name=enp2s0 |
727 | ||
728 | [Network] | |
729 | Bridge=bridge0</programlisting> | |
798d3a52 ZJS |
730 | </example> |
731 | <example> | |
681eb9cf | 732 | <title>&pkgsysconfdir;/network/ipip.network</title> |
0a8a0fad | 733 | |
798d3a52 | 734 | <programlisting>[Match] |
0a8a0fad TG |
735 | Name=em1 |
736 | ||
737 | [Network] | |
738 | Tunnel=ipip-tun</programlisting> | |
798d3a52 | 739 | </example> |
0a8a0fad | 740 | |
798d3a52 | 741 | <example> |
681eb9cf | 742 | <title>&pkgsysconfdir;/network/sit.network</title> |
0a8a0fad | 743 | |
798d3a52 | 744 | <programlisting>[Match] |
0a8a0fad TG |
745 | Name=em1 |
746 | ||
747 | [Network] | |
748 | Tunnel=sit-tun</programlisting> | |
798d3a52 | 749 | </example> |
0a8a0fad | 750 | |
798d3a52 | 751 | <example> |
681eb9cf | 752 | <title>&pkgsysconfdir;/network/gre.network</title> |
0a8a0fad | 753 | |
798d3a52 | 754 | <programlisting>[Match] |
0a8a0fad TG |
755 | Name=em1 |
756 | ||
757 | [Network] | |
758 | Tunnel=gre-tun</programlisting> | |
798d3a52 | 759 | </example> |
0a8a0fad | 760 | |
798d3a52 | 761 | <example> |
681eb9cf | 762 | <title>&pkgsysconfdir;/network/vti.network</title> |
0a8a0fad | 763 | |
798d3a52 | 764 | <programlisting>[Match] |
0a8a0fad TG |
765 | Name=em1 |
766 | ||
767 | [Network] | |
768 | Tunnel=vti-tun</programlisting> | |
798d3a52 ZJS |
769 | </example> |
770 | </refsect1> | |
771 | ||
772 | <refsect1> | |
773 | <title>See Also</title> | |
774 | <para> | |
775 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
776 | <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
777 | <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
778 | <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
779 | </para> | |
780 | </refsect1> | |
eac684ef TG |
781 | |
782 | </refentry> |