]> git.proxmox.com Git - systemd.git/blame - man/systemd.link.5
Imported Upstream version 217
[systemd.git] / man / systemd.link.5
CommitLineData
60f067b4 1'\" t
5eef597e 2.TH "SYSTEMD\&.LINK" "5" "" "systemd 217" "systemd.link"
60f067b4
JS
3.\" -----------------------------------------------------------------
4.\" * Define some portability stuff
5.\" -----------------------------------------------------------------
6.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7.\" http://bugs.debian.org/507673
8.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10.ie \n(.g .ds Aq \(aq
11.el .ds Aq '
12.\" -----------------------------------------------------------------
13.\" * set default formatting
14.\" -----------------------------------------------------------------
15.\" disable hyphenation
16.nh
17.\" disable justification (adjust text to left margin only)
18.ad l
19.\" -----------------------------------------------------------------
20.\" * MAIN CONTENT STARTS HERE *
21.\" -----------------------------------------------------------------
22.SH "NAME"
23systemd.link \- Network device configuration
24.SH "SYNOPSIS"
25.PP
26\fIlink\fR\&.link
27.SH "DESCRIPTION"
28.PP
29Network link configuration is performed by the
30\fBnet_setup_link\fR
31udev builtin\&.
32.PP
33The link files are read from the files located in the system network directory
34/usr/lib/systemd/network, the volatile runtime network directory
35/run/systemd/network, and the local administration network directory
36/etc/systemd/network\&. Link files must have the extension
37\&.link; other extensions are ignored\&. All link files are collectively sorted and processed in lexical order, regardless of the directories in which they live\&. However, files with identical filenames replace each other\&. Files in
38/etc
39have the highest priority, files in
40/run
41take precedence over files with the same name in
42/usr/lib\&. This can be used to override a system\-supplied link file with a local file if needed; a symlink in
43/etc
44with the same name as a link file in
45/usr/lib, pointing to
46/dev/null, disables the link file entirely\&.
47.PP
48The link file contains a
49"[Match]"
50section, which determines if a given link file may be applied to a given device; and a
51"[Link]"
52section specifying how the device should be configured\&. The first (in lexical order) of the link files that matches a given device is applied\&.
e842803a 53.SH "[MATCH] SECTION OPTIONS"
60f067b4
JS
54.PP
55A link file is said to match a device if each of the entries in the
56"[Match]"
57section matches, or if the section is empty\&. The following keys are accepted:
58.PP
59\fIMACAddress=\fR
60.RS 4
61The hardware address\&.
62.RE
63.PP
64\fIPath=\fR
65.RS 4
66The persistent path, as exposed by the udev property
67"ID_PATH"\&. May contain shell style globs\&.
68.RE
69.PP
70\fIDriver=\fR
71.RS 4
72The driver currently bound to the device, as exposed by the udev property
73"DRIVER"
74of its parent device, or if that is not set, the driver as exposed by
75"ethtool \-i"
76of the device itself\&.
77.RE
78.PP
79\fIType=\fR
80.RS 4
81The device type, as exposed by the udev property
82"DEVTYPE"\&.
83.RE
84.PP
85\fIHost=\fR
86.RS 4
87Matches against the hostname or machine ID of the host\&. See
88"ConditionHost="
89in
90\fBsystemd.unit\fR(5)
91for details\&.
92.RE
93.PP
94\fIVirtualization=\fR
95.RS 4
96Checks whether the system is executed in a virtualized environment and optionally test whether it is a specific implementation\&. See
97"ConditionVirtualization="
98in
99\fBsystemd.unit\fR(5)
100for details\&.
101.RE
102.PP
103\fIKernelCommandLine=\fR
104.RS 4
105Checks whether a specific kernel command line option is set (or if prefixed with the exclamation mark unset)\&. See
106"ConditionKernelCommandLine="
107in
108\fBsystemd.unit\fR(5)
109for details\&.
110.RE
111.PP
112\fIArchitecture=\fR
113.RS 4
114Checks whether the system is running on a specific architecture\&. See
115"ConditionArchitecture="
116in
117\fBsystemd.unit\fR(5)
118for details\&.
119.RE
e842803a 120.SH "[LINK] SECTION OPTIONS"
60f067b4
JS
121.PP
122The
123"[Link]"
124section accepts the following keys:
125.PP
126\fIDescription=\fR
127.RS 4
128A description of the device\&.
129.RE
130.PP
131\fIAlias=\fR
132.RS 4
133The
134"ifalias"
135is set to this value\&.
136.RE
137.PP
138\fIMACAddressPolicy=\fR
139.RS 4
140The policy by which the MAC address should be set\&. The available policies are:
141.PP
142"persistent"
143.RS 4
144If the hardware has a persistent MAC address, as most hardware should, and if it is used by the kernel, nothing is done\&. Otherwise, a new MAC address is generated which is guaranteed to be the same on every boot for the given machine and the given device, but which is otherwise random\&.
145.RE
146.PP
147"random"
148.RS 4
149If the kernel is using a random MAC address, nothing is done\&. Otherwise, a new address is randomly generated each time the device appears, typically at boot\&.
150.RE
151.RE
152.PP
153\fIMACAddress=\fR
154.RS 4
155The MAC address to use, if no
156"MACAddressPolicy="
157is specified\&.
158.RE
159.PP
160\fINamePolicy=\fR
161.RS 4
162An ordered, space\-separated list of policies by which the interface name should be set\&.
163"NamePolicy"
164may be disabled by specifying
165"net\&.ifnames=0"
166on the kernel commandline\&. Each of the policies may fail, and the first successful one is used\&. The name is not set directly, but is exported to udev as the property
167"ID_NET_NAME", which is, by default, used by a udev rule to set
5eef597e
MP
168"NAME"\&. If the name has already been set by userspace, no renaming is performed\&. The available policies are:
169.PP
170"kernel"
171.RS 4
172If the kernel claims that the name it has set for a device is predictable, then no renaming is performed\&.
173.RE
60f067b4
JS
174.PP
175"database"
176.RS 4
177The name is set based on entries in the udev\*(Aqs Hardware Database with the key
178"ID_NET_NAME_FROM_DATABASE"\&.
179.RE
180.PP
181"onboard"
182.RS 4
183The name is set based on information given by the firmware for on\-board devices, as exported by the udev property
184"ID_NET_NAME_ONBOARD"\&.
185.RE
186.PP
187"slot"
188.RS 4
189The name is set based on information given by the firmware for hot\-plug devices, as exported by the udev property
190"ID_NET_NAME_SLOT"\&.
191.RE
192.PP
193"path"
194.RS 4
195The name is set based on the device\*(Aqs physical location, as exported by the udev property
196"ID_NET_NAME_PATH"\&.
197.RE
198.PP
199"mac"
200.RS 4
201The name is set based on the device\*(Aqs persistent MAC address, as exported by the udev property
202"ID_NET_NAME_MAC"\&.
203.RE
204.RE
205.PP
206\fIName=\fR
207.RS 4
208The interface name to use in case all the policies specified in
209\fINamePolicy=\fR
210fail, or in case
211\fINamePolicy=\fR
212is missing or disabled\&.
213.RE
214.PP
215\fIMTUBytes=\fR
216.RS 4
217The maximum transmission unit in bytes to set for the device\&. The usual suffixes K, M, G, are supported and are understood to the base of 1024\&.
218.RE
219.PP
220\fIBitsPerSecond=\fR
221.RS 4
222The speed to set for the device, the value is rounded down to the nearest Mbps\&. The usual suffixes K, M, G, are supported and are understood to the base of 1000\&.
223.RE
224.PP
225\fIDuplex=\fR
226.RS 4
227The duplex mode to set for the device\&. The accepted values are
228"half"
229and
230"full"\&.
231.RE
232.PP
233\fIWakeOnLan=\fR
234.RS 4
235The Wake\-on\-LAN policy to set for the device\&. The supported values are:
236.PP
237"phy"
238.RS 4
239Wake on PHY activity\&.
240.RE
241.PP
242"magic"
243.RS 4
244Wake on receipt of a magic packet\&.
245.RE
246.PP
247"off"
248.RS 4
249Never wake\&.
250.RE
251.RE
252.SH "EXAMPLE"
253.PP
254\fBExample\ \&1.\ \&/etc/systemd/network/wireless.link\fR
255.sp
256.if n \{\
257.RS 4
258.\}
259.nf
260[Match]
261MACAddress=12:34:56:78:9a:bc
262Driver=brcmsmac
263Path=pci\-0000:02:00\&.0\-*
264Type=wlan
265Virtualization=no
266Host=my\-laptop
267Architecture=x86\-64
268
269[Link]
270Name=wireless0
271MTUBytes=1450
272BitsPerSecond=10M
273WakeOnLan=magic
274MACAddress=cb:a9:87:65:43:21
275.fi
276.if n \{\
277.RE
278.\}
279.SH "SEE ALSO"
280.PP
281\fBsystemd-udevd.service\fR(8),
282\fBudevadm\fR(8)