Connecting at sturtup

Live forum: http://rt2x00.serialmonkey.com/viewtopic.php?t=4756

ecthelion

27-04-2008 08:36:41

Because the computer I use network on is nowhere portable, I want to automatically associate with my home wireless network (WPA2 protected) at boot.

I used to do it like that (of course without the cat)
[codec75t7c94]
[root@localhost ~]# cat /mnt/linux/etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
ap_scan=2
#eapol_version=2

network={
bssid=XX:XX:XX:XX:XX:XX
ssid="XXX"
psk="XXX"
proto=WPA2
key_mgmt=WPA-PSK
pairwise=CCMP
group=CCMP
}

[root@localhost ~]# wpa_supplicant -iwlan0 -Dwext -c/mnt/linux/etc/wpa_supplicant/wpa_supplicant.conf -B
[root@localhost ~]# ifconfig wlan0 192.168.1.10 netmask 255.255.255.0
[root@localhost ~]# route add default gw 192.168.1.1
[/codec75t7c94]

This scheme used to work with legacy rt73 (I used iwpriv insted of wpa_supplicant) and with ndiswrapper (I had some kerneloops with the legacy driver in kernels 2.6.22 and 2.6.23). Now it's Fedora 9 Beta, and the driver works fine with NetworkManager, unfortunately it connects only after the login. The wpa_supplicant, when used on his own gives me an error
[codec75t7c94]
[root@localhost ~]# wpa_supplicant -i wlan0 -Dwext -c /mnt/linux/etc/wpa_supplicant/wpa_supplicant.conf -d -B
Initializing interface 'wlan0' conf '/mnt/linux/etc/wpa_supplicant/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'
Configuration file '/mnt/linux/etc/wpa_supplicant/wpa_supplicant.conf' -> '/mnt/linux/etc/wpa_supplicant/wpa_supplicant.conf'
Reading configuration file '/mnt/linux/etc/wpa_supplicant/wpa_supplicant.conf'
ctrl_interface='/var/run/wpa_supplicant'
ctrl_interface_group='wheel' (DEPRECATED)
ap_scan=2
Priority group 0
id=0 ssid='XXX'
Initializing interface (2) 'wlan0'
SIOCGIWRANGE: WE(compiled)=22 WE(source)=21 enc_capa=0xf
capabilities: key_mgmt 0xf enc 0xf
WEXT: Operstate: linkmode=1, operstate=5
Own MAC address: 00:0e:2e:ce:6a:a9
wpa_driver_wext_set_wpa
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_countermeasures
ioctl[SIOCSIWAUTH]: Operation not supported
WEXT auth param 4 value 0x0 - wpa_driver_wext_set_drop_unencrypted
RSN: flushing PMKID list in the driver
Setting scan request: 0 sec 100000 usec
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: KEY_RX entering state NO_KEY_RECEIVE
EAPOL: SUPP_BE entering state INITIALIZE
EAP: EAP entering state DISABLED
ctrl_interface_group=10 (from group name 'wheel')
Added interface wlan0
Daemonize..
[/codec75t7c94]

For the sake of completeness
[codec75t7c94]
[rootkit@localhost ~]$ uname -a
Linux localhost.localdomain 2.6.25-1.fc9.i686 #1 SMP Thu Apr 17 01:47:10 EDT 2008 i686 athlon i386 GNU/Linux
[rootkit@localhost ~]$ dmesg| tail -n 50
Bluetooth: L2CAP socket layer initialized
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM ver 1.8
Bluetooth: BNEP (Ethernet Emulation) ver 1.2
Bluetooth: BNEP filters: protocol multicast
Bridge firewalling registered
pan0: Dropping NETIF_F_UFO since no NETIF_F_HW_CSUM feature.
[drm] Setting GART location based on new memory map
[drm] Loading R300 Microcode
[drm] writeback test succeeded in 1 usecs
eth0: no link during initialization.
ADDRCONF(NETDEV_UP): eth0: link is not ready
ADDRCONF(NETDEV_UP): wlan0: link is not ready
wlan0: Initial auth_alg=0
wlan0: authenticate with AP XX:XX:XX:XX:XX:XX
wlan0: RX authentication from XX:XX:XX:XX:XX:XX (alg=0 transaction=2 status=0)
wlan0: authenticated
wlan0: associate with AP XX:XX:XX:XX:XX:XX
wlan0: RX AssocResp from XX:XX:XX:XX:XX:XX (capab=0x431 status=0 aid=1)
wlan0: associated
wlan0: CTS protection enabled (BSSID=XX:XX:XX:XX:XX:XX)
wlan0: switched to short barker preamble (BSSID=XX:XX:XX:XX:XX:XX)
ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
padlock: VIA PadLock not detected.
wlan0: no IPv6 routers present
wlan0: disassociate(reason=3)
wlan0: Initial auth_alg=0
wlan0: authenticate with AP XX:XX:XX:XX:XX:XX
wlan0: RX authentication from XX:XX:XX:XX:XX:XX (alg=0 transaction=2 status=0)
wlan0: authenticated
wlan0: associate with AP XX:XX:XX:XX:XX:XX
wlan0: RX AssocResp from XX:XX:XX:XX:XX:XX (capab=0x411 status=12 aid=1)
wlan0: AP denied association (code=12)
ADDRCONF(NETDEV_UP): wlan0: link is not ready
ADDRCONF(NETDEV_UP): wlan0: link is not ready
eth0: no link during initialization.
ADDRCONF(NETDEV_UP): eth0: link is not ready
ADDRCONF(NETDEV_UP): wlan0: link is not ready
wlan0: Initial auth_alg=0
wlan0: authenticate with AP XX:XX:XX:XX:XX:XX
wlan0: RX authentication from XX:XX:XX:XX:XX:XX (alg=0 transaction=2 status=0)
wlan0: authenticated
wlan0: associate with AP XX:XX:XX:XX:XX:XX
wlan0: RX AssocResp from XX:XX:XX:XX:XX:XX (capab=0x431 status=0 aid=1)
wlan0: associated
wlan0: CTS protection enabled (BSSID=XX:XX:XX:XX:XX:XX)
wlan0: switched to short barker preamble (BSSID=XX:XX:XX:XX:XX:XX)
ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
wlan0: no IPv6 routers present
[/codec75t7c94]

