LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Wireless Networking (https://www.linuxquestions.org/questions/linux-wireless-networking-41/)
-   -   wpa + madwifi - I'm close, but NO connection (https://www.linuxquestions.org/questions/linux-wireless-networking-41/wpa-madwifi-im-close-but-no-connection-491953/)

iminj 10-12-2006 09:24 PM

wpa + madwifi - I'm close, but NO connection
 
I'm using Wolvix 1.0.4 (SLAX Variant) on a usb key. My hardware is atheros mini-pci (a/b/g) on a ThinkPad. I am trying to connect to a wireless router (D-Link 624) with WPA-PSK encryption.

WinXP connects fine with this hardware, and Wolvix is perfect in WEP mode.

Here's the output from my terminal:
---------------------------------------------------------------
root@wolvix ~ > ifconfig ath0 down
root@wolvix ~ > iwconfig ath0 essid S4nr5.1
root@wolvix ~ > ifconfig ath0 up
root@wolvix ~ > wpa_supplicant -iath0 -c/etc/wpa_supplicant.conf -Dmadwifi
Trying to associate with 00:0d:88:b8:97:1c (SSID='S4nr5.1' freq=2412 MHz)
Associated with 00:0d:88:b8:97:1c
Authentication with 00:0d:88:b8:97:1c timed out.
Disconnect event - remove keys
Trying to associate with 00:0d:88:b8:97:1c (SSID='S4nr5.1' freq=2412 MHz)
Associated with 00:0d:88:b8:97:1c
WPA: Key negotiation completed with 00:0d:88:b8:97:1c [PTK=TKIP GTK=TKIP]
Disconnect event - remove keys
Trying to associate with 00:0d:88:b8:97:1c (SSID='S4nr5.1' freq=2412 MHz)
Associated with 00:0d:88:b8:97:1c
WPA: Key negotiation completed with 00:0d:88:b8:97:1c [PTK=TKIP GTK=TKIP]
Disconnect event - remove keys
Trying to associate with 00:0d:88:b8:97:1c (SSID='S4nr5.1' freq=2412 MHz)
Associated with 00:0d:88:b8:97:1c
WPA: Key negotiation completed with 00:0d:88:b8:97:1c [PTK=TKIP GTK=TKIP]
-------------------------------------------------------------
The system goes into a loop (connect/disconnect), and never completes the process and never gives me back "root >" control of the terminal.

Here's my wpa_supplicant.conf:
--------------------------------------------------
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
#ap_scan=1
#fast_reauth=1

network={
ssid="S4nr5.1"
key_mgmt=WPA-PSK
proto=WPA
pairwise=TKIP
group=TKIP
psk="My63CharacterAlphaNumericPasskey"
}
------------------------------------------------
I've tried uncommenting various combinations of the 1st 4 lines, but it doesn't seem to change the results.

Anyone have any ideas to help me connect ? Thank you.

Fluxx 10-13-2006 04:55 AM

Quote:

Originally Posted by iminj
root@wolvix ~ > wpa_supplicant -iath0 -c/etc/wpa_supplicant.conf -Dmadwifi

May be a -Dwext instead of -Dmadwifi will give you another result ...

I start wpa_supplicant in this way with madwifi driver for ath0:

"wpa_supplicant -iath0 -c/etc/wpa_supplicant.conf -Dwext -B"

and go on then with my "iwconfig" commands.

Fluxx.

iminj 10-13-2006 08:03 AM

Thank you Fluxx:

Unfortunately, -Dwext (and I also tried -Dwext -B) crashed and didn't associate at all with the Access Point. Here's the terminal output:

----------------------------------------------
root@wolvix ~ > ifconfig ath0 down
root@wolvix ~ > iwconfig ath0 essid S4nr5.1
root@wolvix ~ > ifconfig ath0 up
root@wolvix ~ > wpa_supplicant -iath0 -c/etc/wpa_supplicant.conf -Dwext
ioctl[SIOCSIWAUTH]: Operation not supported
Failed to enable WPA in the driver.
ioctl[SIOCSIWAUTH]: Operation not supported
Failed to disable WPA in the driver.
ioctl[SIOCSIWAUTH]: Operation not supported
ioctl[SIOCSIWAUTH]: Operation not supported
ioctl[SIOCSIWENCODEEXT]: Operation not supported
ioctl[SIOCSIWENCODEEXT]: Operation not supported
ioctl[SIOCSIWENCODEEXT]: Operation not supported
ioctl[SIOCSIWENCODEEXT]: Operation not supported
root@wolvix ~ >
-------------------------------------------------
Back to -Dmadwifi I guess ?

I am broadcasting my SSID (some forums state I should when debugging WPA), and I am using the following wpa_supplicant slax module:
wpa_supplicant_0_3_9.mo

If there are any other thoughts or ideas, I'd appreciate hearing them. THANKS !

iminj 10-13-2006 08:45 AM

I discovered an updated SLAX module:
wpa_supplicant_0_4_8.mo

Unfortunately, the module will not mount ("SQUASHFS error major/minor mismatch" during the boot). I suppose it's incompatible with my kernel version.

So, I'm back to the original module (wpa_supplicant_0_3_9.mo) and madwifi driver - but no connection.

Any advice? Thank you.

Fluxx 10-13-2006 08:55 AM

Which kernel does Wolvix-1.0.4 use?

"uname -r" should give you the running kernel.

I use Slax with kernel 2.6.16 and a madwifi pcmcia card with WPA2 without problems. My wpa version is 0.4.9 and is compiled against madwifi version 0.9.2.

If you run the same kernel, I can give you the wpa.mo out of my running Slax.

Fluxx.

P. S.: Another idea: Does your router accept new wireless devices or does the router block new mac adresses? May be that the router is the problem ... I remember that in D-Link 624+ was an option to allow or block mac adresses with a mac filter ...

iminj 10-13-2006 02:32 PM

Wolvix 1.0.4 uses the 2.6.12.2 kernel, so I don't think I can use your slackware modules. Thanks for the offer anyway !!

I borrowed a Linksys router (WRT54-G) and set it up with my SSID and WPA keys - but received the same unfavorable results - so that probably rules out router issues.

I use MAC Filtering, but it shouldn't be an issue since I dual boot my laptop (WinXP and Wolvix), and WinXP connects to the router using WPA-PSK without any problems. Just to be 100% sure, I'll disable MAC filtering, and report back later if I get a better result.

Here's a question: How close am I to a connection? Based on the terminal output, my wireless card is associating with the router, and it seems to be completing "key negotiation". Of course, it stalls out there ... but WHAT IS SUPPOSED TO HAPPEN NEXT, if this was actually working properly ?

Thanks.

Fluxx 10-13-2006 03:14 PM

Here is the way I start my ath0 (I use this way, because I have several wireless cards and therefore several scripts to bring them up):

Code:

#!/bin/bash
/sbin/ifconfig eth0 down
killall wpa_supplicant > /dev/null 2>&1
/sbin/rmmod ath_pci
/sbin/modprobe ath_pci countrycode=0
/sbin/iwpriv ath0 mode 3
/sbin/iwpriv ath0 turbo 1
/usr/local/sbin/wpa_supplicant -iath0 -c/etc/wpa_supplicant.conf -B -Dwext
/sbin/iwconfig ath0 channel 2 essid "my_essid"
/sbin/iwconfig ath0 channel 2 mode managed
/sbin/iwconfig ath0 rts 1401 frag 1400
/sbin/ifconfig ath0 my_static_IP up
/sbin/route add default gateway router_IP
/sbin/iwconfig ath0 txpower 1 rate 108M auto

Fluxx.

iminj 10-13-2006 03:36 PM

Thanks for the ath0 startup script Fluxx. What I'd really like to see is your terminal output after you enter wpa_supplicant command ... so I can see what should be happening on my system.

By the way, I disabled MAC Filtering on my router, but it made no difference. Interesting though - I was looking through the router logs, and it clearly shows my wireless card's MAC Address Connecting > then Authenticating > then Authentication Success. (even before I disabled MAC Filtering).

I'm making a connection - but something is not finishing the process.

If I can't move forward with this, I'm going to try a different LiveLinux distro that has a more recent wpa_supplicant and updated madwifi drivers. Wolvix has a new beta version that might accept the later slax wpa_supplicant module. Any other suggestions anyone ?

Fluxx 10-13-2006 05:26 PM

To give you the output of a terminal I run wpa_supplicant in a terminal without -B (this is normally the function to run it as daemon in the background):

Code:

root@evon600c:~# /usr/local/sbin/wpa_supplicant -iath0 -c/etc/wpa_supplicant.conf -Dwext
Trying to associate with MAC_of_my_AP (SSID='my_essid' freq=2417 MHz)
Associated with MAC_of_my_AP
WPA: Key negotiation completed with MAC_of_my_AP [PTK=CCMP GTK=CCMP]
CTRL-EVENT-CONNECTED - Connection to MAC_of_my_AP completed (auth) [id=0 id_str=]
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
Associated with MAC_of_my_AP
WPA: 4-Way Handshake failed - pre-shared key may be incorrect
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
Associated with MAC_of_my_AP
WPA: Key negotiation completed with MAC_of_my_AP [PTK=CCMP GTK=CCMP]
CTRL-EVENT-CONNECTED - Connection to MAC_of_my_AP completed (reauth) [id=0 id_str=]

Here the output in the terminal stops while in the meantime I have started the script mentioned in my last post without the lines concerning the wpa_supplicant.

Fluxx.

iminj 10-14-2006 08:45 AM

Quote:

Associated with MAC_of_my_AP
WPA: Key negotiation completed with MAC_of_my_AP [PTK=CCMP GTK=CCMP]
CTRL-EVENT-CONNECTED - Connection to MAC_of_my_AP completed (reauth) [id=0 id_str=]
Fluxx:

These are the last 3 lines of your wpa_supplicant output. I get similar output, EXCEPT I never receive the "CTRL-EVENT-CONNECTED" confirmation. Instead, I receive a "Disconnect event - remove keys". That's the part I can't understand.

After the CTRL-EVENT-CONNECTED, does your terminal return you to root > (so you can continue issuing commands), or do you have to open a separate terminal screen to continue with dhcp etc.? (My terminal - aterm - locks up at this point. Only Ctrl-C gives me back control).

Thanks so much for your patience !!
-iminj

Fluxx 10-14-2006 08:54 AM

Look at my output: I have also these lines you mentioned, "Disconnect event - remove keys", until I start in a second terminal all the other commands after the line with wpa_supplicant.

Just open another terminal and configure your wlan device with your needed options "iwconfig ..." "ifconfig ..." or "dhcpcd ...".

I think you are very close.

And if it will work with the two terminals you can do all your commands in one terminal with the option -B in the wpa_supplicant line.

Fluxx.

iminj 10-15-2006 12:18 PM

**** Solved ! ****
 
Quote:

Fluxx
.... Just open another terminal and configure your wlan device with your needed options "iwconfig ..." "ifconfig ..." or "dhcpcd ...".

I think you are very close.
Happiness is a WPA-PSK connection that works ! I knew I was close, and thanks to you, it's working.

The trick was opening a second terminal to finish the iwconfig/ifconfig/dhcpcd commands once wpa_supplicant completed Key negotiation. Then I was able to ping addresses both inside my network, and internet addresses also. Now I have the commands in /etc/rc.d/rc.local - and I get a WPA-PSK connection automatically when I boot.

For some strange reason Firefox browser won't open after I run these scripts either manually or through rc.local, but all other network applications connect. (I think I'll try to fix that at my distro's forum).

Thanks Fluxx !!


All times are GMT -5. The time now is 06:51 AM.