9

I've made an image of my system and I have given it to someone to run. They have successfully flushed their system with the image and are running it.

The problem is as follows:

The system normally has 2 Wireless Adapters. Both showing up in the lsusb:

pi@raspberry:~ $ lsusb
Bus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter

I have set the interfaces in the /etc/udev/rules.d/70-persistent-net.rules files by their mac or hw address, and that works fine on my system, but on his system, obviously (while he uses the same type and model of hardware) they are different and as such, his mac address is different, so his 70-persistent-net.rules is useless and is giving him issues.

To avoid this in the future, is there a way I can set it so that it perhaps looks for type of model, say:

 EW-7811Un -> wlan0
 SMSC9512 -> wlan1

and sets those, instead on relying on mac address?

12

First three octets in a MAC address uniquely identify the manufacturer of the device. Udev rules allow you to match any number of characters with an asterisk. Thus, you can write a generic rule that will match any device of a specific vendor:

SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="74:2f:68*", NAME="wlan0"

Alternatively, you can stop matching on the address and use other parameters instead. Run the following command on both computers:

sudo udevadm info -a -p /sys/class/net/wlan0

(substituting the name of the interface, of course), and see what common values you see; then use them in your rules.

Writing udev rules is probably the best documentation on the topic.

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.