I upgraded my server to 16.04 from 14.04, which in turn was upgraded from 12.04, all using the command line do-release-upgrade. This is a server build, with absolutely no GUI. It runs apache2, bind9, nfs, and a few other network-related services. For the most part, nothing was broken in the upgrade... except the network. Now, I have to run

sudo /etc/init.d/networking start

after every reboot to get it to connect to the network. Not very helpful for a server. My guess is that the networking script simply isn't being run on startup; normally, I could fix the issue by running

sudo update-rc.d networking defaults

but the above command just gives an error about being unable to connect to upstart.

What can I do to fix my network?

Edit: The contents of /etc/network/interfaces:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
  • can you add the lines in your /etc/network/interfaces file to your question? – John Orion May 4 '16 at 16:56
  • @JohnOrion done. I also made sure that the network device was actually eth0; I've had devices change between eth0 and eth1 before. It is, indeed, eth0. – ArmanX May 4 '16 at 17:03
  • What does ifconfig show? What happens when you run sudo ifup eth0? – Cerin Sep 26 '16 at 3:05
  • 1
    For future information-seekers: "ifconfig" shows nothing; "ifconfig -a" shows the adapter is there, but not activated. "sudo ifup eth0" (or "sudo ifconfig eth0 up") will bring the adapter up, but not kick off the dhcp client. Manually bringing up the adapter and starting dhclient connects as expected. – ArmanX Sep 27 '16 at 15:31
  • That said, I eventually reinstalled everything from scratch, which fixed it. – ArmanX Sep 27 '16 at 15:31

same here.

I think something went wrong while migrating from upstart to systemd in the installation process?

i will describe how i fixed it

Following this guide i enabled systemd networking: http://xmodulo.com/switch-from-networkmanager-to-systemd-networkd.html

Steps i did:

$ sudo systemctl enable systemd-networkd
$ sudo systemctl enable systemd-resolved
$ sudo systemctl start systemd-resolved
$ sudo rm /etc/resolv.conf
$ sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
$ sudo vi /etc/systemd/network/20-dhcp.network




Now everything is working fine :-)

| improve this answer | |
  • huzzah! This solved it for me as well! – Craig May 22 '17 at 16:55
  • Didn't work here. The third statement errored. – jjmerelo Feb 24 '19 at 9:29

Static Address solution:

To add to HerrTaschenbier's answer: If you have a static address on your server you should check to see if the NIC was renamed by doing ifconfig -a I found eth0 was renamed to ens32. Use that information and apply that to HerrTaschenbier's answer. You will also need to create the new file as he instructed, sudo vi /etc/systemd/network/20-ens32.network. The content is slightly different.



Note the file name format has the network adapter name in it. Don't forget to change the adapter name in /etc/network/interfaces file as well. This happened to me from a 14.04 to 16.04 upgrade.

| improve this answer | |

I ran into the same issue after long usage of 16.04, probably some update messed things up.

Running systemctl status networking.service showed, that the service failed to start due to error in ifup -a call. Running ifup -a separately revealed that it is trying to work with eth0 interface, while ifconfig -a listed only enp0s31f6 and lo interfaces. Checking /etc/network/interfaces showed:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

Correction of the interface name to what was found by ifconfig solved the issue:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto enp0s31f6
iface enp0s31f6 inet dhcp
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.