basic WPA help please


Forum: Networking
Topic: basic WPA help please
started by: setecio

Posted by setecio on Aug. 08 2007,16:14
Hi all.

I'm hoping for a bit of help setting up WPA. I have wireless working without encryption, but I wouldn't class myself much beyond a Linux / DSL beginner.

DSL3.3, Using a Netgear WG511T atheros chipset so it is automatically recognised by DSL.

Without WPA, I switch on and type :
Code Sample

sudo ifconfig ath0 up
sudo wlcardconfig
sudo pump -i ath0


(I enter my wireless config when the gui pops up, line2, but all I enter is the ESSID for ath0 (SSIDFORDSL) and the encryption key for ath0 (pskfordsl), I leave the rest blank )

Having searched the forum for WPA, I have picked up bits and pieces but can't put them all together. Do I ... ?

Create a txt file /etc/wpa_supplicant.conf which contains only :

Code Sample

network={
 ssid=my_essid_here
 key_mgmt=WPA-PSK
 pairwise=TKIP
 psk=my_wpa_password_here
}


and then as root type some sudo commands ?

Is the wpa_supplicant.conf file above correct ?
What do I type as root, I'm thinking ...

Code Sample

sudo ifconfig ath0 up
sudo wlcardconfig
sudo iwlist ath0 scan
sudo wpa_supplicant -c/etc/wpa_supplicant.conf -iath0 -d
sudo pump -i ath0



Any corrections appreciated, as I am piecing together a jigsaw without actually understanding it.
Is there anything else that I need to do ?

Thanks.

Posted by ^thehatsrule^ on Aug. 08 2007,17:44
Forum search: i.e. < http://damnsmalllinux.org/cgi-bin....t=17885 >
I suppose you could try taking off the ndiswrapper flag part

Posted by setecio on Aug. 08 2007,19:01
Yep, I'm trying to piece it together from forum posts.

EDIT : I forgot the "" for my SSID and psk in the .conf file so I got alot of LINE errors. Fixed that ...now

Trying the code in my first post I get the following response from sudo wpa_supplicant -c/etc/wpa_supplicant.conf -iath0 -d

I just get the same thing scrolling down the terminal window with pauses. It appears to be trying to connect, but not able to for whatever reason, and going round in circles, trying the same thing every few seconds (I can see 'setting authentication timeout : 5 sec 0 usec' and Authentiaction with 00:00:00:00:00:00 timed out)

How can I pause the terminal screen or exit out of the routine so that I can read it ? I think it is not authenticating, something is wrong. The psk is just the WPA passphrase in the router, isn't it ?

Posted by setecio on Aug. 08 2007,21:14
Here is a photo of the routine that just repeats in the terminal window (I think the start of the routine is actually half way down the 2nd photo, but it just keeps repeating ) :
AS you can see there are 2 wifi networks available and it correctly tries to associate with the correct one (SSIDFORDSL)



Posted by ^thehatsrule^ on Aug. 08 2007,21:34
It would appear that the prism2 driver does not support that operation: "ioctl[PRISM2_IOCTL_HOSTAPD]: Operation not supported"
Posted by setecio on Aug. 08 2007,22:04
Quote (^thehatsrule^ @ Aug. 08 2007,22:34)
It would appear that the prism2 driver does not support that operation: "ioctl[PRISM2_IOCTL_HOSTAPD]: Operation not supported"

