Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] madwifi + wpa_supplicant + WPA2PSK + AES problems
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
meranto
Tux's lil' helper
Tux's lil' helper


Joined: 23 Sep 2005
Posts: 129
Location: Ridderkerk, The Netherlands

PostPosted: Fri Feb 16, 2007 10:31 am    Post subject: [solved] madwifi + wpa_supplicant + WPA2PSK + AES problems Reply with quote

First of all, sorry for the non-informative title, but since I'm not really sure what is working and what is not I don't know what else to put here.

The hardware:

Wireless router using WPA2PSK + AES encryption, using DHCP. Works with other gentoo-box (wireless with ralink-rt60 card) and this box using windows.

The card (works):
Code:
02:04.0 CardBus bridge: Texas Instruments PCI1510 PC card Cardbus Controller
03:00.0 Ethernet controller: Atheros Communications, Inc. AR5005G 802.11abg NIC (rev 01)


The software:
Code:
[I--] [  ] net-wireless/wpa_supplicant-0.5.7
[I--] [  ] net-wireless/madwifi-ng-0.9.2.1
[I--] [  ] net-wireless/madwifi-ng-tools-0.9.2
[I--] [  ] sys-apps/pcmcia-cs-3.2.8-r2
[I--] [  ] sys-apps/pcmciautils-014-r1
[I--] [  ] virtual/pcmcia-2.6.13



The config:
Code:
/etc/conf.d/net

modules=( "wpa_supplicant" "dhcpcd" )

config_eth0=( "dhcp" )
dhcpcd_eth0="-t 10"

wpa_supplicant_ath0="-Dmadwifi -d"
wpa_timeout_ath0=30
mode_ath0="managed"
config_ath0=( "dhcp" )
dhcpcd_ath0="-t 60"


Code:
wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
ap_scan=1

network={
         scan_ssid=1
         ssid="xxxx"
         proto=WPA2
         key_mgmt=WPA-PSK
         pairwise=CCMP
         group=CCMP
         psk="xxxxxxxxxxxxx"
         priority=5
}


The output:
Code:
/etc/init.d/net.ath0 start

 * Starting ath0
 *   Starting wpa_supplicant on ath0 ...
Initializing interface 'ath0' conf '/etc/wpa_supplicant/wpa_supplicant.conf' driver 'madwifi' ctrl_interface 'N/A' bridge 'N/A'
Configuration file '/etc/wpa_supplicant/wpa_supplicant.conf' -> '/etc/wpa_supplicant/wpa_supplicant.conf'
Reading configuration file '/etc/wpa_supplicant/wpa_supplicant.conf'
ctrl_interface='/var/run/wpa_supplicant'
ctrl_interface_group='wheel' (DEPRECATED)
ap_scan=1
Priority group 5
   id=0 ssid='xxxx'
Initializing interface (2) 'ath0'
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
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
SIOCGIWRANGE: WE(compiled)=21 WE(source)=13 enc_capa=0xf
  capabilities: key_mgmt 0xf enc 0xf
WEXT: Operstate: linkmode=1, operstate=5
Own MAC address: xx:xx:xx:xx:xx:xx
wpa_driver_madwifi_del_key: keyidx=0
wpa_driver_madwifi_del_key: keyidx=1
wpa_driver_madwifi_del_key: keyidx=2
wpa_driver_madwifi_del_key: keyidx=3
wpa_driver_madwifi_set_countermeasures: enabled=0
wpa_driver_madwifi_set_drop_unencrypted: enabled=1
Setting scan request: 0 sec 100000 usec
ctrl_interface_group=10 (from group name 'wheel')
Added interface ath0
Daemonize..                                                                                                                              [ ok ]
 *   Starting wpa_cli on ath0 ...                                                                                                        [ ok ]
 *     Backgrounding ...


All seems right, but no DHCP takes place :? why not, it's listed in /etc/conf.d/net to a config via DHCP........

let's try it manually then:

Code:
dhcpcd -t 60 ath0
Error, timed out waiting for a valid DHCP server response


:evil:

looking at iwconfig:

Code:
iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

wifi0     no wireless extensions.

ath0      IEEE 802.11g  ESSID:"xxxx"  Nickname:""
          Mode:Managed  Frequency:2.427 GHz  Access Point: Not-Associated   
          Bit Rate:54 Mb/s   Tx-Power:18 dBm   Sensitivity=0/3 
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=47/94  Signal level=-48 dBm  Noise level=-95 dBm
          Rx invalid nwid:6849  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0


