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] section
31 specifying how the device should be configured. The first (in lexical
32 order) of the link files that matches a given device is applied. Note
33 that a default file 99-default.link is shipped by the system. Any
34 user-supplied .link should hence have a lexically earlier name to be
35 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 keys
42 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. When prefixed with
79 an exclamation mark ("!"), the result is negated. If an empty
80 string is assigned, then previously assigned value is cleared.
81
82 Virtualization=
83 Checks whether the system is executed in a virtualized environment
84 and optionally test whether it is a specific implementation. See
85 ConditionVirtualization= in systemd.unit(5) for details. When
86 prefixed with an exclamation mark ("!"), the result is negated. If
87 an empty string is assigned, then previously assigned value is
88 cleared.
89
90 KernelCommandLine=
91 Checks whether a specific kernel command line option is set. See
92 ConditionKernelCommandLine= in systemd.unit(5) for details. When
93 prefixed with an exclamation mark ("!"), the result is negated. If
94 an empty string is assigned, then previously assigned value is
95 cleared.
96
97 KernelVersion=
98 Checks whether the kernel version (as reported by uname -r) matches
99 a certain expression. See ConditionKernelVersion= in
100 systemd.unit(5) for details. When prefixed with an exclamation mark
101 ("!"), the result is negated. If an empty string is assigned, then
102 previously assigned value is cleared.
103
104 Architecture=
105 Checks whether the system is running on a specific architecture.
106 See ConditionArchitecture= in systemd.unit(5) for details. When
107 prefixed with an exclamation mark ("!"), the result is negated. If
108 an empty string is assigned, then previously assigned value is
109 cleared.
110
112 The [Link] section accepts the following keys:
113
114 Description=
115 A description of the device.
116
117 Alias=
118 The ifalias interface property is set to this value.
119
120 MACAddressPolicy=
121 The policy by which the MAC address should be set. The available
122 policies are:
123
124 persistent
125 If the hardware has a persistent MAC address, as most hardware
126 should, and if it is used by the kernel, nothing is done.
127 Otherwise, a new MAC address is generated which is guaranteed
128 to be the same on every boot for the given machine and the
129 given device, but which is otherwise random. This feature
130 depends on ID_NET_NAME_* properties to exist for the link. On
131 hardware where these properties are not set, the generation of
132 a persistent MAC address will fail.
133
134 random
135 If the kernel is using a random MAC address, nothing is done.
136 Otherwise, a new address is randomly generated each time the
137 device appears, typically at boot. Either way, the random
138 address will have the "unicast" and "locally administered" bits
139 set.
140
141 none
142 Keeps the MAC address assigned by the kernel.
143
144 MACAddress=
145 The MAC address to use, if no MACAddressPolicy= is specified.
146
147 NamePolicy=
148 An ordered, space-separated list of policies by which the interface
149 name should be set. NamePolicy= may be disabled by specifying
150 net.ifnames=0 on the kernel command line. Each of the policies may
151 fail, and the first successful one is used. The name is not set
152 directly, but is exported to udev as the property ID_NET_NAME,
153 which is, by default, used by a udev rule to set NAME. The
154 available policies are:
155
156 kernel
157 If the kernel claims that the name it has set for a device is
158 predictable, then no renaming is performed.
159
160 database
161 The name is set based on entries in the udev's Hardware
162 Database with the key ID_NET_NAME_FROM_DATABASE.
163
164 onboard
165 The name is set based on information given by the firmware for
166 on-board devices, as exported by the udev property
167 ID_NET_NAME_ONBOARD.
168
169 slot
170 The name is set based on information given by the firmware for
171 hot-plug devices, as exported by the udev property
172 ID_NET_NAME_SLOT.
173
174 path
175 The name is set based on the device's physical location, as
176 exported by the udev property ID_NET_NAME_PATH.
177
178 mac
179 The name is set based on the device's persistent MAC address,
180 as exported by the udev property ID_NET_NAME_MAC.
181
182 keep
183 If the device already had a name given by userspace (as part of
184 creation of the device or a rename), keep it.
185
186 Name=
187 The interface name to use in case all the policies specified in
188 NamePolicy= fail, or in case NamePolicy= is missing or disabled.
189
190 Note that specifying a name that the kernel might use for another
191 interface (for example "eth0") is dangerous because the name
192 assignment done by udev will race with the assignment done by the
193 kernel, and only one interface may use the name. Depending on the
194 order of operations, either udev or the kernel will win, making the
195 naming unpredictable. It is best to use some different prefix, for
196 example "internal0"/"external0" or "lan0"/"lan1"/"lan3".
197
198 MTUBytes=
199 The maximum transmission unit in bytes to set for the device. The
200 usual suffixes K, M, G, are supported and are understood to the
201 base of 1024.
202
203 BitsPerSecond=
204 The speed to set for the device, the value is rounded down to the
205 nearest Mbps. The usual suffixes K, M, G, are supported and are
206 understood to the base of 1000.
207
208 Duplex=
209 The duplex mode to set for the device. The accepted values are half
210 and full.
211
212 AutoNegotiation=
213 Takes a boolean. If set to yes, automatic negotiation of
214 transmission parameters is enabled. Autonegotiation is a procedure
215 by which two connected ethernet devices choose common transmission
216 parameters, such as speed, duplex mode, and flow control. When
217 unset, the kernel's default will be used.
218
219 Note that if autonegotiation is enabled, speed and duplex settings
220 are read-only. If autonegotation is disabled, speed and duplex
221 settings are writable if the driver supports multiple link modes.
222
223 WakeOnLan=
224 The Wake-on-LAN policy to set for the device. The supported values
225 are:
226
227 phy
228 Wake on PHY activity.
229
230 unicast
231 Wake on unicast messages.
232
233 multicast
234 Wake on multicast messages.
235
236 broadcast
237 Wake on broadcast messages.
238
239 arp
240 Wake on ARP.
241
242 magic
243 Wake on receipt of a magic packet.
244
245 secureon
246 Enable secureon(tm) password for MagicPacket(tm).
247
248 off
249 Never wake.
250
251 Defaults to off.
252
253 Port=
254 The port option is used to select the device port. The supported
255 values are:
256
257 tp
258 An Ethernet interface using Twisted-Pair cable as the medium.
259
260 aui
261 Attachment Unit Interface (AUI). Normally used with hubs.
262
263 bnc
264 An Ethernet interface using BNC connectors and co-axial cable.
265
266 mii
267 An Ethernet interface using a Media Independent Interface
268 (MII).
269
270 fibre
271 An Ethernet interface using Optical Fibre as the medium.
272
273 Advertise=
274 This sets what speeds and duplex modes of operation are advertised
275 for auto-negotiation. This implies "AutoNegotiation=yes". The
276 supported values are:
277
278 Table 1. Supported advertise values
279 ┌───────────────────┬──────────────┬─────────────┐
280 │Advertise │ Speed (Mbps) │ Duplex Mode │
281 ├───────────────────┼──────────────┼─────────────┤
282 │10baset-half │ 10 │ half │
283 ├───────────────────┼──────────────┼─────────────┤
284 │10baset-full │ 10 │ full │
285 ├───────────────────┼──────────────┼─────────────┤
286 │100baset-half │ 100 │ half │
287 ├───────────────────┼──────────────┼─────────────┤
288 │100baset-full │ 100 │ full │
289 ├───────────────────┼──────────────┼─────────────┤
290 │1000baset-half │ 1000 │ half │
291 ├───────────────────┼──────────────┼─────────────┤
292 │1000baset-full │ 1000 │ full │
293 ├───────────────────┼──────────────┼─────────────┤
294 │10000baset-full │ 10000 │ full │
295 ├───────────────────┼──────────────┼─────────────┤
296 │2500basex-full │ 2500 │ full │
297 ├───────────────────┼──────────────┼─────────────┤
298 │1000basekx-full │ 1000 │ full │
299 ├───────────────────┼──────────────┼─────────────┤
300 │10000basekx4-full │ 10000 │ full │
301 ├───────────────────┼──────────────┼─────────────┤
302 │10000basekr-full │ 10000 │ full │
303 ├───────────────────┼──────────────┼─────────────┤
304 │10000baser-fec │ 10000 │ full │
305 ├───────────────────┼──────────────┼─────────────┤
306 │20000basemld2-full │ 20000 │ full │
307 ├───────────────────┼──────────────┼─────────────┤
308 │20000basekr2-full │ 20000 │ full │
309 └───────────────────┴──────────────┴─────────────┘
310 By default this is unset, i.e. all possible modes will be
311 advertised. This option may be specified more than once, in which
312 case all specified speeds and modes are advertised. If the empty
313 string is assigned to this option, the list is reset, and all prior
314 assignments have no effect.
315
316 TCPSegmentationOffload=
317 Takes a boolean. If set to true, the TCP Segmentation Offload (TSO)
318 is enabled. When unset, the kernel's default will be used.
319
320 TCP6SegmentationOffload=
321 Takes a boolean. If set to true, the TCP6 Segmentation Offload
322 (tx-tcp6-segmentation) is enabled. When unset, the kernel's default
323 will be used.
324
325 GenericSegmentationOffload=
326 Takes a boolean. If set to true, the Generic Segmentation Offload
327 (GSO) is enabled. When unset, the kernel's default will be used.
328
329 GenericReceiveOffload=
330 Takes a boolean. If set to true, the Generic Receive Offload (GRO)
331 is enabled. When unset, the kernel's default will be used.
332
333 LargeReceiveOffload=
334 Takes a boolean. If set to true, the Large Receive Offload (LRO) is
335 enabled. When unset, the kernel's default will be used.
336
337 RxChannels=
338 Sets the number of receive channels (a number between 1 and
339 4294967295) .
340
341 TxChannels=
342 Sets the number of transmit channels (a number between 1 and
343 4294967295).
344
345 OtherChannels=
346 Sets the number of other channels (a number between 1 and
347 4294967295).
348
349 CombinedChannels=
350 Sets the number of combined set channels (a number between 1 and
351 4294967295).
352
354 Example 1. /usr/lib/systemd/network/99-default.link
355
356 The link file 99-default.link that is shipped with systemd defines the
357 default naming policy for links.
358
359 [Link]
360 NamePolicy=kernel database onboard slot path
361 MACAddressPolicy=persistent
362
363 Example 2. /etc/systemd/network/10-dmz.link
364
365 This example assigns the fixed name "dmz0" to the interface with the
366 MAC address 00:a0:de:63:7a:e6:
367
368 [Match]
369 MACAddress=00:a0:de:63:7a:e6
370
371 [Link]
372 Name=dmz0
373
374 Example 3. /etc/systemd/network/10-internet.link
375
376 This example assigns the fixed name "internet0" to the interface with
377 the device path "pci-0000:00:1a.0-*":
378
379 [Match]
380 Path=pci-0000:00:1a.0-*
381
382 [Link]
383 Name=internet0
384
385 Example 4. /etc/systemd/network/25-wireless.link
386
387 Here's an overly complex example that shows the use of a large number
388 of [Match] and [Link] settings.
389
390 [Match]
391 MACAddress=12:34:56:78:9a:bc
392 Driver=brcmsmac
393 Path=pci-0000:02:00.0-*
394 Type=wlan
395 Virtualization=no
396 Host=my-laptop
397 Architecture=x86-64
398
399 [Link]
400 Name=wireless0
401 MTUBytes=1450
402 BitsPerSecond=10M
403 WakeOnLan=magic
404 MACAddress=cb:a9:87:65:43:21
405
407 systemd-udevd.service(8), udevadm(8), systemd.netdev(5),
408 systemd.network(5)
409
410
411
412systemd 241 SYSTEMD.LINK(5)