It shouldn't be using a prism2 driver as the wg511t uses the atheros chipset, and is correctly identified as this in DSL. Why is it trying to use the Prism2 driver ?
Posted by ^thehatsrule^ on Aug. 08 2007,22:22
ah, i think you need to pass -Dmadwifi (guess it doesn't try to detect the driver to use ....)

example search: < http://damnsmalllinux.org/cgi-bin....40;st=5 >

Posted by andrewb on Aug. 09 2007,03:07
You don't need to use the wlanconfig script if you are using wpa. As root (or add sudo to the front of them) use the commands:

ifconfig ath0 up

iwconfig ath0 essid <your_ssid>

wpa_supplicant -Bdd -c<your_wpa_supplicant.conf_file> -iath0 -dmadwifi

pump -iath0

Once this is all working put the commands into /opt/bootlocal.sh. This is run as root at boot-time & so doesn't need sudo in front of the commands in it.

You can check the network is found with iwlist ath0 after the iwconfig command if you want.

Your wpa_supplicant.conf file is OK if you are using wpa-psk. You will need pairwise=ccmp if you are using wpa2-psk. You can tell which is in use from the iwlist results. THere will be a line (or lines) near the bottom of the results which start wpa= or rsn= followed by a long series of characters. The former means wpa-psk is in use & the latter means wpa2-psk is in use - depending on how the ap is set up you could have either or both.

Posted by setecio on Aug. 09 2007,12:17
Thanks for that. Progress, but not success yet  :(

Small code error (capital D)  in that the -dmadwifi should be -Dmadwifi            (as in hats' post, just in case others are reading this for help in the future)

But with that, the routine seems to run once and end - photos of the terminal text below. The WG511T lights now start flashing in syncro, which is what happens in win98 when I am using it and it is properly connected.

However trying now to ping the router (at 192.168.0.201) doesn't work, and trying to get an IP with the pump command fails.

It looks as if it is almost there, as the lights on the WG511T are indicating it is connected.

Any ideas ? Does the wpa_supplicant routine look as if it is completing successfully? Is it now just a problem acquiring an IP address ?





Posted by setecio on Aug. 09 2007,21:31
(I saw that -Dwext was mentioned for some other distribution - could that be relevant?)

I found this which might help, and indicates the WG511T works with wpa_supplicant in Slackware, Fedora, Debian, SuSe, Kubuntu, Knoppix .... if anyone can dig out from this, what my problem with dsl is, it would be much appreciated.
< http://www.linuxquestions.org/hcl....=myprod >

Quote
This 32-bit Cardbus 802.11b/g wireless card can achieve up to 108 MB/s transfer rates when used with the proper router, however I don't think it can do this in Linux just yet.
Must first install the MadWifi driver:

< http://sourceforge.net/projects/madwifi/ >

and you can get plenty of help with that here:

< http://madwifi.org >

Once the drivers are installed I used the following commands to configure the card:
iwconfig ath0 mode Managed
iwconfig essid _your_essid_

set your IP and Subnet Mask and start the card:
ifconfig ath0 x.x.x.x netmask y.y.y.y up

set default gateway:
route add default gw z.z.z.z

set your WEP key:
iwconfig ath0 key ABCDEFEDCB

set the bit rate:
iwconfig ath0 rate 54M

When it is up and working both lights will flash simultaneously. The flashing rate increases when it's transferring data.

That's all. Hope this helps someone.


So I'm now trying :

Code Sample

iwconfig ath0 mode Managed
iwconfig essid SSIDFORDSL
ifconfig ath0 192.168.0.50 netmask 255.255.255.0 up
route add default gw 192.168.0.1
wpa_supplicant -Bdd -c/etc/wpa_supplicant.conf -iath0 -Dmadwifi


Now I can try to ping but nothing happens, and opening a web browser is unable to resolve the web address.

Posted by andrewb on Aug. 10 2007,01:36
I had problems with a TP-link card with the atheros chipset. I ended up using ndiswrapper to get wpa to work. You should try this. Instructions are the post referred to by ^thehatsrule^ above. Note that if you are running on a slowish machine it is worth saving the /etc/ndiswrapper directory to backup once the 'ndiswrapper -i' command has been used, then this step can be missed out in furture (all it does is set up the windows drivers so ndiswrapper can use them - it can be a lengthy process where there are a lot of cards serviced by one driver).
Posted by setecio on Aug. 12 2007,21:41
OK thanks. I'll try when I get time.
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.