I'm working with a raspberry pi which only has one network card (an ethernet port). To have more network cards, I use external devices that convert from USB to ethernet. The problem is that each time the raspberry is rebooted, it randomly assigns the interface name to the device.
I would like to make it somehow raspberry to detect that it is a MAC (the one I want) assigned the interface name that I want; that is, for example the MAC 00:50:56:c0:00:08
with the interface name eth2
I have tried to create a file called 70-persistent-net.rules
in /etc/udev/rules.d
and include the following rule:
SUBSYSTEM == "net", ACTION == "add", DRIVERS == "? ", ATTR {address} == "00: 50: 56: c0: 00: 08", ATTR {dev_id} == "0x0", ATTR {type} == "1", KERNEL == "eth ", NAME="eth2"
Restarting the raspberry does not assign the MAC with the name of the interface.
Would there be any other possibility to carry it out?
Thank you.