GNU/Linux >> Linux Esercitazione >  >> Ubuntu

Hai un vero problema con la rete Systemctl?

Sto avendo un momento impossibile cercando di riavviare la rete systemctl.

Sono intermedio su Linux e con tutte le novità in Ubuntu 18.04 con netplan e simili, è come se non sapessi nulla a questo punto. Ho bisogno dell'aiuto di qualcuno che lo capisca più di me.

Questo è il nostro server che esegue Ubuntu 18.04 Server, quindi nessuna società di hosting è coinvolta. Il nostro sito Web, che stiamo ospitando, funziona per la maggior parte (ho un'altra domanda qui sul dominio principale che non funziona, ma www.domain.com funziona bene), ma per qualche motivo, systemctl non si avvia senza un errore - che include anche durante il tempo di avvio. Il server è crittografato per motivi di sicurezza.

Contenuti di /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

Ecco l'errore che ricevo:

[email protected]:/$ 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.

Ho provato a utilizzare lo stato systemctl e qui ci sono i risultati:

[email protected]:/$ 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.

L'ho provato anche come root:

[email protected]:/# 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)

Ecco il contenuto di 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 ]

Ecco il contenuto del file 01-network-manager-all.yaml

network:
  version: 2
  renderer: networkd

Ho appena cambiato il renderer di rete in Networkd - era impostato su NetworkManager che nel mio caso è sbagliato - poiché stiamo usando Ubuntu 18.04 Server e non utilizziamo una GUI per configurare le cose.

Correlati:installazione non standard (installazione di Linux da Linux)?

Ho provato per 72 ore a capirlo da solo (questo e l'altro problema DNS menzionato sopra) e sono a corto di idee. Nessuna quantità di ricerca e prova ha funzionato. Sono rassegnato a chiedere aiuto a questo punto.

Spero che qualcuno possa aiutarmi – è molto apprezzato.

Mike

Risposta accettata:

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

Questo ha risolto! Grazie mille.

Mike


Ubuntu
  1. Monitora il traffico di rete con vnStat su Ubuntu 20.04

  2. Risolvi i problemi della tua rete con tcpdump

  3. Rete Linux - Uno strano piccolo problema con DNS, DHCP

  4. Problema con Unetbootin (o, forse, me)?

  5. Problemi con il menu di recupero di Grub su Xubuntu 18.04.2?

Spiegazione dei concetti di rete Docker

Iniziare con systemctl

Network Manager su Linux con esempi

Problemi con Libre Office in Ubuntu 13.04?

Uno strano problema di Gui con i programmi Gnome?

Monitora l'utilizzo della larghezza di banda della rete Linux in tempo reale con nload