table of contents
- buster 241-7~deb10u7
- buster-backports 247.3-6~bpo10+1
- testing 247.3-6
- unstable 247.3-6
- experimental 249.3-3
SYSTEMD.LINK(5) | systemd.link | SYSTEMD.LINK(5) |
NAME¶
systemd.link - Network device configurationSYNOPSIS¶
link.linkDESCRIPTION¶
Network link configuration is performed by the net_setup_link udev builtin.The link files are read from the files located in the system network directory /lib/systemd/network, the volatile runtime network directory /run/systemd/network, and the local administration network directory /etc/systemd/network. Link files must have the extension .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 /etc have the highest priority, files in /run take precedence over files with the same name in /lib. This can be used to override a system-supplied link file with a local file if needed. As a special case, an empty file (file size 0) or symlink with the same name pointing to /dev/null disables the configuration file entirely (it is "masked").
The link file contains a [Match] section, which determines if a given link file may be applied to a given device, as well as a [Link] section specifying how the device should be configured. The first (in lexical order) of the link files that matches a given device is applied. Note that a default file 99-default.link is shipped by the system. Any user-supplied .link should hence have a lexically earlier name to be considered at all.
See udevadm(8) for diagnosing problems with .link files.
[MATCH] SECTION OPTIONS¶
A link file is said to match a device if each of the entries in the [Match] section matches, or if the section is empty. The following keys are accepted:MACAddress=
Example:
MACAddress=01:23:45:67:89:ab 00-11-22-33-44-55 AABB.CCDD.EEFF
OriginalName=
Path=
Driver=
Type=
Host=
Virtualization=
KernelCommandLine=
KernelVersion=
Architecture=
[LINK] SECTION OPTIONS¶
The [Link] section accepts the following keys:Description=
Alias=
MACAddressPolicy=
persistent
random
none
MACAddress=
NamePolicy=
kernel
database
onboard
slot
path
mac
keep
Name=
Note that specifying a name that the kernel might use for another interface (for example "eth0") is dangerous because the name assignment done by udev will race with the assignment done by the kernel, and only one interface may use the name. Depending on the order of operations, either udev or the kernel will win, making the naming unpredictable. It is best to use some different prefix, for example "internal0"/"external0" or "lan0"/"lan1"/"lan3".
MTUBytes=
BitsPerSecond=
Duplex=
AutoNegotiation=
Note that if autonegotiation is enabled, speed and duplex settings are read-only. If autonegotation is disabled, speed and duplex settings are writable if the driver supports multiple link modes.
WakeOnLan=
phy
unicast
multicast
broadcast
arp
magic
secureon
off
Defaults to off.
Port=
tp
aui
bnc
mii
fibre
Advertise=
Table 1. Supported advertise values
Advertise | Speed (Mbps) | Duplex Mode |
10baset-half | 10 | half |
10baset-full | 10 | full |
100baset-half | 100 | half |
100baset-full | 100 | full |
1000baset-half | 1000 | half |
1000baset-full | 1000 | full |
10000baset-full | 10000 | full |
2500basex-full | 2500 | full |
1000basekx-full | 1000 | full |
10000basekx4-full | 10000 | full |
10000basekr-full | 10000 | full |
10000baser-fec | 10000 | full |
20000basemld2-full | 20000 | full |
20000basekr2-full | 20000 | full |
By default this is unset, i.e. all possible modes will be
advertised. This option may be specified more than once, in which case all
specified speeds and modes are advertised. If the empty string is assigned
to this option, the list is reset, and all prior assignments have no effect.
TCPSegmentationOffload=
TCP6SegmentationOffload=
GenericSegmentationOffload=
GenericReceiveOffload=
LargeReceiveOffload=
RxChannels=
TxChannels=
OtherChannels=
CombinedChannels=
EXAMPLES¶
Example 1. /lib/systemd/network/99-default.linkThe link file 99-default.link that is shipped with systemd defines the default naming policy for links.
[Link] NamePolicy=kernel database onboard slot path MACAddressPolicy=persistent
Example 2. /etc/systemd/network/10-dmz.link
This example assigns the fixed name "dmz0" to the interface with the MAC address 00:a0:de:63:7a:e6:
[Match] MACAddress=00:a0:de:63:7a:e6 [Link] Name=dmz0
Example 3. /etc/systemd/network/10-internet.link
This example assigns the fixed name "internet0" to the interface with the device path "pci-0000:00:1a.0-*":
[Match] Path=pci-0000:00:1a.0-* [Link] Name=internet0
Example 4. /etc/systemd/network/25-wireless.link
Here's an overly complex example that shows the use of a large number of [Match] and [Link] settings.
[Match] MACAddress=12:34:56:78:9a:bc Driver=brcmsmac Path=pci-0000:02:00.0-* Type=wlan Virtualization=no Host=my-laptop Architecture=x86-64 [Link] Name=wireless0 MTUBytes=1450 BitsPerSecond=10M WakeOnLan=magic MACAddress=cb:a9:87:65:43:21
SEE ALSO¶
systemd-udevd.service(8), udevadm(8), systemd.netdev(5), systemd.network(5)systemd 241 |