The device name is set by the kernel and renamed to a human readable value by udev. udev will run the 75-persistent-net-generator.rules script in /lib/udev/rules/ which will generate the rules file 70-persistent-net.rules in /etc/udev/rules.d/
This the generator script will add new rules to the 70-persistent-net.rules file for every network adapter that is recognized by the kernel. When you replace a network card (ruled eth0) the old card will not be deleted form the rules, the new one is added though (eth1).
In my situation the network adapters are continuously changing. The hard disk is copied and placed in another computer with ecxactly the same setup, but the MAC addresses will be different every time. The position (PCIe) in the computer however will be the same every time. I did the following:
I turned off the rules generator by removing it from udev, but moved it for backup purposes:
sudo mv /lib/udev/rules.d/75-persistent-net-generator.rules /home/user/backup/
The rules will not be generated anymore.
Then I edited the udev rules:
sudo nano /etc/udev/rules.d/70-persistent-net.rules
I removed the rules that were set by the generator and replaced them with:
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:1c.0", NAME="eth0"
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:1c.1", NAME="eth1"
ACTION=="add", SUBSYSTEM=="net", ATTR{type}==”1”, KERNEL=="ra*", NAME="wlan0"
Now my two network cards on the PCIe bus are named eth0 and eth1, and when I replace them, they will stay the same.
The last line will answer my question. The adapter passed by the kernel with a ra* name will be renamed to wlan0. In /etc/network/interfaces I can call "iface wlan0 inet dhcp"!
For me this is a working solution. I can copy this hard disk and put it in another machine with the same setup. AND IT WORKS! Now I can