I'm using a headless Ubuntu 16.04 LTS Server with two physical network cards, which are named enp5s0f0 and enp5s0f1.
I would like to rename these interfaces, and followed this example. I therefore created the file /lib/systemd/network/70-myinterface.link
(the original source does not seem to work) like this (I set the correct mac address):
[Match]
MACAddress=12:34:56:78:9a:bc
[Link]
Name=dmz0
and rebooted the server. Unfortunately the interface did not get renamed, even though udevadm
shows that my configuration file is used:
$ udevadm info /sys/class/net/enp5s0f1
P: /devices/pci0000:00/0000:00:02.0/0000:01:00.0/0000:02:02.0/0000:05:00.1/net/enp5s0f1
E: DEVPATH=/devices/pci0000:00/0000:00:02.0/0000:01:00.0/0000:02:02.0/0000:05:00.1/net/enp5s0f1
E: ID_BUS=pci
E: ID_MODEL_FROM_DATABASE=80003ES2LAN Gigabit Ethernet Controller (Copper)
E: ID_MODEL_ID=0x1096
E: ID_NET_DRIVER=e1000e
E: ID_NET_LINK_FILE=/lib/systemd/network/70-myinterface.link <-- my file
E: ID_NET_NAME_MAC=enx123456789abc
E: ID_NET_NAME_PATH=enp5s0f1
E: ID_OUI_FROM_DATABASE=Intel Corporation
E: ID_PATH=pci-0000:05:00.1
E: ID_PATH_TAG=pci-0000_05_00_1
E: ID_PCI_CLASS_FROM_DATABASE=Network controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
E: ID_VENDOR_ID=0x8086
E: IFINDEX=3
E: INTERFACE=enp5s0f1
E: SUBSYSTEM=net
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/enp5s0f1
E: TAGS=:systemd:
E: USEC_INITIALIZED=1900192
Do you have any idea why the renaming did not work?
MACAddress=
[Match]
doesn't work for me inlink
files as well, so I ended up usingPath=
instead. You should try too. Also you may check whichlink
file matches your device withudevadm test-builtin net_setup_link /sys/class/net/enp5s0f1
command