LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-16-2007, 09:02 AM   #1
cliffoij
LQ Newbie
 
Registered: Jul 2007
Posts: 10

Rep: Reputation: 0
Wireless AP "not associated" problem


Hello all

I have a NEWLINK USB pen wireless ethernet card connecting back to me wireless NETGEAR router. Card, and router, work fine on windows.

Hardware is IBM thinkpad 6004, 160 MB Ram, 10 GB disk.
OS = Knoppix 5.1 - kernel 2.6.19

I have set up wpa_supplicant, and assigned a manual address using the /etc/network/interfaces file. I have also set the default gateway.

Here's the problem - I see 6 AP's with "iwlist wlan0 scan" - and no matter how many times i issue "iwconfig wlan0 essid <myessid>" is always reverts back to sating "Any" and the essid does not get set. Same goes for setting the AP of the NETGEAR router with "iwconfig wlan0 ap xxxxxxxx" - the setting is not preserved.

The ESSID on the router is set to broadcast (i checked yesterday)

I have to use "iwpriv wlan0 network_type g" to get the correct listing for the network, but this setting IS preserved.

I have tried iwconfig mode wlan0 auto also.

The output from dmesg shows no problems with recognising the usb wireless newlink adapter, and is able to recognise hotplug of the device. I see nothing unusual.

I have been using "-Dwext " option for the startup of wpa_supplicant as the third party drivers produce a complaint about "WPA not supported" when i try and use them. I get no such message when using the "-Dwext" option, so I've stuck with that.

Is is just that I need to perhaps select a new channel (other than 6) with "iwconfig wlan0 channel <number>" to try and isolate mine form the others visible in my street (the other 5) or is there something more fundamentally wrong you think ?

I have to presume my wireless card is operational as it can "see" mine (and other) networks in the area - I just can't lock on to it.

I have read many threads and so far I have done what I can - any advice appreciated.

Thanks - Ian
 
Old 07-16-2007, 01:19 PM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Your hardware seems to be working - I think you have an authentication problem. Make double-sure that you have the SSID correctly spelled, both on the AP and in your interfaces file

Here's the relevant part of my /etc/network/interfaces file:

Code:
auto eth1
iface eth1 inet static
broadcast 10.0.0.255
address 10.0.0.8
netmask 255.255.255.0
gateway 10.0.0.2
wpa-passphrase mysecretphraseishere
wpa-ssid MywirelessAPName
wireless-channel 11
wireless-essid MywirelessAPName
wireless-key s:mysecretphraseishere
Notes:
1] eth1 is my wireless interface, yours may be different, please double-check!
2] You may need to choose a different channel (same as your AP, obviously!)
3] 10.0.0.2 is the address of my modem/router/switch/AP
4] I have wpasupplicant installed
5] I like static IPs on my LAN, if you want dhcp make it look like this:

Code:
auto eth1
iface eth1 inet dhcp
wpa-passphrase mysecretphraseishere
wpa-ssid MywirelessAPName
wireless-channel 11
wireless-essid MywirelessAPName
wireless-key s:mysecretphraseishere
Edit your interfaces file, then, as root, try

ifdown eth1
ifup eth1

and (hopefully), you'll be connected.....

Last edited by tredegar; 07-16-2007 at 01:20 PM.
 
Old 07-17-2007, 04:22 AM   #3
cliffoij
LQ Newbie
 
Registered: Jul 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Hi tredegar

Thanks - your example /etc/network/interfaces file is interesting. I am on knoppix (which I understand to be a debian based distro) - I also notice you have an entry for both "wpa-passphrase" and "wireless-key" in the /etc/network/interfaces file.

I thought (perhaps incorrectly) that if you used WPA (in my case WPA-PSK) the wireless-key was not needed to be declared with "iwconfig" , but that the wpa-supplicant daemon took care of key exchanges via the wpa-supplicant.conf file ?

Hmmm - if it is required that the key is declared in both those elements this could be my problem ?

What I will try tonight is altering the channel / frequency of the AP broadcasts to make sure there is no kludge between them.

