wpa_supplicant (...)

11 Antworten [Letzter Beitrag]
sebelius
Offline
Beigetreten: 08/22/2013

I decided i wanted to know how to connect to a wpa protected wireless network without the need of a gui program.

Though, i have encountered some issues of which i'd appreciate some help with.

wpa_passphrase "ssid" "password" > /etc/wpa_supplicant.conf

content of wpa_supplicant.conf:
network={
ssid="ssid"
#psk="password"
psk="password"
}

run in terminal (to connect to wireless network):
wpa_supplicant -B -i wlan0 -Dwext -c /etc/wpa_supplicant.conf

output:
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument

I have searched on the internet for this output, but i cannot find a solution.
Are any of you familiar with wpa_supplicant, and have a possible solution?

Sim
Sim
Offline
Beigetreten: 09/29/2013

Maybe you need a space between "-D" and "wext"?

sebelius
Offline
Beigetreten: 08/22/2013

No that don't work.

sebelius
Offline
Beigetreten: 08/22/2013

I get another error message now, after i edited
the psk to be surrounded double quotes(psk="passphrase") in wpa_supplicant.conf (as it was not originally, even though it is shown in double quotes in the "content of wpa_supplicant.conf" in my first post, it is for sure now (as i read somewhere that it should be).

in terminal:
wpa_supplicant -B -i wlan0 -D wext -c /etc/wpa_supplicant.conf

output:
Line 2: Invalid passphrase length 64 (expected: 8..63) 'passphrase"'.
Line 2: failed to parse psk '"passphrase"'.
Line 5: WPA-PSK accepted for key management, but no PSK configured.
Line 5: failed to parse network block.
Failed to read or parse configuration '/etc/wpa_supplicant.conf'.

Sim
Sim
Offline
Beigetreten: 09/29/2013

https://dev.openwrt.org/ticket/2703

It says that "The problem is that a precomputed hex PSK must not be quoted."

sebelius
Offline
Beigetreten: 08/22/2013

Oh ok, thanks. Now i get the same error message as in my first post again.

Sim
Sim
Offline
Beigetreten: 09/29/2013

Do you have the same error message? I never used wpa_supplicant but your error said that something is wrong with your arguments. Maybe it's the ordering of your arguments. "-d" is the debug modus. Try

wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf -D wext -dd

I have read that "nl80211" is preferred over "wext". Can you try it?

sebelius
Offline
Beigetreten: 08/22/2013

Thanks for that info.
The following is the output of using both the wext driver and the nl80211 driver with the -d (debug option).
(Though i do not understand most of it)

in terminal(with wext driver):
wpa_supplicant -B -i wlan0 -D wext -c /etc/wpa_supplicant.conf -d

the error i had originally was due to the driver it seems: "Driver did not support SIOCSIWENCODEEXT" ( at line 14 and 17 in the output )

output:
Priority group 0
id=0 ssid='ssid'
WEXT: cfg80211-based driver detected
SIOCGIWRANGE: WE(compiled)=22 WE(source)=21 enc_capa=0xf
capabilities: key_mgmt 0xf enc 0xf flags 0x0
netlink: Operstate: linkmode=1, operstate=5
Own MAC address: "mac_address"
wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=4 set_tx=0 seq_len=0 key_len=0
ioctl[SIOCSIWENCODEEXT]: Invalid argument
Driver did not support SIOCSIWENCODEEXT
wpa_driver_wext_set_key: alg=0 key_idx=5 set_tx=0 seq_len=0 key_len=0
ioctl[SIOCSIWENCODEEXT]: Invalid argument
Driver did not support SIOCSIWENCODEEXT
wpa_driver_wext_set_countermeasures
RSN: flushing PMKID list in the driver
Setting scan request: 0 sec 100000 usec
WPS: UUID based on MAC address - hexdump(len=16): 15 69 10 06 d8 1b 52 48 ae 0b cd c3 06 5c e4 33
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: Supplicant port status: Unauthorized
EAPOL: KEY_RX entering state NO_KEY_RECEIVE
EAPOL: SUPP_BE entering state INITIALIZE
EAP: EAP entering state DISABLED
EAPOL: Supplicant port status: Unauthorized
EAPOL: Supplicant port status: Unauthorized
Added interface wlan0
Daemonize..

in terminal(with nl80211 driver):
wpa_supplicant -K -B -i wlan0 -D nl80211 -c /etc/wpa_supplicant.conf -d

when using the "nl80211" driver, the two erros i have with wext are not generated:
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument

output:
Priority group 0
id=0 ssid='ssid'
netlink: Operstate: linkmode=1, operstate=5
nl80211: Register Action command failed: ret=-114 (Operation already in progress)
nl80211: Register Action match - hexdump(len=1): 06
nl80211: Failed to register Action frame processing - ignore for now
Own MAC address: "mac_address"
wpa_driver_nl80211_set_key: ifindex=5 alg=0 addr=0x80e5d68 key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=5 alg=0 addr=0x80e5d68 key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=5 alg=0 addr=0x80e5d68 key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=5 alg=0 addr=0x80e5d68 key_idx=3 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=5 alg=0 addr=0x80e5d68 key_idx=4 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=5 alg=0 addr=0x80e5d68 key_idx=5 set_tx=0 seq_len=0 key_len=0
RSN: flushing PMKID list in the driver
Setting scan request: 0 sec 100000 usec
WPS: UUID based on MAC address - hexdump(len=16): 15 69 10 06 d8 1b 52 48 ae 0b cd c3 06 5c e4 33
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: Supplicant port status: Unauthorized
EAPOL: KEY_RX entering state NO_KEY_RECEIVE
EAPOL: SUPP_BE entering state INITIALIZE
EAP: EAP entering state DISABLED
EAPOL: Supplicant port status: Unauthorized
EAPOL: Supplicant port status: Unauthorized
Added interface wlan0
Daemonize..

To me at least, it seems that using the nl80211 driver generated less errors.
However there appears to be unauthorized access to something (as when using both drivers).
Do you know maybe to what the access is denied?

quantumgravity
Offline
Beigetreten: 04/22/2013

Your .conf looks a bit simple. Sure you don't have to provide additional info about the type of encryption etc.?
Better have a look at the manual of the config file.
I used wpa_supplicant only once in order to establish my network connection without gui but as far as I remember there was a lot more stuff in the .conf

BugRep
Offline
Beigetreten: 04/05/2012

I tried to connect and got the same error messages. I tried many different configuration file options and got it working.

I can no longer reproduce what happened the first time, but here is what I have learned. If your desktop is running, you need to kill nm-applet. You also need to kill all wpa_supplicant processes.

I can now connect with only SSID and psk in the configuration file.

I still get the errors.
sudo wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf

ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
Trying to associate with MAC_ADDRESS (SSID='MY_SSID' freq=2467 MHz)
Associated with MAC_ADDRESS
WPA: Key negotiation completed with MAC_ADDRESS [PTK=CCMP GTK=TKIP]
CTRL-EVENT-CONNECTED - Connection to MAC_ADDRESS completed (auth) [id=0 id_str=]
sebelius
Offline
Beigetreten: 08/22/2013

Unplugged ethernet
sudo killall wpa_supplicant
sudo wpa_supplicant -i wlan0 -D nl80211 -c /etc/wpa_supplicant.conf
sudo dhclient wlan0

called ping www.startpage.com about 20 times, and suddenly by some miracle it started receiving.
I don't the reason to why it suddenly started working,
but i think it might be the config file as i think that was the last thing i changed (or just that i did not tell wpa_supplicant to run in background mode with the option -D)?
Thanks all for your help!

wpa_supplicant.conf
network={
ssid="ssid"
#psk="passphrase"
proto=WPA
scan_ssid=1
key_mgmt=WPA-PSK
psk=passphrase_no_quotes_surrounding_it
}

sebelius
Offline
Beigetreten: 08/22/2013

Actually, what i did right after unplugging the ethernet was:
sudo ifconfig wlan0 up
sudo iwconfig essid "essid"
(the wpa_supplicant couldn't assign an essid to wlan0 or something?)