25

I have my network setting stored in /etc/wpa_supplicant.conf and my /etc/network/interfaces looks like this:

auto lo, eth0, wlan0
iface lo inet loopback
iface eth0 inet dhcp
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant.conf

To connect to the network I have to run sudo ifconfig wlan0 up followed by sudo ifup wlan0 after every boot. Not ideal as im running raspbmc

How can I get wlan0 up and connect on boot, I have tried added the commands to /etc/rc.local but that didn't work.

  • Shouldn't wpa-conf /etc/wpa.conf be wpa-conf /etc/wpa_supplicant.conf to point to your wireless network settings? I just got WiFi working on raspbmc last night. When I get home today I'll test how my setup behaves across reboots. – HeatfanJohn Oct 15 '12 at 19:06
  • Opps was a typo in the question not in my settings however. /etc/network/interfaces points to the /etc/wpa_supplicant.conf – iiSeymour Oct 15 '12 at 19:11
  • Not related to your problem, but I also suspect that iface iface lo inet loopback is also a typo, should be iface lo inet loopback. Loopback interface configuration. – HeatfanJohn Oct 16 '12 at 2:00
  • Damn my lack of proof reading skills – iiSeymour Oct 16 '12 at 7:17
16

I changed auto to allow-hotplug for wlan0 in my /etc/network/interfaces, see below:

pi@raspbmc:~$ cat /etc/network/interfaces
#auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

That worked for me!

I'm really not sure why this worked. The Debian documentation at this link is confusing to me because this is all new to me, however the ifquery command shown below now returns wlan0 and this command is used by /etc/init.d/networking to determine which interfaces to bring up. Previously with wlan0 as auto, ifquery --list --alow=hotplug didn't return anything.

pi@raspbmc:~$ ifquery --list --allow=hotplug
wlan0
  • 1
    I've spent ages trying to get my device online. why does the google not spit this out immediately? :) thank you <3 – increddibelly Dec 26 '17 at 19:54
  • If this answer does not work (I can't say for 2012, but it does not in 2019), consider replacing dhcp with manual. – Eric Platon Mar 12 at 2:52
6

Your original config was ok, except for the comma's in your first line.

So use auto lo eth0 wlan0 instead...

My config:

  auto lo wlan0

  iface lo inet loopback

  iface wlan0 inet manual
    wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

  iface default inet static
    address 10.0.0.81
    network 10.0.0.0
    netmask 255.255.254.0
    gateway 10.0.0.1

~

  • Darn commas had me screwed up on Debian Jessie. Does anyone know why commas seem to work on some Debian Wheezy but not Jessie? – Damian Silva Feb 17 '16 at 19:23

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.