Sample Header Ad - 728x90

Consistent / persistent network connection naming, like udev

1 vote
1 answer
818 views
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
Asked by ShaunMc (13 rep)
Nov 25, 2022, 11:35 AM
Last activity: Feb 14, 2023, 09:18 AM