I use my laptop at several different locations, each with their different wireless LAN configuration. I use wpa_supplicant the "Debian way", via the /etc/init.d/wpa-ifupdown script and /etc/network/interfaces file.
When I take my laptop to a open (public) wifi, the card will associate and get an IP automatically with no problems. It will not automatically associate to my home or work accesspoints which are using WPA/WPA2. In order to get wpa_supplicant to associate with my home/work AP I have to do
ifdown ath0
/etc/init.d/wpaifupdown stop
ifup ath0
Nothing else will work. After this is done, I can issue a
ifdown ath0
and it will automatically reconnect in less than a second. Before doing the "wpaifupdown stop" thing I can see that wpa_supplicant is _trying_ to associate with my home/work AP:
Code:
wpa_cli -i ath0 (before /etc/init.d/wpa-ifupdown stop)
<2>Trying to associate with 00:15:29:30:86:e6 (SSID='MyAP' freq=2427 MHz)
<1>Cancelling scan request
<1>WPA: using IEEE 802.11i/D3.0
<1>WPA: using GTK CCMP
<1>WPA: using PTK CCMP
<1>WPA: using KEY_MGMT WPA-PSK
<1>Setting authentication timeout: 10 sec 0 usec
<2>Authentication with 00:00:00:00:00:00 timed out.
<1>Setting scan request: 0 sec 0 usec
<2>Trying to associate with 00:15:29:30:86:e6 (SSID='MyAP' freq=2427 MHz)
<1>Cancelling scan request
<1>WPA: using IEEE 802.11i/D3.0
<1>WPA: using GTK CCMP
<1>WPA: using PTK CCMP
<1>WPA: using KEY_MGMT WPA-PSK
<1>Setting authentication timeout: 10 sec 0 usec
<2>Authentication with 00:00:00:00:00:00 timed out.
<1>Setting scan request: 0 sec 0 usec
--- This is where I issued /etc/init.d/wpa-ifupdown stop ---
<2>CTRL-EVENT-TERMINATING - signal 15 received
'PING' command timed out.
Connection to wpa_supplicant lost - trying to reconnect
My /etc/wpa_supplicant/wpa_supplicant.conf:
Code:
ctrl_interface=/var/run/wpa_supplicant
update_config=0
ap_scan=1
# My home network
network={
ssid="MyAP"
scan_ssid=1
bssid=00:15:29:30:86:E6
id_str="home"
psk="MyPSK"
proto=WPA
key_mgmt=WPA-PSK
priority=100
disabled=0
}
# This is the default open network to which the wlan card will connect
# without any problems
network={
key_mgmt=NONE
priority=10
disabled=0
}
And here's the /etc/network/interfaces file:
Code:
# 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 ath0
iface lo inet loopback
# Ethernet card
iface eth1 inet dhcp
# This is the physical wlan interface (has to be manual)
iface ath0 inet manual
wpa-driver wext
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
# Logical interfaces that are linked to id_str's in wpa_supplicant.conf
# Home network
iface home inet dhcp
# Generic (default) wlan network
iface default inet dhcp