ifup cannot bring up eth0 after upgrading to 16.04
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.
run
sudo systemctl status networking.service
to see what happened. It will give you some useful feedback information. In my case, I find a messageFailed to bring up ens3.
Seems the network device ens3 is not available.run
ip link show
to figure out the available devices on you machine. In my case, it is enp0s3.run
vim /etc/network/interfaces
to change the ens3 to enp0s3.run
sudo systemctl restart networking.service
to restart networking service.run
sudo systemctl status networking.service
to see if it is working well.
Related videos on Youtube
rosencreuz
Updated on September 18, 2022Comments
-
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 almost 8 yearsso how do you restart network service? network-manager?
-
Cerin over 7 yearsSo the solution to a non-working internet connection is to download packages from the internet?
-
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 over 7 yearsit works well, but it must be run again after each reboot...
-
vmalep over 7 yearsShould we not fill a bug report for this issue?
-
Gord Thompson almost 7 years
sudo networkctl
was the secret for me, thanks. It didn't work when I renamed theenc...
adapter toeth1
, but it did work when I replacedeth1
with theenc...
name in/etc/network/interfaces
. -
kamil almost 7 yearsyou are the king
-
Apteryx over 6 yearsDidn't help on Debian 9. The system also hung somewhat at boot time.
-
Quentin S. over 6 yearsWorked for me! The package was indeed cached.