Ubuntu: Network driver reset to eth0?

12,397

Ubuntu Server has some custom udev rules in place that allow it to "cache" the ethernet devices that have been plugged in to the machine. The delay you're experiencing is caused, as you suspect, in the /etc/network/interfaces file. While it may be viable to constantly add new devices to the file, in your case, you just want to remove Ubuntu's ethernet cache:

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

Which will restart your network interfaces back to eth0 on the next boot.

Share:
12,397

Related videos on Youtube

Highway of Life
Author by

Highway of Life

David has worked in Software Development for over 20 years, from every phase of development, build, deployment, systems engineering, operations, and Site Reliability Engineering (DevOps). David is currently the Lead Site Reliability Engineer for the SRE Product team at Starbucks Technology where the focus is on developing applications and shared platforms to enable rapid development by engineering teams across Starbucks.

Updated on September 18, 2022

Comments

  • Highway of Life
    Highway of Life over 1 year

    I've been trying to get my Ubuntu Server VM running through VirtualBox. I ended up trying several network interfaces because of some networking issues and finally got it working. However, I noticed that my machine is now using eth3 instead of the default eth0. There are some scripts on this VM that are linked to eth0 and I'd like to reset the driver to eth0. How would I do this?

    I've attempted to run the various networking commands to stop the network and configure eth0 without success. Ubuntu appears to be keeping a tally of all network drivers that I've attempted and increments the interface each time I use a new driver. Because of this, the system takes longer to boot up because it's searching for eth0 primary network interface in /etc/network/interfaces

  • bonsoy
    bonsoy over 12 years
    You shouldnt delete this file. Just open it at text editor "sudo vim / sudo nano" and remove lines with wrong or removed network cards and then just make a correct name you yours interface like eth0/eth100/card0
  • Highway of Life
    Highway of Life over 12 years
    @MealstroM I like the idea of deleting it since it is an auto-generated file, it will be recreated on startup. Just to be on the safe side, I backed the file up before removing it, and confirmed there is no issue with removing it. I wanted a good "reset" for the VM and this worked perfectly. :)
  • spuder
    spuder over 7 years
    This is no longer recommended on ubuntu 15.10 or newer unix.stackexchange.com/questions/335461/…