Resetting your ethernet port indexes in Ubuntu

I ran into a situation where I had cloned a virtual machine (VHD) of Ubuntu and networking stopped functioning. Running ifconfig only displayed information for the loopback; it was as if the (virtual) network card wasn't installed, which wasn't the case.

What really happened was this: The installation of Ubuntu thought that it now had a new network card, yet it preserved the information for the old network card. The old configuration was for a card at eth0, but the new network card appeared to the system as eth1.

Information about what index is assigned to a device is stored in this file: /etc/udev/rules.d/70-persistent-net.rules

If you're feeling adventurous you can edit that file to fix the problem. But, I was feeling lazy. I deleted the file and restarted the system. The file is automatically rebuild at boot, so it really isn't a problem to delete it. That fixed it right up!

I learned how to fix it from here after Googling "no such device eth0"

Leave a Reply

Your email address will not be published.