I am still baffled though as when I have been issuing the "iwconfig wlan0 essid XXXXX" command and the shell prompt is accepted, but the output from later "iwconfig wlan0" commands does not show the essid I just declared. It's just being flatly ignored. This suggests that encryption has to be spot on first prior to attempting to connect to my chosen AP / essid.

Out of interest - does your setup work without the "wireless-key s:mysecretphraseishere" entry in your /etc/network/interfaces file if you are using wpa_supplicant ?

Thanks - Ian
 
Old 07-17-2007, 06:36 AM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
I do not have a wpa-supplicant.conf file, but it all works fine.

Quote:
does your setup work without the "wireless-key s:mysecretphraseishere" entry in your /etc/network/interfaces file if you are using wpa_supplicant ?
Yes, if I comment out these two lines:
Code:
# wireless-essid MywirelessAPName
# wireless-key s:mysecretphraseishere
it still works. I am not sure where these last two lines came from - maybe from when I was playing with one of the GUIs - wlassistant, which does not seem to work very reliably - hence my resorting to editing the interfaces file by hand.

I do need these entries though:
Code:
wpa-passphrase mysecretphraseishere
wpa-ssid MywirelessAPName
wireless-channel 11
Quote:
I have been issuing the "iwconfig wlan0 essid XXXXX"
If you are going to use the command line like that, I'm pretty sure that you'll need to provide your key as well, something like this:

Code:
/sbin/iwconfig wlan0 mode managed channel 11 key restricted s:mysecretphraseishere essid MywirelessAPName
One last q: Can you see your AP with the command iwlist eth1 scanning ?
Check that it is broadcasting the right ESSID
 
Old 07-17-2007, 08:22 AM   #5
cliffoij
LQ Newbie
 
Registered: Jul 2007
Posts: 10

Original Poster
Rep: Reputation: 0
OK -

One last q: Can you see your AP with the command iwlist eth1 scanning ?

Yes, I see not only my AP, but another 5 from the neighbours also !. Thats why I was trying to issue "iwconfig wlan0 ap xxxxxxxxxxxx" to set my specific mac address for the AP (also the router/gateway)

I have been looking at the "iwpriv" options I could supply (which so far I havent used many) and I will try tonight to experiment with these.

I have not been declaring WEP key via the "iwconfig" command as per your example :-

/sbin/iwconfig wlan0 mode managed channel 11 key restricted s:mysecretphraseishere essid MywirelessAPName

This is simply because the PSK key gets defined in there /etc/wpa_supplicant/wpa_supplicant.conf, in a file that looks like this :-

# WPA-PSK/TKIP

ctrl_interface=/var/run/wpa_supplicant

network={
ssid="Myessid"
key_mgmt=WPA-PSK
proto=WPA
pairwise=TKIP
group=TKIP
psk="secret passphrase"
}


So tonight I will try and config using your exmaple, and also experiment a little with "iwpriv" commands, as in some distros I see you can declare the PSK key as an argument to "iwpriv" (amongst other settings).

Will catch up with you tomorrow - thanks for assistance so far - I have no doubt that having spent several days with this so far

Cheers - Ian
 
Old 07-17-2007, 09:23 AM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
Yes, I see not only my AP, but another 5 from the neighbours also !
That's normal, I can see several (and half are "open") too. But my AP's ESSID is different from theirs, and I associate with that. No need for hardware MAC addresses.
Quote:
I have been looking at the "iwpriv" options
I have never had to use iwpriv, maybe you don't either - try not to complicate things!
Quote:
I have not been declaring WEP key via the "iwconfig" command as per your example ... because the PSK key gets defined in there /etc/wpa_supplicant/wpa_supplicant.conf
I have learnt never to make assumptions. As I said, I do not have a wpa_supplicant.conf file at all and everything works well, so my setup (kubuntu, which is also derived from debian), doesn't need that file (perhaps because I am specifying all that stuff in my interfaces file). For what it's worth, my /etc/wpa_supplicant directory contains a single file called ifupdown.sh and that's all.

