Replaced NIC vs eth0

Debian based GNU/Linux OS (like Ubuntu) caches MAC-addresses to its corresponding eth devices, like eth0.

Imagine your NIC dies and you replace that with another one, it’s MAC-address changes. Ubuntu does recognize this card which is located in the old NIC’s PCI slot according to syslog, but no eth-device is configured - well it is not eth0 as before but rather eth1.

Existing scripts that rely on the NIC being eth0 will not function.

To make the new NIC to be recognized as eth0 (like the replaced one), edit the file below and remove traces of the old file by removing the lines or commenting them out:

/etc/udev/rules.d/70-persistent-net.rules

Such a behaviour could also be forced when migrating a physical host into a virtual machine. Start the vm, edit the udev-rules files, reboot and your host is available via eth0 again…