With the great help in WLAN using Netgear WNA1000M fails - what am I doing wrong? I managed to get my wireless network working on Raspbian running on my RPi.
But - I need to manually run the wpa_supplicant
command
wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -Dwext
in order to connect to the wireless network. Once I run this command, an IP address is automatically received via DHCP and everything is fine.
It's just not working automatically when I boot.
How do I change this?
My /etc/network/interfaces
file looks like this:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
Am I missing something in here?
4 Answers 4
I got it.
I had to replace wpa-roam
by wpa-conf
.
If anyone could explain why, I'd be happy ;-)
-
2wpa-roam uses a different config file which is used for WiFi roaming. You can define sever SSID in there and if one dies it connects to the other. It also means that if you only have 1 then it will reconnect to that one if it disconnects for what ever reason. Using wpa conf you need to restart the interface manually for it to reconnect.Piotr Kula– Piotr Kula2014年02月04日 19:58:05 +00:00Commented Feb 4, 2014 at 19:58
I found this "outdated" tutorial on the Ubuntu forums: How To: set up wpa_supplicant roaming mode and automatically start at boot, and it works just fine. The id_str is optional, but allows you to use different /etc/network/interfaces entries with different wireless networks.
network={
ssid="MyNetwork"
#psk="text passphrase"
psk=(a huge long number here)
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
id_str="home"
}
and then match that up with a corresponding entry in /etc/network/interfaces:
# This entry is used for any wireless networks without an id_str property
iface default inet dhcp
# This is for wireless networks with an id_str="home"
iface home inet dhcp
and that will cause the wireless network to connect at boot time. My testing didn't work at first, but it turned out that my router wasn't answering the DCHPDISCOVER requests. Editing /etc/network/interfaces to look like this:
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
wpa-debug-level 3
and then running
ifup wlan0 && tail -f /var/log/syslog
allowed me to watch the loading process and find the issue with DHCP.
I am not sure why you needed to replace wpa-roam with wpa-conf. I have a wireless lan adapter (as I assume you do too -- wlan0 implies as much).
My setup checks for and connects to a configured network when booting. I am attaching the file below for your consideration.
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
-
As far as I found out so far roam does not work with DHCP, only with manual IP assignment. And this is exactly where our configurations differ.Golo Roden– Golo Roden2012年12月08日 08:25:16 +00:00Commented Dec 8, 2012 at 8:25
-
An easier (and more straight forward configuration would beJeremy Harrison– Jeremy Harrison2012年12月21日 14:21:02 +00:00Commented Dec 21, 2012 at 14:21
-
This [linux-magazine.com/Online/Blogs/Productivity-Sauce/… provides a much more straight forward configuration.Jeremy Harrison– Jeremy Harrison2012年12月21日 15:13:40 +00:00Commented Dec 21, 2012 at 15:13
-
@JeremyHarrison Your link appears to be broken.starbeamrainbowlabs– starbeamrainbowlabs2014年04月08日 14:29:46 +00:00Commented Apr 8, 2014 at 14:29
-
this link worked for me: linux-magazine.com/Online/Blogs/Productivity-Sauce/…Steffen Roller– Steffen Roller2015年03月07日 05:07:40 +00:00Commented Mar 7, 2015 at 5:07
As per this advice, I've installed wicd and configured my wifi connection through wicd-curses. And never looked back since.
sudo apt-get install wicd
sudo apt-get install wicd-curses
And then setup by running:
wicd-curses