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