I have multiple similar USB network devices, in this case CAN (can0 and can1) connections to different networks but I figure it is a similar problem with multiple other networks (eg WiFi, Ethernet etc). These currently show as can0 and can1 and I may connect more.
I am trying to maintain some sort of persistency in the locations for access to each. For non-network devices using udev allows custom symlinks to be referenced to the idVendor, idProduct, and serial numbers so I can ensure the correct code accesses the correct device.
How can à similar persistency be achieved for divices under ifconfig? I have the IDs and serial details for each ready to reference
I don't want device x to always be can0 and device y to always be can1. As there might only be one device which I think would need to be can0. But if they are plugged in differently or started in a different order then I want to check that can0 is device x or y and run the correct code, or if not run the alternative.
I figured this is the better approach than the udev logic but can't seem to find out the methodology
Hoping for some pointers on this one. TIA