16

The networking service fails to start / doesn't start on reboot.

Restarting networking (via systemctl): networking.serviceJob for networking.service failed because the control process exited with error code.

I can still access the server via remote console, but nothing else, since without network, there is no way out nor in.

systemctl status networking.service says:

● 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'.

My /etc/network/interfaces looks like:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

Where can I start to debug?

Thanks for any hint! Regards, 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.
5
  • 1
    The system tries to bring your network interface up by executing, one by one, the scripts that are located in /etc/network/if-up.d. One of these contains a dhclient command that fails. So do something like grep -R dhclient /etc/network/if-up.d/* and see what you get.
    – Jos
    Apr 18, 2016 at 8:07
  • Thanks for this information. There is no dhclient command, not in if-up.d nor above. Apr 18, 2016 at 8:16
  • Can you do a manual sudo ifup --verbose eth0 to see where things go wrong?
    – Jos
    Apr 18, 2016 at 9:30
  • I added the output of # sudo ifup --verbose eth0 to my question. Apr 18, 2016 at 13:58
  • The presence of the "Usage:..." lines makes it look as if the dhclient command fails because there is an error in the parameters. Yet as far as I can tell the command is correct. Moreover, I have the same "Usage" lines in my /var/log/syslog. You could try to execute the dhclient command manually on its own. If no error message follows, there is no issue with dhclient.
    – Jos
    Apr 18, 2016 at 15:02

6 Answers 6

11

This just happened to me. The reason was that there was a package dependency inconsistency that interrupted my upgrade from trusty to xenial, so some package versions were inconsistent. In my case the inconsistency was caused by squid3 and ca-certificates-java.

I restored the network connection by running just dhclient eth0. After resolving the package inconsistency by removing the offending packages and running apt-get install -f, I ran apt-get dist-upgrade and apt-get install ubuntu-standard. This resolved my problem completely.

What led me to suspect the inconsistency is that /sbin/ifup binary contained the outdated dhclient command line with the no longer supported -I option. It must be a package version inconsistency.

2
  • somehow my do-release-upgrade also got stuck, and this worked also for me, thanks!.
    – Evert
    Aug 31, 2016 at 11:53
  • Thanks so much, dhclient eth0 saved us today, thanks God. Nov 9, 2022 at 13:56
7

I am assuming that you have just installed/upgraded to a newer OS such as Ubuntu 16.04, and due to the departure from the tradition interface naming schemes such as eth0 or eth1, the system cannot start up you interface.

Try editing your /etc/network/interfaces to either use ens32 or ens192 instead of eth0 like

# The loopback network interface
auto lo
iface lo inet loopback

# The Ethernet interface
auto ens192
iface ens192 inet dhcp

That should enable you network interface restart. I hope it helps. For details about the predictive network interface changes

https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/

2
  • the fix for me was: askubuntu.com/a/830163/543586
    – theINtoy
    Apr 15, 2017 at 10:05
  • What a life saver. This is exactly what was keeping my virtual linux host from getting back into the network after they performed a forced kernel update for meltdown. mine was ens3 (do ip link show and find which ens applies to you)
    – Patrick F
    Jan 19, 2018 at 4:40
2

Not sure if this is still useful: It seems that the dhclient no longer has the "-I" or "-df" option, which according to the man page does DDNS:

-I Use the standard DDNS scheme from RFCs 4701 & 4702.

Once I remove that option from the command line, dhclient is able to bring up eth0.

[EDIT]: Now if I could find where that "-I" option is...

3
  • 1
    I am trying to figure out where the "dhclient" command is called with those options. I temporarily got the network up by manually running the dhclient command without those two options. -- I don't seem to have enough reputation to comment elsewhere so I'm adding to my own answer here.
    – Wei Wang
    Aug 9, 2016 at 17:27
  • 1
    TLin (below) is right. The isc-dhcp-client package was stuck on an older version. Good catch! I just had to do an "apt-get install isc-dhcp-client" to get 4.3.3 installed and the system is happy after that.
    – Wei Wang
    May 9, 2017 at 14:28
  • Wei Wang: Thanks a lot, reinstalling 'isc-dhcp-client' like you suggested did the trick! I managed to kill the host (VM guest!) in the middle of a do-release-upgrade, which wasn't exactly smart. Now I can get on with fixing this stuff via ssh and with networking again! Thanks.
    – stolsvik
    Mar 10, 2018 at 8:51
1

I had a similar issue as OP and Wei Wang, where ifup was trying to run dhclient with the -I option, but my dhclient was an older version which didn't support it. My guess is this was due to my previous hacky way to download/install the Xenial (16.04) Chromium while keeping my system on Trusty (14.04), it must have also upgraded some other parts of my system.

Long story short, my fix was to manually download and install the relevant packages related to dhclient in upstream Xenial. There's three packages required, and it needs to be installed in the following order:

  1. libisc-export160 (https://ubuntu.pkgs.org/16.04/ubuntu-main-amd64/libisc-export160_9.10.3.dfsg.P4-8_amd64.deb.html)
  2. libdns-export162 (https://ubuntu.pkgs.org/16.04/ubuntu-main-amd64/libdns-export162_9.10.3.dfsg.P4-8_amd64.deb.html)
  3. isc-dhcp-client_4.3.3 (https://ubuntu.pkgs.org/16.04/ubuntu-main-amd64/isc-dhcp-client_4.3.3-5ubuntu12_amd64.deb.html)

After that, dhclient --version showed I had 4.3.3 which supports the -I option, and I was able to use ifup again.

0

Try this:-

sudo ifdown --exclude=lo -a && sudo ifup --exclude=lo -a

So replace networking restart with ifdown... && ifup....

Just as an aside: ifconfig has also been deprecated for a long time - use ip from the package iproute2

You could try also

ifconfig eth0 down && ifconfig eth0 up

(or whatever your network interface is called) to restart the network.

0

@jos mentions in a comment on the original post:

The presence of the "Usage:..." lines makes it look as if the dhclient command fails because there is an error in the parameters...

I had this precise problem and the verbose logging was the hint.

ifup --verbose eth0

Look for output explaining DHCP parameters.

I then took the output from:

/sbin/dhclient -4 -v -pf /run/dhclient.eth0.pid -if /var/lib/dhcp/dhclient.eth0.leases -I -df /var/lib/dhcp/dhclient6.eth0.leases eth0

to simply:

/sbin/dhclient -4 -v -pf /run/dhclient.eth0.pid eth0 and then I got an address.

I believe some software update made dhclient get out of sync what was happening on my Debian 7.11 system.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .