Linux - Wireless NetworkingThis forum is for the discussion of wireless networking in Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to set up WPA-PSK on my home network using wpa_supplicant. Everything seems to go well at first, but I get kicked off the network every 5-15 minutes or so. This is from wpa_cli:
Code:
<2>Associated with 00:0c:41:f4:43:fd
<2>WPA: Key negotiation completed with 00:0c:41:f4:43:fd [PTK=TKIP GTK=TKIP]
<2>CTRL-EVENT-CONNECTED - Connection to 00:0c:41:f4:43:fd completed (auth) [id=1 id_str=]
<2>CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
<2>Trying to associate with 00:0c:41:f4:43:fd (SSID='myessid' freq=2437 MHz)
<2>Authentication with 00:00:00:00:00:00 timed out.
<2>Trying to associate with 00:0c:41:f4:43:fd (SSID='myessid' freq=2437 MHz)
<2>Authentication with 00:00:00:00:00:00 timed out.
<2>Trying to associate with 00:0c:41:f4:43:fd (SSID='myessid' freq=2437 MHz)
<2>Authentication with 00:00:00:00:00:00 timed out.
<2>Trying to associate with 00:0c:41:f4:43:fd (SSID='myessid' freq=2437 MHz)
<2>Authentication with 00:00:00:00:00:00 timed out.
<2>Trying to associate with 00:0c:41:f4:43:fd (SSID='myessid' freq=2437 MHz)
<2>Associated with 00:0c:41:f4:43:fd
<2>WPA: Key negotiation completed with 00:0c:41:f4:43:fd [PTK=TKIP GTK=TKIP]
<2>CTRL-EVENT-CONNECTED - Connection to 00:0c:41:f4:43:fd completed (reauth) [id=1 id_str=]
Some notes:
Everything works perfectly without WPA
WPA works fine on another computer in the house with Windows XP.
OK, I upgraded to wpa_supplicant-0.5.9 (was using 0.5.7 earlier) to see if that did anything. The correct MAC address of my router is now printed instead of 00:00:00:00:00:00, but it still times out 4-5 times before it connects.
There is a phone, but I don't know what its frequency is. In any case, I don't think that would be the problem because there are no wireless problems except with WPA on Linux. Windows with WPA and Linux without WPA works fine.
When it finally auths, do you have a working (tested) connection (wpa_cli "status" showing "wpa_state=COMPLETED")? Any logging on the AP side? Would wpa_cli with "level 0" debugging show more output? Does "scan_results" by any chance show an AP near you using the same channel?
When it finally auths, do you have a working (tested) connection (wpa_cli "status" showing "wpa_state=COMPLETED")?
Yeah -- it will let me get on for about 5-15 minutes, during which I can do all my normal internet stuff, then I lose association with the AP and have to wait for it to reassociate.
Quote:
Originally Posted by unSpawn
Any logging on the AP side?
I'm not sure. I will check it out.
Quote:
Originally Posted by unSpawn
Would wpa_cli with "level 0" debugging show more output?
I tried this and it doesn't seem to show more output than normal. Do you know what the default level is?
Quote:
Originally Posted by unSpawn
Does "scan_results" by any chance show an AP near you using the same channel?
I turned on debugging output in wpa_supplicant and this is printed each time I get disconnected:
Code:
Wireless event: new AP: 00:00:00:00:00:00
Setting scan request: 0 sec 100000 usec
Added BSSID 00:0c:41:f4:43:fd into blacklist
It looks like it sees the AP 00:00:00:00:00:00 (whatever that is), and instead of adding it to the blacklist, it adds my router, thus kicking me off. It then cycles through trying to connect and failing, until it is removed from the blacklist and I can connect again. Is this a bug in wpa_supplicant?
IIGC function wpa_blacklist_add in (recent?) wpa_supplicant.c does: " add the specified BSSID to the blacklist or increases the blacklist count if the BSSID was already listed. It should be called when an association attempt fails either due to the selected BSS rejecting association or due to timeout. This blacklist is used to force wpa_supplicant to go through all available BSSes before retrying to associate with an BSS that rejected or timed out association. It does not prevent the listed BSS from being used; it only changes the order in which they are tried."
It's a can of worms, there's a lot of people having trouble with this blacklisting stuff. Before you continue you should save output from running wpa_supplicant with the "-dd" flag" and 'dmesg' after running 'echo 0xc80000 > /proc/sys/net/wlan0/debug' and see if that gives more information because you want to find the cause for the blacklist. Things to suggest include trying different kernel versions (two major releases ago, five minor releases ago, most recent), different wireless_tools and madwifi versions. Maybe first visit Madwifi tickets about blacklisting here http://madwifi.org/search?q=blacklis...n&changeset=on.
It's a can of worms, there's a lot of people having trouble with this blacklisting stuff. Before you continue you should save output from running wpa_supplicant with the "-dd" flag" and 'dmesg' after running 'echo 0xc80000 > /proc/sys/net/wlan0/debug' and see if that gives more information because you want to find the cause for the blacklist. Things to suggest include trying different kernel versions (two major releases ago, five minor releases ago, most recent), different wireless_tools and madwifi versions. Maybe first visit Madwifi tickets about blacklisting here http://madwifi.org/search?q=blacklis...n&changeset=on.
Thanks for the reply. As I mentioned, I tried using a different version of wpa_supplicant which did not fix the problem. I was going to try the development version last night but the site was down so I will do that later along with viewing the extended debug output with -dd and dmesg.
One thing though, I'm using ndiswrapper and not madwifi so I don't know if your advice for that applies to me.
I'm using ndiswrapper and not madwifi so I don't know if your advice for that applies to me.
If you don't use it, then it shouldn't. BTW, it could be beneficial to also post the exact details of the card like brand, type, chipset, just in case somebody here already fixed that kind of problem.
I don't know how you've setup your networking, but in Slackware-12.0 this is the proper way. Ignore my post if this is the way you did it.
First you should edit /etc/rc.d/rc.inet1.conf:
Code:
# /etc/rc.d/rc.inet1.conf
#
# This file contains the configuration settings for network interfaces.
# If USE_DHCP[interface] is set to "yes", this overrides any other settings.
# If you don't have an interface, leave the settings null ("").
# You can configure network interfaces other than eth0,eth1... by setting
# IFNAME[interface] to the interface's name. If IFNAME[interface] is unset
# or empty, it is assumed you're configuring eth<interface>.
# Several other parameters are available, the end of this file contains a
# comprehensive set of examples.
# =============================================================================
# Config information for eth0:
#IPADDR[0]="192.168.1.41"
#NETMASK[0]="255.255.255.0"
#USE_DHCP[0]="yes"
#DHCP_HOSTNAME[0]=""
# Config information for ath0:
IFNAME[1]="ath0"
IPADDR[1]="192.168.1.42"
NETMASK[1]="255.255.255.0"
#USE_DHCP[1]="yes"
#DHCP_HOSTNAME[1]=""
WLAN_ESSID[1]="philemon"
WLAN_MODE[1]=Managed
WLAN_RATE[1]="54M auto"
WLAN_CHANNEL[1]="10"
WLAN_WPA[1]="wpa_supplicant"
WLAN_WPADRIVER[1]="wext"
# Default gateway IP address:
GATEWAY="192.168.1.1"
# Change this to "yes" for debugging output to stdout. Unfortunately,
# /sbin/hotplug seems to disable stdout so you'll only see debugging output
# when rc.inet1 is called directly.
DEBUG_ETH_UP="yes"
You don't need any more than that. You should turn on debugging output here, and replace my information with yours.
Then you can edit /etc/wpa_supplicant.conf:
Code:
# See /usr/doc/wpa_supplicant-0.5.8/wpa_supplicant.conf.sample
# for many more options that you can use in this file.
# This line enables the use of wpa_cli which is used by rc.wireless
# if possible (to check for successful association)
ctrl_interface=/var/run/wpa_supplicant
# By default, only root (group 0) may use wpa_cli
ctrl_interface_group=0
eapol_version=1
ap_scan=1
fast_reauth=1
# WPA protected network, supply your own ESSID and WPAPSK here:
network={
scan_ssid=0
ssid="your_essid_here"
proto=WPA
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP WEP104 WEP40
psk=your_psk_here
}
# Plaintext connection (no WPA, no IEEE 802.1X),
# nice for hotel/airport types of WiFi network.
# You'll need a recent version of wireless-tools for this!
network={
ssid="any"
key_mgmt=NONE
priority=2
}
From the default file you only need to change "your_essid_here" to your ESSID, and add your key, replacing your_psk_here.
Thanks for the reply. As I mentioned, I am not using madwifi so I don't think that applies to me. As for chipset information, I'm not quite sure how to obtain all that since this is a USB device, not PCI, and it didn't seem to list it in the lsusb output. In any case, the output is here: http://pastebin.ca/844806 . I did all of the network setup stuff you mentioned, except I don't have scan_ssid=0 in wpa_supplicant.conf. I will add it and see if that makes a difference.
The default Slackware-12.0 /etc/wpa_supplicant.conf file has "scan_ssid=0" -- it's not something I added.
Thanks for posting the "lsusb" output. It lists your device as:
Code:
Bus 1 Device 2: ID 0846:4260 NetGear, Inc.
so I looked it up in the Linux USB ID database and it tells me it's "0846 NetGear, Inc. -- 4260 WG111v3 802.11g Adapter [realtek RTL8187B]. What module (driver) is your card using? I don't think that's an Atheros card - madwifi is just for Atheros chipsets. My post has ath0 and information that is Atheros specific ... you can adjust yours accordingly.
I'm pretty certain your card uses the RTL8187 module. That came out with kernel 2.6.23, so you can use the 2.6.23.12 kernel in Slackware-current with that module (no need for ndiswrapper) and then maybe wpa_supplicant will work.
I'm shooting darts in the dark, here ... no experience with that chipset.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.