Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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: UDEV_LOG=3
E: DEVPATH=/devices/pci0000:00/0000:00:1c.5/0000:05:00.0/net/eth4
E: INTERFACE=eth4
E: IFINDEX=2
E: SUBSYSTEM=net
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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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