Centos – How to change persistent-net-generator.rules to be PCI bus dependent and not MAC based

centoslinux-networkingudev

I am using CentOS 6.2 with VMware. I often have to clone my systems. Every time I clone it is adds a new rule to 70-persistent-net.rules file like so.

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:0c:f1:5e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

I never have more than one interface in my systems so this gets really annoying. I know there is way to change the rule to be PCI bus dependent and not MAC dependent, because I have done that already once but I cannot find anywhere on how to do it.

I understand the reasons behind this implementation of udev rules. It makes perfect sense on physical systems but on VMs it becomes an annoyance. Please help.

Best Answer

This should be enough for what you want:

DRIVERS=="?*", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"