There are actually three association attempts above. The first and third are with NetworkManager, the second is the one I have problem with.

Any ideas?

Starcrasher

27-04-2008 09:41:38

First, to be sure you don't have several drivers loaded at same time, you could examine the result of /sbin/lsmod | grep rt[/color1esmtjfx].

If you are using wpa_supplicant, you should update your kernel and give the new rt2x00 drivers a try since they are designed to work with it.
In this case, the driver for wpa_supplicant is wext. (The option is -Dwext)

In you still want to use the rt73 legacy driver, you can try to use wpa_supplicant but you have to use a recent version and the ralink driver instead. (The option is -Dralink)

ecthelion

27-04-2008 16:50:51

I didn't make myself clear enough.

I used a wpa_supplicant.conf file with ndiswrapper, and everything was fine. When I switched to a new kernel (in a fresh installation, so I don't have ndiswrapper there), I decided to give a go to rt2x00. Ndiswrapper works with wireless extensions (wext), so is rt2x00. But with rt2x00 something is wrong during association


wpa_driver_wext_set_wpa
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_countermeasures
[b21senny7]ioctl[SIOCSIWAUTH] Operation not supported[/b21senny7]

Does anyone managed to connect to WPA2 protected network with rt2x00 without NetworkManager? Can you post your wpa_supplicant configuration file, please.

ecthelion

28-04-2008 19:38:29

Output of lsmod | grep rt
[code3hjmd6vk]parport_pc 25364 0
gameport 13708 2 ns558
snd_mpu401_uart 10240 1 snd_mpu401
parport 32084 2 ppdev,parport_pc
snd_rawmidi 22400 1 snd_mpu401_uart
rt2500usb 24192 0
rt73usb 26880 0
crc_itu_t 5760 1 rt73usb
rt2x00usb 12544 2 rt2500usb,rt73usb
rt2x00lib 31744 3 rt2500usb,rt73usb,rt2x00usb
snd 48312 17 snd_mpu401,snd_mpu401_uart,snd_rawmidi,snd_intel8x0,snd_ac97_codec,snd_seq_dummy,snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer
rfkill 9108 1 rt2x00lib
input_polldev 7176 1 rt2x00lib
mac80211 184928 2 rt2x00usb,rt2x00lib
cfg80211 24712 2 rt2x00lib,mac80211[/code3hjmd6vk]

Am I supposed to remove one of the rt73usb/rt2500usb?

Starcrasher

28-04-2008 23:10:18

Since you were using rt73 legacy driver, I suggest you to blacklist rt2500usb which is corresponding to rt2570 legacy driver.

ecthelion

29-04-2008 10:42:51

Are you sure? I thought the line
[coderfboky0z]rt2x00usb 12544 2 rt2500usb,rt73usb[/coderfboky0z]
shows that it isn't part of the legacy driver. In fact I'm dual booting now, and the system in question never used legacy driver. The only file copied from the old system is the wpa_supplicant.conf.

Starcrasher

29-04-2008 11:45:06

No, you are right, rt2500usb is not a part of the rt2570 legacy driver.
But it is the part in the new driver for devices that used to be managed via rt2570.
Yours was using rt73 and should now use rt73usb, so I think there is no reason to load rt2500usb.