I am trying to assign persistent names to network interfaces on a Linux Mint 21.3 PC. This particular PC often has PCIe devices added and removed, so the 'predictable' naming scheme of enpXs0
is inconvenient.
This PC has two ethernet controllers, one on the motherboard, and one on a PCIe add-in card. I am able to define the motherboard ethernet port as lan0
using both using udev rules, and using systemd, but trying to define the PCIe add-in card as lan1
using the same methods is failing, and this is instead being assigned as enpXs0
.
Here is the udev rules file:
#/etc/udev/rules.d/70-persistent-net.rules
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="<mac for motherboard lan0>", NAME="lan0"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="<mac for PCIe lan1>", NAME="lan1"
And here is the systemd link. This example is for lan0
, but the file is identically structured for lan1
:
#/etc/systemd/network/10-persistent-lan0.link
[Match]
MACAddress=<mac for motherboard lan0>
[Link]
Name=lan0
The only meaningful difference I can determine between the two cards their physical form factor. This of course means that they have different PCIe addresses as well. The PCIe add-in card (lan1
) will eventually be configured with a static IP and set up to respond to RARP requests on a small private network, but all of that configuration was set up with a different interface name (not the assigned or the target) -- think RARP is set up on enp2s0
, and the card is being initially assigned enp3s0
, then attempted renaming to lan1
-- so I don't see why this would make a difference.
What would cause the add-in card to behave differently than the integrated card? I have looked at several other questions that deal with issues in naming of all the interfaces on a PC, but have not come across any topics that deal with specifically