iwconfig... or not

Thursday, 02 June 2011

iwconfig... or not

This wasn't the first time I've unsuccessfully tried to connect to an open wireless network from the command line using iwconfig (which should be a simple task) and this time I was determined to find the solution. In this case I was running Knoppix, but I've had the same problem on Debian and [XK]?Ubuntu as well.

I tried...

iwconfig wlan0 essid rasberry
iwconfig wlan0 essid rasberry mode Managed
iwconfig wlan0 essid rasberry mode Managed chan 1
iwconfig wlan0 essid rasberry mode Managed chan 1 ap 00:01:02:03:04:05
-etc-
dhclient wlan0


...but no matter what, I couldn't get an IP or even see any DHCP traffic from my device at the router. Furthermore iwconfig wlan0 would consistently report that I was not associated.

ˇFRUSTRATING!

Lots of searches turned up little more than inapplicable solutions and unanswered questions.

So I checked dmesg to see if there were any errors being reported and found something like this:

deauthenticating by local choice, reason=3


OK... that's not MY choice, so WTF? Turns out that even though I started knoppix in runlevel 2, network-manager was running, which had wpa_supplicant running, (even though I was not connected to a network, have no predefined network profiles, am not running any network-manager clients, etc) and as I see it, wpa_supplicant was fighting with me for control of the wlan adapter config. So that was helpful... NOT!

I killed wpa_supplicant but it was immediately respawned by network-manager so I had to stop network-manager and then kill wpa_supplicant, and THEN, FINALLY, I was able to connect to the network with a simple:

iwconfig wlan0 essid rasberry; dhclient wlan0

Trackbacks

    No Trackbacks

Comments

Display comments as (Linear | Threaded)

    No comments


Add Comment


Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA 1CAPTCHA 2CAPTCHA 3CAPTCHA 4CAPTCHA 5