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:

#loopback
auto lo
iface lo inet loopback

#eth0
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
  • 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

Content:

[Match]
Name=e*

[Network]
DHCP=yes

Now everything is working fine :-)

  • huzzah! This solved it for me as well! – Craig May 22 '17 at 16:55

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.

[Match] 
Name=ens32

[Network]
DNS=xxx.xxx.xxx.xxx
Domains=somedomain.com
Address=xxx.xxx.xxx
Gateway=xxx.xxx.xxx

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.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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