Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to write a "generic" udev rule to assign an interface name to my NIC card.

For a particular application i require the ability to boot a headless server where the NIC can be changed at any point. However the Make and model of the NIC will stay the same.

so i have attacked the problem by trying to write a generic udev rule which will assign the required name (to be later matched to specific static network settings) to any NIC matching the Vednor and Model ID. my output of udevadm:

micromass@ComExATE:/sbin> sudo ./udevadm info --attribute-walk --query=all --pat          h=/sys/class/net/eth4
P: /devices/pci0000:00/0000:00:1c.5/0000:05:00.0/net/eth4
E: DEVPATH=/devices/pci0000:00/0000:00:1c.5/0000:05:00.0/net/eth4
E: ID_VENDOR_FROM_DATABASE=Broadcom Corporation
E: ID_MODEL_FROM_DATABASE=NetXtreme BCM5761 Gigabit Ethernet PCIe
E: ID_BUS=pci
E: ID_VENDOR_ID=0x14e4
E: ID_MODEL_ID=0x1681

so my rule looked like this:

SUBSYSTEM=="net", ACTION=="add", ATTR{IDVENDOR_ID}=="0x14e4", ATTR{ID_MODEL_ID}=="0x1681", NAME="my-device"

However no luck. so i tried something a bit simpler and decided to match the first 3 sets of the MAC address (which are assigned to a vendor)

SUBSYSTEM=="net", ACTION=="add", ADDRESS=="00:30:64??:??:??", NAME="my-device"

Still no luck. i cant ever seem to change these rules to add symlinks instead of renaming.

Not sure where to go from here so any help would be great.

share|improve this question

You misspelled the attribute name: It's ID_VENDOR_ID. Not IDVENDOR_ID

share|improve this answer

Run udev debug and look at syslog, does it match your rules or not. What opensuse version do you use? Btw, I'm not sure you can add ? in MAC address field. First check if udev can rename interface at all in your setup (here is an example config).

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .