Ubuntu eth0: ERROR while getting interface flags: No such device

This article is step-by-step tutorial how to fix a problem which occured after I restored my virtual machines from backup to my ESXI server.

ifconfig
ifconfig when eth0 is not available

when I used lspci, result was

lspci
lspci result

So network adapter is correctly available in my virtual machine. As next step I need to found out which alias is used for this adapter. I didn’t find any easily way than try et0,eth1,….

ifconfig eth0
eth0: error fetching interface information: Device not found

ifconfig eth1
eth1: error fetching interface information: Device not found

ifconfig eth2
eth2: Link encap: Ethernet HWaddr.....

So, I found my network adapter. Now as last step it’s necessary to update network interfaces to this adapter

sudo nano /etc/network/interfaces

#and change all eth0 to eth1 values
/etc/network/interfaces

As last step restart your machine and everything should work correctly.

External links:

  • http://www.cyberciti.biz/faq/show-ethernet-adapter-ubuntu-linux/

15 comments

  1. You’re a lifesaver! Thanks so much, this fixed an issue I just couldn’t figure out.

  2. found 5 processes that could cause trouble.
    If airodump-ng, aireplay-ng or airtun-ng stops working after
    a short period of time, you may want to kill (some of) them!
    -e
    PID Name
    580 avahi-daemon
    586 avahi-daemon
    789 NetworkManager
    853 wpa_supplicant
    5254 dhclient
    Process with PID 5254 (dhclient) is running on interface eth1

    Interface Chipset Driver

    eth1 Unknown wl – [phy0]mon0: ERROR while getting interface flags: No such device

    (monitor mode enabled on mon0)

    this is what i get when i try to use airmon-ng start eth1

  3. It is really very helping to me and my friends.. We are very thankful to you..

    Thank you very much…..

  4. You’re awesome!
    Thank you very very very much! my friend! : D: D
    I had this problem and did not know how to solve it ..
    Be well! :))

  5. Ubuntu keeps track of the association between MAC addresses and interface names in /etc/udev/rules.d/70-persistent-net.rules

    When you restore the VM on a different server, the network connection has a different MAC. eth0 is still associated with the old MAC (because of this file), so the new MAC address is allocated the next available ethX interface. (Since you ended up with eth2, you probably have existing rules for eth0 and eth1)

    You can edit that file and remove the old rules but unless you have some complicated networking requirements, just remove the file and reboot and you will find your network connection on eth0 as you originally expected.


    sudo mv /etc/udev/rules.d/70-persistent-net.rules /etc/udev/rules.d/70-persistent-net.rules.old
    sudo reboot

    Naturally, if you have followed the steps in the original post and changed /etc/network/interfaces then you need to revert that back to eth0 🙂

    (“ifconfig -a” might have been useful for you!)

  6. Very helpful, thank you very much.
    Helped me get the VirtualBox bridged adapter to work with Debian 6.

  7. Thank You very much. Solved my problem with Freepbx on CENTOS. We saved lot of hours of web searching.

Leave a Reply

Your email address will not be published. Required fields are marked *