9

I just installed Ubuntu 14.04 server on my computer that has both a wired network port and a wifi card. I would like for the server to use the wired network if is not available, and use wifi when it is not available.

The original /etc/network/interfaces look like the following:

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

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto p4p1
iface p4p1 inet dhcp

I followed this post and modified my file to be:

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

# The loopback network interface
auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet dhcp
wpa-ssid <my_ssid>
wpa-psk <my_ssid_password>

# The primary network interface
auto p4p1
iface p4p1 inet dhcp

When I restart wlan0, I'm able to connect to my wifi, no problem. If I restart the computer with my network cable plugged in, no problems either as both the wired and wifi connections connect to my network. However, if I have my wired connection unplugged and reboot, I see the message 'Starting configure network device' at startup. I then see the message 'waiting up to 60 more seconds for network configuration' before the system fully boots (so it waits 120+ seconds for the network). When the computer boots, my wifi connections is connected.

So, I guess things work, but the my headless server takes a long time to fully boot. What am I doing wrong? Is there anyway to fix this bootup lag? Thank you.

7

The declarations 'auto p4p1' and 'auto wlan0' ask the system to automatically start both interfaces. When you start with the ethernet detached and have asked that the interface start anyway, the system stumbles: "waiting up to 60 more seconds for network configuration."

It would be more efficient, but certainly not automatic, to leave out the 'auto' declaration:

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

# The loopback network interface
auto lo
iface lo inet loopback

#auto wlan0
iface wlan0 inet dhcp
wpa-ssid <my_ssid>
wpa-psk <my_ssid_password>

# The primary network interface
#auto p4p1
iface p4p1 inet dhcp

And start either interface manually as needed:

sudo ifup -v wlan0
  • Thanks for explaining. I reduced sleep time at the three locations in /etc/init/failsafe as described at tech.pedersen-live.com/2012/05/…. – Vinh Nguyen Oct 25 '14 at 19:06
  • Old question I know, but I'm curious how to make the setting stick. I have to do the manual start each time I reboot. Thanks. – Chuck Claunch Feb 2 '16 at 14:49
  • @ChuckClaunch Please start your own new question and explain in detail what you need. Please include: cat /etc/network/interfaces Please obscure your password. – chili555 Feb 2 '16 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.