encryption key: off?????

I found myself lost here, anyone who can help me out with this, or am I better off leaving my laptop wired for the rest of it's life?
_________________
Linus Torvalds: "Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect."


Last edited by meranto on Wed Feb 21, 2007 7:33 pm; edited 2 times in total
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Fri Feb 16, 2007 1:32 pm    Post subject: Reply with quote

I would try starting wpa_supplicant manually and see where it's going wrong - use command line options to run it in the foreground and enable debugging.
You can also check its status with the command `wpa_cli status`
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
meranto
Tux's lil' helper
Tux's lil' helper


Joined: 23 Sep 2005
Posts: 129
Location: Ridderkerk, The Netherlands

PostPosted: Sat Feb 17, 2007 10:37 am    Post subject: Reply with quote

Although it doesn't fit the Gentoo-filosophy, I've tried to use the Gnome NetworkManager (hardmasked). This tool makes config-files redundant.

When trying to connect using no encryption, this tool works flawlessly, but as soon as I activate any kind of protection (WEP, WPA, WPA2 or whatever else) it stops working.

The log of my router tells me this after failing:

Code:
Saturday February 17, 2007 10:53:20 Associated: xx-xx-xx-xx-xx-xx st=0
Saturday February 17, 2007 10:53:24 Disassociated: xx-xx-xx-xx-xx-xx because WPA retey failed


supposibly the "retey" should be "retry", is this my config or just the router? In Win32 this combination works fine, could there be an issue with the madwifi-ng driver?
_________________
Linus Torvalds: "Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect."
Back to top
View user's profile Send private message
meranto
Tux's lil' helper
Tux's lil' helper


Joined: 23 Sep 2005
Posts: 129
Location: Ridderkerk, The Netherlands

PostPosted: Wed Feb 21, 2007 7:31 pm    Post subject: Reply with quote

it's working now, but not as I wished....

I had to set my router to accept both WPAPSK (TKIP) and WPA2PSK (AES) to get it to work, so all systems connect using WPA2PSK + AES and just this one using WPAPSK.....

My final configs:

Code:
lsmod

wlan_scan_ap            6016  0
wlan_xauth              1920  0
wlan_tkip              12672  1
wlan_ccmp               8704  1
wlan_acl                4736  0
wlan_scan_sta          13568  1
ath_pci                90528  0
ath_rate_sample        15104  1 ath_pci
wlan                  190812  9 wlan_scan_ap,wlan_xauth,wlan_tkip,wlan_ccmp,wlan_acl,wlan_scan_sta,ath_pci,ath_rate_sample
ath_hal               191696  3 ath_pci,ath_rate_sample


Code:
wpa_supplicant

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
eapol_version=1
ap_scan=1
fast_reauth=1

network={
ssid="xxxx"
key_mgmt=WPA-PSK
proto=RSN WPA
pairwise=CCMP TKIP
group=CCMP TKIP
scan_ssid=0
psk="XXXXXXXXXXXXXXXXXXXXXXXXXXX"
}


Code:
/etc/conf.d/net

modules=( "wpa_supplicant" "dhcpcd" )

config_eth0=( "null" )

wpa_supplicant_ath0="-D madwifi -c /etc/wpa_supplicant/wpa_supplicant.conf"
config_ath0=( "dhcp" )
dhcpcd_ath0="-t 60"


maybe it's just some issue/bug between the router firmware and the madwifi-ng driver, anyway, this can be considered working :)
_________________
Linus Torvalds: "Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect."
Back to top
View user's profile Send private message
meranto
Tux's lil' helper
Tux's lil' helper


Joined: 23 Sep 2005
Posts: 129
Location: Ridderkerk, The Netherlands

PostPosted: Thu Feb 22, 2007 5:57 pm    Post subject: Reply with quote

consider this as being my weblog from now on 8)

for those of you who might use this as a reference in the future, wpa_supplicant works fine, the only thing that doesn't work is WPA2PSK (RSN in wpa_supplicant.conf) in combination with AES (CCMP).

It fails when performing the 4-way handshake, step 2/4, so maybe it's a bug in wpa_supplicant, I'll keep looking anyway, I refuse to give up safety for something like this
_________________
Linus Torvalds: "Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect."
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum