Sunday, May 28, 2017

Can I bind USB/other interface/device number (e.g. cdceX) to particular MAC, USB serial number or the like?

Hi misc@,

For pluggable devices such as USB NIC:s, is there any way to make
OpenBSD bind a particular device based on its MAC or USB serial number
or the like variable, to a particular interface or device filename?

E.g. MAC X is prebooked as cdce0, and MAC Y as cdce1 , and external USB
harddrive with serial number Z as /dev/sd0 and the one with serial
number A as /dev/sd1 (and plugging in other devices would
automatically).

(For storage devices there's the DUID-based mounting already though, so
I guess those are a non-issue.)

Some things in the OS are specified per interface/device name, e.g. PF
rules (e.g. "pass in proto tcp from any to cdce0 port 123 rdr-to cdce1
..", "match out on cdce0 from 192.168.0.0/16 to any nat-to cdce0"), so
having the interface numbers garbled on replug may be an unnecessary
reason to reboot?

Would be happy to learn any best practice here, thanks,
Tinker

No comments:

Post a Comment