ifup cannot bring up eth0 after upgrading to 16.04

31,062

Solution 1

I ran into this on a fresh install of server 16.04 on a Raspberry Pi. For some reason, Network Manager wasn't installed by default, and after running dist-upgrade and then rebooting, I had no network.

I followed the steps at this blog to get it working again. Essentially, the mapping for eth0 had become corrupted. Normally, Network Manager can automatically fix this, but without it, you have to do it yourself. To do that, I first ran:

sudo networkctl

which showed me all my network interfaces like lo, wlan0 and something called enc238897s9879c3, which is actually supposed to be eth0.

To correct the mapping, I ran:

sudo ip link set enc238897s9879c3 name eth0
sudo systemctl restart networking

and that fixed it. Running ifconfig showed I had an IP, and running ping google.com showed I had Internet.

Solution 2

I ran into the same issue. The answer given by @rosencreuz is correct, but I narrowed it down to just this one command.

# apt install isc-dhcp-client

Solution 3

It looks like the upgrade was somehow messed up networking related packages. I did followings which lead to resolution of the problem. I'm not sure which ones were necessary though.

# apt install network-manager
# systemctl enable systemd-networkd
# systemctl enable systemd-resolved
# systemctl start systemd-networkd
# systemctl start systemd-resolved
# apt install isc-dhcp-client
# dpkg-reconfigure resolvconf

Solution 4

I happened to suffer this same problem on my virtual machine booted by QEMU. I had solved it with some simple commands and I will show you how to do it. By the way, this is also applicable to OS booted on a real machine. Only if you enter the recovery mode after encountering such a mistake.

  1. run sudo systemctl status networking.service to see what happened. It will give you some useful feedback information. In my case, I find a message Failed to bring up ens3. Seems the network device ens3 is not available.

  2. run ip link show to figure out the available devices on you machine. In my case, it is enp0s3.

  3. run vim /etc/network/interfaces to change the ens3 to enp0s3.

  4. run sudo systemctl restart networking.service to restart networking service.

  5. run sudo systemctl status networking.service to see if it is working well.

Share:
31,062

Related videos on Youtube

rosencreuz
Author by

rosencreuz

Updated on September 18, 2022

Comments

  • rosencreuz
    rosencreuz over 1 year

    I've upgraded my server from 14.04 to 16.04. I can see following error on syslog:

    ifup[478]: Internet Systems Consortium DHCP Client 4.2.4
    ifup[478]: Copyright 2004-2012 Internet Systems Consortium.
    ifup[478]: All rights reserved.
    ifup[478]: For info, please visit https://www.isc.org/software/dhcp/
    ifup[478]: Usage: dhclient [-4|-6] [-SNTP1dvrx] [-nw] [-p <port>] [-D LL|LLT]
    ifup[478]:             [-s server-addr] [-cf config-file] [-lf lease-file]
    ifup[478]:             [-pf pid-file] [--no-pid] [-e VAR=val]
    ifup[478]:             [-sf script-file] [interface]
    ifup[478]: Failed to bring up eth0.
    systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
    systemd[1]: Failed to start Raise network interfaces.
    systemd[1]: networking.service: Unit entered failed state.
    
    systemd[1]: networking.service: Failed with result 'exit-code'.
    

    I also get the same error if I try to do it manually

    # ifup --verbose eth0
    Configuring interface eth0=eth0 (inet)
    /bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
    run-parts: executing /etc/network/if-pre-up.d/ethtool
    run-parts: executing /etc/network/if-pre-up.d/wireless-tools
    run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
    
    /sbin/dhclient -1 -v -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases -I -df /var/lib/dhcp/dhclient6.eth0.leases eth0
    Usage: dhclient [-4|-6] [-SNTP1dvrx] [-nw] [-p <port>] [-D LL|LLT]
                 [-s server-addr] [-cf config-file] [-lf lease-file]
                 [-pf pid-file] [--no-pid] [-e VAR=val]
                 [-sf script-file] [interface]
    Failed to bring up eth0.
    

    I can ping 8.8.8.8. But cannot resolve any domain names.

    What can I do to restore network connection?

  • grepmaster
    grepmaster almost 8 years
    so how do you restart network service? network-manager?
  • Cerin
    Cerin over 7 years
    So the solution to a non-working internet connection is to download packages from the internet?
  • rnavarro
    rnavarro over 7 years
    @Cerin I actually had the package cached already from the upgrade process. The apt process downloads pachages BEFORE instlaling them, so the local maching should already have it available.
  • vmalep
    vmalep over 7 years
    it works well, but it must be run again after each reboot...
  • vmalep
    vmalep over 7 years
    Should we not fill a bug report for this issue?
  • Gord Thompson
    Gord Thompson almost 7 years
    sudo networkctl was the secret for me, thanks. It didn't work when I renamed the enc... adapter to eth1, but it did work when I replaced eth1 with the enc... name in /etc/network/interfaces.
  • kamil
    kamil almost 7 years
    you are the king
  • Apteryx
    Apteryx over 6 years
    Didn't help on Debian 9. The system also hung somewhat at boot time.
  • Quentin S.
    Quentin S. over 6 years
    Worked for me! The package was indeed cached.