
O serviço de rede não inicia/não inicia na reinicialização.
Restarting networking (via systemctl): networking.serviceJob for networking.service failed because the control process exited with error code.
Ainda consigo acessar o servidor via console remoto, mas nada mais, pois sem rede não há saída nem entrada.
systemctl status networking.service diz:
● networking.service - Raise network interfaces
Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor prese
t: enabled)
Drop-In: /run/systemd/generator/networking.service.d
└─50-insserv.conf-$network.conf
Active: failed (Result: exit-code) since Mo 2016-04-18 06:53:11 UTC; 43s ago
Docs: man:interfaces(5)
Process: 3551 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=
1/FAILURE)
Process: 3546 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [
-n "$(ifquery --read-environment --list --exclude=lo)" ] && udevadm settle (cod
e=exited, status=0/SUCCESS)
Main PID: 3551 (code=exited, status=1/FAILURE)
Apr 18 06:53:11 h2502988.stratoserver.net ifup[3551]: For info, please visit htt
ps://www.isc.org/software/dhcp/
Apr 18 06:53:11 h2502988.stratoserver.net ifup[3551]: Usage: dhclient [-4|-6] [-
SNTP1dvrx] [-nw] [-p <port>] [-D LL|LLT]
Apr 18 06:53:11 h2502988.stratoserver.net ifup[3551]: [-s server
-addr] [-cf config-file] [-lf lease-file]
Apr 18 06:53:11 h2502988.stratoserver.net ifup[3551]: [-pf pid-f
ile] [--no-pid] [-e VAR=val]
Apr 18 06:53:11 h2502988.stratoserver.net ifup[3551]: [-sf scrip
t-file] [interface]
Apr 18 06:53:11 h2502988.stratoserver.net ifup[3551]: Failed to bring up eth0.
Apr 18 06:53:11 h2502988.stratoserver.net systemd[1]: networking.service: Main p
rocess exited, code=exited, status=1/FAILURE
Apr 18 06:53:11 h2502988.stratoserver.net systemd[1]: Failed to start Raise netw
ork interfaces.
Apr 18 06:53:11 h2502988.stratoserver.net systemd[1]: networking.service: Unit e
ntered failed state.
Apr 18 06:53:11 h2502988.stratoserver.net systemd[1]: networking.service: Failed
with result 'exit-code'.
Meu /etc/network/interfaces se parece com:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
Onde posso começar a depurar?
Obrigado por qualquer dica! Atenciosamente, K.
# sudo ifup --verbose eth0
Configuring interface eth0=eth0 (inet)
/bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/ethtool
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
/sbin/dhclient -1 -v -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases -I -df /var/lib/dhcp/dhclient6.eth0.leases eth0
Internet Systems Consortium DHCP Client 4.2.4
Copyright 2004-2012 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Usage: dhclient <snip>
Failed to bring up eth0.
Responder1
Isto somente aconteceu para mim. O motivo foi que havia uma inconsistência na dependência do pacote que interrompeu minha atualização de confiável para xenial, portanto, algumas versões de pacotes eram inconsistentes. No meu caso, a inconsistência foi causada por squid3 e ca-certificates-java.
Restaurei a conexão de rede executando apenas dhclient eth0
. Depois de resolver a inconsistência do pacote removendo os pacotes incorretos e executando o apt-get install -f
, executei apt-get dist-upgrade
e apt-get install ubuntu-standard
. Isso resolveu meu problema completamente.
O que me levou a suspeitar da inconsistência é que /sbin/ifup
o binário continha a dhclient
linha de comando desatualizada com a opção não mais suportada -I
. Deve ser uma inconsistência de versão do pacote.
Responder2
Presumo que você acabou de instalar/atualizar para um sistema operacional mais recente, como o Ubuntu 16.04, e devido ao afastamento dos esquemas tradicionais de nomenclatura de interface, como eth0
ou eth1
, o sistema não pode inicializar sua interface.
Tente editar /etc/network/interfaces
para usar ens32
ou ens192
em vez de eth0
curtir
# The loopback network interface
auto lo
iface lo inet loopback
# The Ethernet interface
auto ens192
iface ens192 inet dhcp
Isso deve permitir a reinicialização da interface de rede. Espero que ajude. Para obter detalhes sobre as alterações preditivas na interface de rede
https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
Responder3
Não tenho certeza se isso ainda é útil: parece que o dhclient não possui mais a opção "-I" ou "-df", que de acordo coma página de manualfaz DDNS:
-I Use o esquema DDNS padrão das RFCs 4701 e 4702.
Depois de remover essa opção da linha de comando, o dhclient será capaz de abrir o eth0.
[EDITAR]: Agora, se eu pudesse descobrir onde está a opção "-I"...
Responder4
Tente isto: -
sudo ifdown --exclude=lo -a && sudo ifup --exclude=lo -a
Então substitua networking restart
porifdown... && ifup....
Apenas como um aparte: ifconfig
também está obsoleto há muito tempo - use ip
do pacoteiproute2
Você poderia tentar também
ifconfig eth0 down && ifconfig eth0 up
(ou qualquer que seja o nome da sua interface de rede) para reiniciar a rede.