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:
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 3:
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 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.