1
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.