Re: Renaming can devices interfaces names with udev

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I use similar method for net interface name from serial number of Rusoku TouCAN converters.It works for me.
https://github.com/rusoku/TouCAN-SocketCAN_DKMS/blob/master/95-toucan.rules

gedsim@PC:~$ ifconfig -a
TouCAN_5211: flags=128<NOARP>  mtu 16
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10  (UNSPEC)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Gediminas

On 2021-08-25 21:44, Jasper Wallace wrote:
Hi all,

I'm going to be using a number of the Korlan/8devices usb2can
interfaces and I want to make sure they have persistent interface
names. Thankfully they all have unique serial numbers that are printed
on the devices so I can match a physical device with a linux interface
name.

In theory I should be able to do something like add a file at
/etc/udev/rules.d/10-usb2can.rules containing something like:

SUBSYSTEM=="net", ACTION=="add", ATTR{ID_VENDOR_ENC}=="8Devices",
ATTR{ID_MODEL}=="USB2CAN_converter", NAME="can$attr{ID_SERIAL_SHORT}"

But I've not been able to get anything to work.

Has anyone been able to get something like this to work?

I'm on Debian Buster.

Thanks,

Jasper




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux