1SYSTEMD.LINK(5) systemd.link SYSTEMD.LINK(5)
2
3
4
6 systemd.link - Network device configuration
7
9 link.link
10
12 Network link configuration is performed by the net_setup_link udev
13 builtin.
14
15 The link files are read from the files located in the system network
16 directory /usr/lib/systemd/network, the volatile runtime network
17 directory /run/systemd/network, and the local administration network
18 directory /etc/systemd/network. Link files must have the extension
19 .link; other extensions are ignored. All link files are collectively
20 sorted and processed in lexical order, regardless of the directories in
21 which they live. However, files with identical filenames replace each
22 other. Files in /etc have the highest priority, files in /run take
23 precedence over files with the same name in /usr/lib. This can be used
24 to override a system-supplied link file with a local file if needed. As
25 a special case, an empty file (file size 0) or symlink with the same
26 name pointing to /dev/null disables the configuration file entirely (it
27 is "masked").
28
29 The link file contains a "[Match]" section, which determines if a given
30 link file may be applied to a given device, as well as a "[Link]"
31 section specifying how the device should be configured. The first (in
32 lexical order) of the link files that matches a given device is
33 applied. Note that a default file 99-default.link is shipped by the
34 system. Any user-supplied .link should hence have a lexically earlier
35 name to be considered at all.
36
37 See udevadm(8) for diagnosing problems with .link files.
38
40 A link file is said to match a device if each of the entries in the
41 "[Match]" section matches, or if the section is empty. The following
42 keys are accepted:
43
44 MACAddress=
45 A whitespace-separated list of hardware addresses. Use full colon-,
46 hyphen- or dot-delimited hexadecimal. See the example below. This
47 option may appear more than once, in which case the lists are
48 merged. If the empty string is assigned to this option, the list of
49 hardware addresses defined prior to this is reset.
50
51 Example:
52
53 MACAddress=01:23:45:67:89:ab 00-11-22-33-44-55 AABB.CCDD.EEFF
54
55 OriginalName=
56 A whitespace-separated list of shell-style globs matching the
57 device name, as exposed by the udev property "INTERFACE". This
58 cannot be used to match on names that have already been changed
59 from userspace. Caution is advised when matching on kernel-assigned
60 names, as they are known to be unstable between reboots.
61
62 Path=
63 A whitespace-separated list of shell-style globs matching the
64 persistent path, as exposed by the udev property "ID_PATH".
65
66 Driver=
67 A whitespace-separated list of shell-style globs matching the
68 driver currently bound to the device, as exposed by the udev
69 property "DRIVER" of its parent device, or if that is not set, the
70 driver as exposed by "ethtool -i" of the device itself.
71
72 Type=
73 A whitespace-separated list of shell-style globs matching the
74 device type, as exposed by the udev property "DEVTYPE".
75
76 Host=
77 Matches against the hostname or machine ID of the host. See
78 "ConditionHost=" in systemd.unit(5) for details.
79
80 Virtualization=
81 Checks whether the system is executed in a virtualized environment
82 and optionally test whether it is a specific implementation. See
83 "ConditionVirtualization=" in systemd.unit(5) for details.
84
85 KernelCommandLine=
86 Checks whether a specific kernel command line option is set (or if
87 prefixed with the exclamation mark unset). See
88 "ConditionKernelCommandLine=" in systemd.unit(5) for details.
89
90 KernelVersion=
91 Checks whether the kernel version (as reported by uname -r) matches
92 a certain expression (or if prefixed with the exclamation mark does
93 not match it). See "ConditionKernelVersion=" in systemd.unit(5) for
94 details.
95
96 Architecture=
97 Checks whether the system is running on a specific architecture.
98 See "ConditionArchitecture=" in systemd.unit(5) for details.
99
101 The "[Link]" section accepts the following keys:
102
103 Description=
104 A description of the device.
105
106 Alias=
107 The "ifalias" is set to this value.
108
109 MACAddressPolicy=
110 The policy by which the MAC address should be set. The available
111 policies are:
112
113 "persistent"
114 If the hardware has a persistent MAC address, as most hardware
115 should, and if it is used by the kernel, nothing is done.
116 Otherwise, a new MAC address is generated which is guaranteed
117 to be the same on every boot for the given machine and the
118 given device, but which is otherwise random. This feature
119 depends on ID_NET_NAME_* properties to exist for the link. On
120 hardware where these properties are not set, the generation of
121 a persistent MAC address will fail.
122
123 "random"
124 If the kernel is using a random MAC address, nothing is done.
125 Otherwise, a new address is randomly generated each time the
126 device appears, typically at boot. Either way, the random
127 address will have the "unicast" and "locally administered" bits
128 set.
129
130 "none"
131 Keeps the MAC address assigned by the kernel.
132
133 MACAddress=
134 The MAC address to use, if no "MACAddressPolicy=" is specified.
135
136 NamePolicy=
137 An ordered, space-separated list of policies by which the interface
138 name should be set. "NamePolicy" may be disabled by specifying
139 "net.ifnames=0" on the kernel command line. Each of the policies
140 may fail, and the first successful one is used. The name is not set
141 directly, but is exported to udev as the property "ID_NET_NAME",
142 which is, by default, used by a udev rule to set "NAME". If the
143 name has already been set by userspace, no renaming is performed.
144 The available policies are:
145
146 "kernel"
147 If the kernel claims that the name it has set for a device is
148 predictable, then no renaming is performed.
149
150 "database"
151 The name is set based on entries in the udev's Hardware
152 Database with the key "ID_NET_NAME_FROM_DATABASE".
153
154 "onboard"
155 The name is set based on information given by the firmware for
156 on-board devices, as exported by the udev property
157 "ID_NET_NAME_ONBOARD".
158
159 "slot"
160 The name is set based on information given by the firmware for
161 hot-plug devices, as exported by the udev property
162 "ID_NET_NAME_SLOT".
163
164 "path"
165 The name is set based on the device's physical location, as
166 exported by the udev property "ID_NET_NAME_PATH".
167
168 "mac"
169 The name is set based on the device's persistent MAC address,
170 as exported by the udev property "ID_NET_NAME_MAC".
171
172 Name=
173 The interface name to use in case all the policies specified in
174 NamePolicy= fail, or in case NamePolicy= is missing or disabled.
175
176 Note that specifying a name that the kernel might use for another
177 interface (for example "eth0") is dangerous because the name
178 assignment done by udev will race with the assignment done by the
179 kernel, and only one interface may use the name. Depending on the
180 order of operations, either udev or the kernel will win, making the
181 naming unpredictable. It is best to use some different prefix, for
182 example "internal0"/"external0" or "lan0"/"lan1"/"lan3".
183
184 MTUBytes=
185 The maximum transmission unit in bytes to set for the device. The
186 usual suffixes K, M, G, are supported and are understood to the
187 base of 1024.
188
189 BitsPerSecond=
190 The speed to set for the device, the value is rounded down to the
191 nearest Mbps. The usual suffixes K, M, G, are supported and are
192 understood to the base of 1000.
193
194 Duplex=
195 The duplex mode to set for the device. The accepted values are
196 "half" and "full".
197
198 AutoNegotiation=
199 Enables or disables automatic negotiation of transmission
200 parameters. Autonegotiation is a procedure by which two connected
201 ethernet devices choose common transmission parameters, such as
202 speed, duplex mode, and flow control. Takes a boolean value. Unset
203 by default, which means that the kernel default will be used.
204
205 Note that if autonegotiation is enabled, speed and duplex settings
206 are read-only. If autonegotation is disabled, speed and duplex
207 settings are writable if the driver supports multiple link modes.
208
209 WakeOnLan=
210 The Wake-on-LAN policy to set for the device. The supported values
211 are:
212
213 "phy"
214 Wake on PHY activity.
215
216 "unicast"
217 Wake on unicast messages.
218
219 "multicast"
220 Wake on multicast messages.
221
222 "broadcast"
223 Wake on broadcast messages.
224
225 "arp"
226 Wake on ARP.
227
228 "magic"
229 Wake on receipt of a magic packet.
230
231 "secureon"
232 Enable secureon(tm) password for MagicPacket(tm).
233
234 "off"
235 Never wake.
236
237 Defaults to "off".
238
239 Port=
240 The port option is used to select the device port. The supported
241 values are:
242
243 "tp"
244 An Ethernet interface using Twisted-Pair cable as the medium.
245
246 "aui"
247 Attachment Unit Interface (AUI). Normally used with hubs.
248
249 "bnc"
250 An Ethernet interface using BNC connectors and co-axial cable.
251
252 "mii"
253 An Ethernet interface using a Media Independent Interface
254 (MII).
255
256 "fibre"
257 An Ethernet interface using Optical Fibre as the medium.
258
259 TCPSegmentationOffload=
260 The TCP Segmentation Offload (TSO) when true enables TCP
261 segmentation offload. Takes a boolean value. Defaults to "unset".
262
263 TCP6SegmentationOffload=
264 The TCP6 Segmentation Offload (tx-tcp6-segmentation) when true
265 enables TCP6 segmentation offload. Takes a boolean value. Defaults
266 to "unset".
267
268 GenericSegmentationOffload=
269 The Generic Segmentation Offload (GSO) when true enables generic
270 segmentation offload. Takes a boolean value. Defaults to "unset".
271
272 GenericReceiveOffload=
273 The Generic Receive Offload (GRO) when true enables generic receive
274 offload. Takes a boolean value. Defaults to "unset".
275
276 LargeReceiveOffload=
277 The Large Receive Offload (LRO) when true enables large receive
278 offload. Takes a boolean value. Defaults to "unset".
279
280 RxChannels=
281 Sets the number of receive channels (a number between 1 and
282 4294967295) .
283
284 TxChannels=
285 Sets the number of transmit channels (a number between 1 and
286 4294967295).
287
288 OtherChannels=
289 Sets the number of other channels (a number between 1 and
290 4294967295).
291
292 CombinedChannels=
293 Sets the number of combined set channels (a number between 1 and
294 4294967295).
295
297 Example 1. /usr/lib/systemd/network/99-default.link
298
299 The link file 99-default.link that is shipped with systemd defines the
300 default naming policy for links.
301
302 [Link]
303 NamePolicy=kernel database onboard slot path
304 MACAddressPolicy=persistent
305
306 Example 2. /etc/systemd/network/10-dmz.link
307
308 This example assigns the fixed name "dmz0" to the interface with the
309 MAC address 00:a0:de:63:7a:e6:
310
311 [Match]
312 MACAddress=00:a0:de:63:7a:e6
313
314 [Link]
315 Name=dmz0
316
317 Example 3. /etc/systemd/network/10-internet.link
318
319 This example assigns the fixed name "internet0" to the interface with
320 the device path "pci-0000:00:1a.0-*":
321
322 [Match]
323 Path=pci-0000:00:1a.0-*
324
325 [Link]
326 Name=internet0
327
328 Example 4. /etc/systemd/network/25-wireless.link
329
330 Here's an overly complex example that shows the use of a large number
331 of [Match] and [Link] settings.
332
333 [Match]
334 MACAddress=12:34:56:78:9a:bc
335 Driver=brcmsmac
336 Path=pci-0000:02:00.0-*
337 Type=wlan
338 Virtualization=no
339 Host=my-laptop
340 Architecture=x86-64
341
342 [Link]
343 Name=wireless0
344 MTUBytes=1450
345 BitsPerSecond=10M
346 WakeOnLan=magic
347 MACAddress=cb:a9:87:65:43:21
348
350 systemd-udevd.service(8), udevadm(8), systemd.netdev(5),
351 systemd.network(5)
352
353
354
355systemd 239 SYSTEMD.LINK(5)