0

I have a usb to ethernet adapter that gets set as eth1. I can easily change this in 70-persistant-net.rules and name it how I like. This is based on the MAC address though. I have tons of these USB adapters and I want it to change to a specific name no matter which one I plug in. Each one has a different MAC address so if I plug in a different one it doesn't get changed to what I want. Only 1 will be plugged in at a time so duplicate names won't happen.

Is there a way to change the interface name based on something other than MAC address so that no matter which one I plug in, it will always say in my case bac0.

Thanks for any help

0

I guess you're selecting the device by MAC like this

[...]ATTR{address}=="57:04:b6:c2:6c:z3"[...]

You might try selecting by vendor and model instead

[...]ATTR{vendor}=="VENDOR", ATTR{model}=="MODEL"[...]

The necessary information can be obtained from lsusb or via udevadm.

I have not tried this myself, so it is only a somewhat educated guess on my end.

1
  • the top of the 70-persistant file says not to change anything but the name. Everytime I try to change anything else my networking breaks on reboot. – Daniel Braun Mar 8 '16 at 17:15
0

So I finally got this to work. This is what I had to use in the 70-persistant file.

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTRS{idVendor}=="1d6b", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="bac0"

the ATTRS is what did it I think. I don't even know what that is and how it worked lol. I'll take it though. I can now plug in different usb to ethernet adapters and each one gets the same interface.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.