If you make your interfaces file look like mine (with the obvious eth0 / wlan0 substitutions) and it still doesn't work, may I suggest you post your file in its entirety, without editing out or changing your ESSID or passwords? There may be something simple that is wrong. I spent the best part of a week with some guy who was convinced his ESSID was correct and that linux was "broken" and then it turned out that he was using Rapid Falls (or something like that) as his ESSID, when in fact it should have been Rapidfalls.
Security note: It is highly unlikely that anyone reading this is within 100m of you, and once you get it working, you can always change those security settings to something new.
 
Old 07-18-2007, 04:18 AM   #7
cliffoij
LQ Newbie
 
Registered: Jul 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Smile SOLVED - Wireless AP "not associated" problem

Hi Tredegar - SOLVED !!!

I made my /etc/nertwork/interfaces file look similar to yours - thanks

I entered the "iwconfig wlan0 key restricted s:xxxxxxxxxxxx" and also set mode to "managed" along with the "ap_scan=1" option in my /etc/wpa_supplicant/wpa_supplicant.conf file (extract below)

I launch the wpa_supplicant process via the /etc/network/interfaces file (as a quick and dirty startup) so it's activated with "ifup wlan0" accordingly.

Amazingly, DHCP worked too (which staggered me) !

My prior downfall was presuming that the key statement was only required to be declared in the wpa_supplicant.conf file - Look like that's not the case.

All I need to do now is work out the correct method for clean startup and shutdown of the wpa_supplicant process - I'll look on the forums and documentation later today.

Thanks very much indeed for your help - muxch appreciated - now off to read up on clean startup/shutdown on process.

Sample code used below :-

Code : From /etc/network/interfaces :-

allow-hotplug irda0

iface irda0 inet dhcp
pre-up ifconfig irda0 up

auto wlan0
iface wlan0 inet dhcp
pre-up ifconfig wlan0 up
pre-up sh /etc/wpa_supplicant/start.sh > /dev/null & # My script to start wpa_supplicant
pre-up iwconfig wlan0 mode managed
pre-up iwconfig wlan0 channel 6
pre-up iwconfig wlan0 essid "MyEssid"
pre-up iwconfig wlan0 key restricted s:xxxxxxxxxxxx # xxxx= My key (WPA-PSK)
pre-up iwconfig wlan0 ap 00:0F:xx:xx:xx:xx # My AP (gateway/router)
pre-up iwpriv wlan0 network_type g

allow-hotplug wlan0

allow-hotplug wmaster0
iface wmaster0 inet dhcp
pre-up ifconfig wmaster0 up

Code : From /etc/wpa_supplicant/wpa_supplicant.conf

ap_scan=1

network={
ssid="myEssid"
proto=WPA
psk="mysecretphrase"
key_mgmt=WPA-PSK
pairwise=TKIP
}
 
Old 07-18-2007, 04:40 AM   #8
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
It is working - Congratulations!
Quote:
All I need to do now is work out the correct method for clean startup and shutdown of the wpa_supplicant process - I'll look on the forums and documentation later today.
I don't think you need to do this: wpa_supplicant is started automatically for me (maybe by whatever is reading the interfaces file?), and the process will simply be killed by the kernel as it shuts down, but if you'd like to look into it further, go ahead.
 
Old 07-19-2007, 06:31 AM   #9
cliffoij
LQ Newbie
 
Registered: Jul 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Hi again tredegar

Many thanks for helping this problem get resolved - much appreciated. I'm not going to lose any sleep over auto startup and shutdown as you suggest ... life's too short ..... ;-)

Have a good weekend !

cheers - Ian
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
error: Error for wireless request "Set Mode" (8B06) : invalid argument "roaming" penguin chick Linux - Wireless Networking 5 08-22-2008 02:16 PM
Wireless chip is displayed as "Ath0" instead of "wlan0" with Belkin F5D7000 ceramicsushi Linux - Wireless Networking 4 04-06-2006 12:26 AM
reciving a wireless "a" internet connection... and sending it out as "g" pengu Linux - Wireless Networking 0 03-28-2006 11:50 PM
[B]"wireless network" config from "system" hangs[/B] dauphinfay Ubuntu 0 03-04-2006 04:16 PM
Problem with "3Com", "3CRSHPW_96 Wireless LAN PC Card " Adil_uk Linux - Wireless Networking 0 12-18-2005 06:45 PM


All times are GMT -5. The time now is 12:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration