Author Topic: Wpa-supplicant Configuration  (Read 5266 times)

solighten

  • Newbie
  • *
  • Posts: 43
    • View Profile
    • http://
Wpa-supplicant Configuration
« on: December 06, 2006, 03:35:48 am »
Hi folks,

in the past I used WEP but since my new wireless router supports WPA-PSK I thought it is a good idea to use it.

So I installed hostapd and wpa-supplicant and changed the default wpa_supplicant.conf to support my wlan.

It worked almost right out of the box without problems (There is a bug in /etc/rc.d/init.d/wpa_supplicant, the "--" has to be removed).

I wrote a small script to connect, but I have not yet figured out how to give my zaurus a name. The iwconfig after "Setting Wireless" shows no effect. Here is my script:

Code: [Select]
#!/bin/sh
# Wireless lan settings script
echo "Resetting wireless"
ifconfig wlan0 down
dhcpcd -k
killall dhcpcd
rm /var/run/dhcpcd-wlan0.pid 2> /dev/null
#rm /var/run/wpa_supplicant/wlan0 2> /dev/null
sleep 1
echo -n "Setting wireless ...."
iwconfig wlan0 nick Zaurus rate auto power 1
sleep 1
echo "Turning up network"
/etc/rc.d/init.d/wpa_supplicant restart
dhcpcd wlan0
sleep 2
ifconfig wlan0
echo "done"

I use this script to connect. To disconnect I just eject the card.

How do you use wpa-supplicant? Any suggestions for improvements?

Cheers, Jan
SL-C860 - PdaXrom 1.1.0r197
2GB SD XStore 2GB CF SanDisk
Wlan D-Link DCF 660W

JohnX

  • Full Member
  • ***
  • Posts: 126
    • View Profile
    • http://
Wpa-supplicant Configuration
« Reply #1 on: December 07, 2006, 04:42:28 am »
I too ended up taking the "just-write-my-own-script" route for dealing with wpa networks. Here's the script that I ended up with:
Code: [Select]
#!/bin/sh

action=$1
iface=wlan0

case $action in
on)
    cardctl insert
    ifconfig $iface up
;;

up)
    wireless.sh on
    wpa_supplicant -c /etc/wpa_supplicant.conf -D hostap -i $iface -B
    udhcpc -i $iface
    ntpdate pool.ntp.org
;;

down)
    killall wpa_supplicant
    killall udhcpc
;;
    
reup)
    wireless.sh down
    wireless.sh up    
;;
    
off)
    wireless.sh down
    ifconfig $iface down
    cardctl eject
;;

scan)
    wireless.sh on
    wireless.sh down
    kismet
;;
    
*)
    echo "usage: $0 ( on | up | down | off | reup | scan )"
;;
esac

It is *not* pretty. In fact this is possibly one of the least elegant ways to handle recursion in sh I think. However, it "works for me ™" so maybe it will be useful to someone else. The script should be named wireless.sh, made executable and be somewhere in your $PATH otherwise it will fail miserably. Looking at it now I should have at least replaced all instances of wireless.sh in it with $0 or equivalent. Also, keep in mind that I'm using OZ and thus my dhcp client is udhcpc rather than dhcpd. Maybe there should be a variable in there to set the dhcp client used.

-John
Zaurus SL-C1000 - Linux 2.6.22 - Angstrom/Debian dual boot - Ambicom 802.11b - 1GB Corsair SD
Nokia N800 - 2GB PQI SD card
Zaurus SL-5500 - OZ 3.5.3/Hentges T2/Opie - 64MB Lexar SD card

zi99y

  • Sr. Member
  • ****
  • Posts: 282
    • View Profile
Wpa-supplicant Configuration
« Reply #2 on: December 07, 2006, 04:45:24 am »
this is probabaly a crazy question as I don't use WPA (yet) but is it possible to connect to networks that you don't have all the details of (ESSID/Freq etc) but you know the Key?

For example I go to see my family and want to connect but don't want my dad to rummage around trying to find out all the details - we have the Key, but would like to search for the access point , like in wifi-radar

iits

  • Newbie
  • *
  • Posts: 26
    • View Profile
