Ubuntu 16.04 - system boot waits saying "Raise network interfaces"

76,569

Solution 1

It seems someone was paranoid about a client not getting it's DHCP in time.

Edit this file /etc/dhcp/dhclient.conf and set timeout to a reasonable value, like

timeout 15

The default value of 300 seconds is way too high. The suggested replacement value of 15 was tested and works fine.

Solution 2

So in your /etc/network/interfaces, change this:

# The primary network interface
auto eth0
iface eth0 inet dhcp

to this:

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

This will start interface eth0 when the kernel detects a hotplug event from the interface (i.e. when you plug a cable in), instead of starting it at boot.

Solution 3

As referenced in you can change the timeout value for raising the network interface (if running systemd):

Open a terminal window, and enter the command:

sudo nano /etc/systemd/system/network-online.target.wants/networking.service

Then change the line TimeoutStartSec=5min to a value that you choose. Save the file by pressing Ctrl+o and then Ctrl+x.

Finally, restart the daemon:

sudo systemctl daemon-reload
Share:
76,569

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin over 1 year

    I have an Ubuntu 16.04 system with two interfaces - eth0 configured with DHCP and eth1 configured with static ip addresses.

    The /etc/network/interfaces file has the following config

    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    auto eth0
    iface eth0 inet dhcp
    
    # The Secondary network interface
    auto eth1
    iface eth1 inet static
    address 10.10.1.10
    netmask 255.255.255.0
    dns-nameservers 74.82.42.42 4.2.2.2
    
    ## Virtual Interfaces for virtual hosts
    auto eth1:11
    iface eth1:11 inet static
    address 10.10.1.11
    netmask 255.255.255.0
    
    auto eth1:12
    iface eth1:12 inet static
    address 10.10.1.12
    netmask 255.255.255.0
    
    auto eth1:13
    iface eth1:13 inet static
    address 10.10.1.13
    netmask 255.255.255.0
    

    The issue is, when DHCP server is not available on eth0 link or if the eth0 link is down, the system hangs for 5 mins, significantly slowing down the boot process.

    violet@ubuntu-xenial:~$ systemd-analyze blame
          5min 241ms networking.service
              1.529s nmbd.service
              1.524s winbind.service
    

    I tried reducing the time in /etc/systemd/system/network-online.target.wants/networking.service file which makes the system boot faster without waiting for the network service, however, that fails to load the virtual interfaces on eth1.

    Is there a cleaner way to let the system boot without full network configuration on eth0 interface and still load all the static network configuration on eth1?

  • dtoubelis
    dtoubelis about 7 years
    This approach works well on physical hardware but it fails in virtualized environments (tried vmware and virtualbox). It looks like the virtualized kernel does not generate proper events.
  • Ashley Hughes
    Ashley Hughes almost 7 years
    Thank you. Labing DNS/DHCP at the moment and the 5 minute waits were killing me.
  • Joseph Jaramillo
    Joseph Jaramillo over 6 years
    This approach also fixed my issues after installing a new 10G network adapter in a box that previously only had built-in 1G. Ubuntu was able to see the card and load drivers, but the boot kept stalling waiting for Raise Network Interfaces. Adjusting the device name from eth0 accordingly fixed it.
  • Charles Green
    Charles Green over 6 years
    It is generally a poor idea to start a GUI program using sudo... I have modified your answer to utilize tools which behave a bit better.
  • William T Froggard
    William T Froggard about 6 years
    Ubuntu has a number of odd default configs. It's been interesting...
  • David Tabernero M.
    David Tabernero M. about 6 years
    Wow, this will be really useful in further configurations.
  • Yitz
    Yitz over 5 years
    This is the correct answer for me. My computer is not always connected to network at boot-up. I don't want to wait 5 minutes for Ubuntu to figure that out.
  • xinthose
    xinthose over 5 years
    This does not work on Ubuntu 18, but this answer does.
  • Clayton Dukes
    Clayton Dukes over 5 years
    I'd love to know who the idiot is that thought a timeout of 5 minutes was a "good idea".
  • Wajih
    Wajih about 5 years
    After all these years it still valid for me :)