Ubuntu – Having a real problem with systemctl networking

bootnetworkingrestart

I am having an impossible time trying to restart systemctl networking.

I am intermediate at linux and with all the new stuff in Ubuntu 18.04 with netplan and such, it's as if I know nothing at this point. I need someone's help who understands this more than I do.

This is our own server running Ubuntu 18.04 Server, so no hosting company is involved. Our website, which we are hosting, works for the most part (have another question on here about the root domain not working, but www.domain.com works fine), but for some reason, systemctl won't start without a failure – which also includes during boot time. The server is encrypted for security reasons.

Contents of /etc/network/interfaces

# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# Generated by debian-installer.

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

#source /etc/network/interfaces.d/*

# The loopback network interface
#auto lo
#iface lo inet loopback

# The primary network interface
#auto enp0s10
#iface enp0s10 inet static
    #address 72.31.51.26
    #netmask 255.255.255.248
    #gateway 72.31.51.25
    #dns-nameservers 75.114.81.1 75.114.81.2

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: networkd

Here is the error I receive:

karmacomposer@PANGEAVERSE:/$ sudo systemctl restart networking
Job for networking.service failed because the control process exited with error code.
See "systemctl status networking.service" and "journalctl -xe" for details.

I tried to use systemctl status and here are the results:

karmacomposer@PANGEAVERSE:/$ systemctl status networking
● networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2018-07-18 12:29:54 EDT; 7min ago
     Docs: man:interfaces(5)
  Process: 11835 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
  Process: 11821 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --excl
 Main PID: 11835 (code=exited, status=1/FAILURE)

Jul 18 12:29:54 PANGEAVERSE.pangeawerks.com systemd[1]: Starting Raise network interfaces...
Jul 18 12:29:54 PANGEAVERSE.pangeawerks.com sh[11821]: /etc/network/interfaces:22: misplaced option
Jul 18 12:29:54 PANGEAVERSE.pangeawerks.com sh[11821]: ifquery: couldn't read interfaces file "/etc/network/interfaces"
Jul 18 12:29:54 PANGEAVERSE.pangeawerks.com ifup[11835]: /etc/network/interfaces:22: misplaced option
Jul 18 12:29:54 PANGEAVERSE.pangeawerks.com ifup[11835]: /sbin/ifup: couldn't read interfaces file "/etc/network/interfaces"
Jul 18 12:29:54 PANGEAVERSE.pangeawerks.com systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Jul 18 12:29:54 PANGEAVERSE.pangeawerks.com systemd[1]: networking.service: Failed with result 'exit-code'.
Jul 18 12:29:54 PANGEAVERSE.pangeawerks.com systemd[1]: Failed to start Raise network interfaces.

I also tried it as root:

root@PANGEAVERSE:/# systemctl status networking
● networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2018-07-18 12:29:54 EDT; 36s ago
     Docs: man:interfaces(5)
  Process: 11835 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
  Process: 11821 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --excl
 Main PID: 11835 (code=exited, status=1/FAILURE)

Here is the contents of 01-systemd-networkd-eth.yaml:

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
 version: 2
 renderer: networkd
 ethernets:
   enp0s10:
     dhcp4: no
     dhcp6: no
     addresses: [72.31.51.26/24, '2001:1::2/64']
     gateway4: 72.31.51.25
     nameservers:
       addresses: [75.114.81.1,75.114.81.2]
       search: [ www.pangeawerks.com ]

Here is the contents of the file 01-network-manager-all.yaml

network:
  version: 2
  renderer: networkd

I just changed the network renderer to networkd – it was set to NetworkManager which in my case is wrong – as we are using Ubuntu 18.04 Server and not using a GUI to configure stuff.

I have tried for 72 hours to figure this out on my own (that and the other dns problem mentioned above) and I am at wits end. No amount of searching and trying stuff has worked. I am resigned to asking for help at this point.

I hope someone can help me – it is much appreciated.

Mike

Best Answer

Please uncomment the loopback network interface lines in your /etc/network
/interfaces file and then try again to restart the networking service –  
steeldriver 32 mins ago

That fixed it! Thank you so much.

Mike

Related Question