Wpa-supplicant Configuration
« Reply #3 on: December 07, 2006, 04:51:32 am »
Quote
this is probabaly a crazy question as I don't use WPA (yet) but is it possible to connect to networks that you don't have all the details of (ESSID/Freq etc) but you know the Key?

For example I go to see my family and want to connect but don't want my dad to rummage around trying to find out all the details - we have the Key, but would like to search for the access point , like in wifi-radar
[div align=\"right\"][a href=\"index.php?act=findpost&pid=148361\"][{POST_SNAPBACK}][/a][/div]

You can scan for SSID (if it not hidden) and the freq should be found automaticly

Drake01

  • Full Member
  • ***
  • Posts: 226
    • View Profile
Wpa-supplicant Configuration
« Reply #4 on: December 07, 2006, 07:42:00 pm »
This might also be a crazy question...

I always assumed that WPA or WEP would be software controlled, and yet I always seem to see it tied to hardware (card X supports WEP, WPA, etc.; card Y supports WEP).  Again, I always assumed that this was because of the drivers supplied by the manufacturer, and the manufacturer would have little motivation to provide upgraded drivers for older cards since they're trying to sell you a new product.

I guess I'll get to my question now...  Can WPA be used with any NIC?  

For instance, I have an older Symbol card and I use WEP with it, but it's common knowledge that WEP is trivial to compromise.  I would love to upgrade to WPA if that were an option.  However, I don't feel like spending for a new WAP plus a new CF NIC.  (I know that I would need to upgrade my WAP in either case, as Netgear has no recent firmware updates for it.)

Am I out of luck on this one?

Thanks!
Device: SL-C3200 running pdaXii13v2 build 5.5.0
Networking: Symbol Spectrum24 WLAN card; Kingston CIO10T CF NIC
Storage: 4GB Transcend 150x SD; 16GB Transcend 133x CF; 4GB Seagate CF HDD; 4GB Patriot SD
HID: Logitech V450 Laser Mouse; generic silicone USB keyboard; 2 generic optical mice; stock plastic stylus
GPS: generic "UT-41" USB GPS Receiver
Case: neoprene case from my old Palm foldable keyboard

harvell

  • Full Member
  • ***
  • Posts: 241
    • View Profile
    • http://
Wpa-supplicant Configuration
« Reply #5 on: December 08, 2006, 12:20:29 am »
I have an older symbol card too.  I remember reading somewhere that the symbol card would not be able to handle WPA because of the firmware.
C1000 w/...  Cacko Lite (When I use the Z alot for business)... pdaXrom (when I see something cool and want to try it.  Best way for me to learn shell commands)
Eee PC for Mrs. Harvell  
4G SD

solighten

  • Newbie
  • *
  • Posts: 43
    • View Profile
    • http://
Wpa-supplicant Configuration
« Reply #6 on: December 08, 2006, 04:48:11 am »
Quote
I have an older symbol card too.  I remember reading somewhere that the symbol card would not be able to handle WPA because of the firmware.
[div align=\"right\"][{POST_SNAPBACK}][/a][/div]

Hi,

I read that it really depends on the firmware. On my Dlink 660 and on any other Prism based chipset card you shold have station firmware of at least version 1.7.4. This version was on my card already, so for me there was no problem. How to find out which version is on your card and how to upgrade you can find here:

[a href=\"http://linux.junsun.net/intersil-prism/]http://linux.junsun.net/intersil-prism/[/url]

I am glad that I already had the firmware version required for WEP!

Cheers, Jan
SL-C860 - PdaXrom 1.1.0r197
2GB SD XStore 2GB CF SanDisk
Wlan D-Link DCF 660W

zi99y

  • Sr. Member
  • ****
  • Posts: 282
    • View Profile
Wpa-supplicant Configuration
« Reply #7 on: December 08, 2006, 05:46:54 am »
tbh I just use MAC filtering on my WAP, is there any reason why WPA is more secure than this?

solighten

  • Newbie
  • *
  • Posts: 43
    • View Profile
    • http://
Wpa-supplicant Configuration
« Reply #8 on: December 08, 2006, 07:30:49 am »
Quote
tbh I just use MAC filtering on my WAP, is there any reason why WPA is more secure than this?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=148495\"][{POST_SNAPBACK}][/a][/div]

Hi,

Mac filtering is a good addition to any encryption but is not really secure. On most devices you can change the MAC. Someone just needs to read the MAC while you are connected and use the same MAC afterwards.

Cheers, Jan
SL-C860 - PdaXrom 1.1.0r197
2GB SD XStore 2GB CF SanDisk
Wlan D-Link DCF 660W

zi99y

  • Sr. Member
  • ****
  • Posts: 282
    • View Profile
Wpa-supplicant Configuration
« Reply #9 on: December 08, 2006, 07:38:38 am »
Thanks, I never thought of that.. Now where's that macchanger tool again

btw is there a commandline utility to scan for wireless networks? kismet doesn't work for me and wifi-radar chugs..

solighten

  • Newbie
  • *
  • Posts: 43
    • View Profile
    • http://
Wpa-supplicant Configuration
« Reply #10 on: December 08, 2006, 09:43:24 am »
Quote
btw is there a commandline utility to scan for wireless networks? kismet doesn't work for me and wifi-radar chugs..
[div align=\"right\"][a href=\"index.php?act=findpost&pid=148505\"][{POST_SNAPBACK}][/a][/div]

Hi,

I have never seen a commandline utility, but did you try "Wellenreiter". It has a nice GUI and it did work well under Beta3. I have not installed it on Rc121 yet because there was no need for me to do it so far.

Cheers, Jan
SL-C860 - PdaXrom 1.1.0r197
2GB SD XStore 2GB CF SanDisk
Wlan D-Link DCF 660W

Andmann

  • Newbie
  • *
  • Posts: 36
    • View Profile
    • http://
Wpa-supplicant Configuration
« Reply #11 on: December 10, 2006, 09:14:53 pm »
Quote
Quote
btw is there a commandline utility to scan for wireless networks? kismet doesn't work for me and wifi-radar chugs..
[div align=\"right\"][a href=\"index.php?act=findpost&pid=148505\"][{POST_SNAPBACK}][/a][/div]

Hi,

I have never seen a commandline utility, but did you try "Wellenreiter". It has a nice GUI and it did work well under Beta3. I have not installed it on Rc121 yet because there was no need for me to do it so far.

Cheers, Jan
[div align=\"right\"][a href=\"index.php?act=findpost&pid=148513\"][{POST_SNAPBACK}][/a][/div]

Hi,
Where do you get this app?
I have searched around and so far no luck.

Thanks

Andmann
C1000 running pdaXrom R198 SP8.
1G Kingston Ultimate 133x SD
256M Kingston SD
Ambicom WL1100C Wifi
Symbol 802.11b Wifi

InSearchOf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1144
    • View Profile
    • http://
Wpa-supplicant Configuration
« Reply #12 on: December 10, 2006, 10:00:14 pm »
Here

Late
Sharp Zaurus SL-C3100 and SL-6000L
pdaXrom Developer
Please visit pdaXrom.org for updates
My Blog
IRC #pdaxrom @ FreeNode

zi99y

  • Sr. Member
  • ****
  • Posts: 282
    • View Profile
Wpa-supplicant Configuration
« Reply #13 on: December 11, 2006, 09:34:14 am »
Thanks for that, I have tried Wellenreiter and have problems with that also. I think my PLANEX CF wifi card may not be configured properly as I do get some odd message - I'll have to look into it further before I comment. Wifi-radar allows me to search out wireless networks, but never seems to connect cleanly

Andmann

  • Newbie
  • *
  • Posts: 36
    • View Profile
    • http://
Wpa-supplicant Configuration
« Reply #14 on: December 11, 2006, 08:04:33 pm »
Quote
Here

Late
[div align=\"right\"][a href=\"index.php?act=findpost&pid=148768\"][{POST_SNAPBACK}][/a][/div]

Thanks, I will try it tonight and let you know.

Andmann
C1000 running pdaXrom R198 SP8.
1G Kingston Ultimate 133x SD
256M Kingston SD
Ambicom WL1100C Wifi
Symbol 802.11b Wifi