ifconfig will not configure wlan0 on boot, but it comes up fine after boot

Asked by Mary Gardiner

We are using a new wireless card in a non-graphical Ubuntu install. We are configuring this card in /etc/network/interfaces.

The interface does not successfully connect to the wireless network during boot. (Instead we get the "Waiting 60 more seconds" and "Booting without full network" messages. However, if, soon after boot, we run "ifup wlan0" the network card is configured and connects to the network successfully.

This is a problem as this machine does not usually have a keyboard or monitor attached. We would therefore like to not have to manually intervene in the network configuration on each boot.

Following information after a successful manual "ifup wlan0":

$ sudo lshw -c network
  *-network:0
       description: Wireless interface
       product: AR9287 Wireless Network Adapter
       vendor: Atheros Communications Inc.
       physical id: 0
       bus info: pci@0000:04:00.0
       logical name: wlan0
       version: 01
       serial: f8:d1:11:8c:5e:76
       width: 32 bits
       clock: 66MHz
       capabilities: pm bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=ath9k driverversion=3.0.0-15-generic-pae firmware=N/A ip=192.168.178.23 latency=168 link=yes multicast=yes wireless=IEEE 802.11bgn
       resources: irq:21 memory:50000000-5000ffff
  *-network:1 DISABLED
       description: Ethernet interface
       product: RTL8139 Ethernet
       vendor: D-Link System Inc
       physical id: 1
       bus info: pci@0000:04:01.0
       logical name: eth0
       version: 10
       serial: 00:1b:11:52:41:2e
       size: 10Mbit/s
       capacity: 100Mbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=8139too driverversion=0.9.28 duplex=half latency=32 link=no maxlatency=64 mingnt=32 multicast=yes port=MII speed=10Mbit/s
       resources: irq:22 ioport:1000(size=256) memory:50011000-500110ff
  *-network:2 DISABLED
       description: Ethernet interface
       product: PRO/100 VE Network Connection
       vendor: Intel Corporation
       physical id: 8
       bus info: pci@0000:04:08.0
       logical name: eth1
       version: 01
       serial: 00:19:d1:f5:5c:41
       size: 10Mbit/s
       capacity: 100Mbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e100 driverversion=3.5.24-k2-NAPI duplex=half firmware=N/A latency=32 link=no maxlatency=56 mingnt=8 multicast=yes port=MII speed=10Mbit/s
       resources: irq:20 memory:50010000-50010fff ioport:1100(size=64)

$ sudo grep -v "^#" /etc/network/interfaces

auto lo
iface lo inet loopback

auto wlan0

iface wlan0 inet dhcp
 wpa-ssid <our ssid>
 wpa-psk "<our-psk>"

$ ifconfig
lo Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:16436 Metric:1
          RX packets:415 errors:0 dropped:0 overruns:0 frame:0
          TX packets:415 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:53400 (53.4 KB) TX bytes:53400 (53.4 KB)

wlan0 Link encap:Ethernet HWaddr f8:d1:11:8c:5e:76
          inet addr:192.168.178.23 Bcast:192.168.178.255 Mask:255.255.255.0
          inet6 addr: fe80::fad1:11ff:fe8c:5e76/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:678 errors:0 dropped:0 overruns:0 frame:0
          TX packets:380 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:98496 (98.4 KB) TX bytes:61961 (61.9 KB)

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gnome-nettool Edit question
Assignee:
No assignee Edit question
Solved by:
Mary Gardiner
Solved:
Last query:
Last reply:
Revision history for this message
A. Denton (aquina) said :
#1

Hello Mary!

I assume you know enough about the configuration of network interface cards. Therefore I recommend you to ether fix it with a cron-entry or query your favourite serach engine.

Revision history for this message
Mary Gardiner (puzzlement) said :
#2

Search engines were queried, thanks for the tip. Wireless failures are

I've found the solution: for the benefit of the search engines in question, if /etc/network/interfaces has the shared key in it, it is tempting to chmod it 0600, and there's at least one website recommending it. However, this seems to cause the interface to fail to come up at boot, although I haven't tracked down which component of the process can't read the file (and probably won't).

But one can do this in /etc/network/interfaces

iface wlan0 inet dhcp
        wpa-conf /etc/wpa_supplicant.conf

And then /etc/wpa_supplicant.conf (which can be 0600 if you like):

network={
        ssid="SOMETHING"
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk="SOMETHING"
}