# wpa-psk madwifi -solved

## info4all

I have a wg511u that runs just fine with the madwifi drivers but I can't get wpa_supplicant to work.

```
 # wpa_supplicant -wdd -c/etc/wpa_supplicant.conf -iath0

Initializing interface 'ath0' conf '/etc/wpa_supplicant.conf' driver 'default'

Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'

Reading configuration file '/etc/wpa_supplicant.conf'

ctrl_interface='/var/run/wpa_supplicant'

ctrl_interface_group=0

eapol_version=2

ap_scan=1

Line: 238 - start of a new network block

ssid - hexdump_ascii(len=12):

     #sorry no looky#               mystic trees    

proto: 0x1

key_mgmt: 0x2

PSK (ASCII passphrase) - hexdump_ascii(len=15): [REMOVED]

pairwise: 0x18

group: 0x1e

priority=1 (0x1)

PSK (from passphrase) - hexdump(len=32): [REMOVED]

Priority group 1

   id=0 ssid='mystic trees'

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

Own MAC address: 00:0f:b5:38:a4:68

wpa_driver_hostap_set_wpa: enabled=1

ioctl[PRISM2_IOCTL_PRISM2_PARAM]: Operation not supported

Failed to enable WPA in the driver.

wpa_driver_hostap_set_wpa: enabled=0

ioctl[PRISM2_IOCTL_HOSTAPD]: Operation not supported

ioctl[PRISM2_IOCTL_PRISM2_PARAM]: Operation not supported

Failed to disable WPA in the driver.

wpa_driver_hostap_set_drop_unencrypted: enabled=0

ioctl[PRISM2_IOCTL_PRISM2_PARAM]: Operation not supported

wpa_driver_hostap_set_countermeasures: enabled=0

ioctl[PRISM2_IOCTL_PRISM2_PARAM]: Operation not supported

rmdir[ctrl_interface]: No such file or directory

```

here is my /etc/conf.d/wpa_supplicant file

```
 # Copyright 1999-2004 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo-x86/net-wireless/wpa_supplicant/files/wpa_suppli$

# List of interfaces

INTERFACES="ath0"

# Common arguments to all wpa_supplicant instances

ARGS="-w"

# Interface specific arguments

ARGS_ath0="-Dipw"

```

here is my /etc/conf.d/net file

```

# /etc/conf.d/net:

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

# Global config file for net.* rc-scripts

# This is basically the ifconfig argument without the ifconfig $iface

#

#iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"

#iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"

# For DHCP set iface_eth? to "dhcp"

# For passing options to dhcpcd use dhcpcd_eth?

#

iface_eth0="dhcp"

dhcpcd_eth0="-t 5"

# For adding aliases to a interface

#

#alias_eth0="192.168.0.3 192.168.0.4"

# NB:  The next is only used for aliases.

#

# To add a custom netmask/broadcast address to created aliases,

# uncomment and change accordingly.  Leave commented to assign

# defaults for that interface.

#

#broadcast_eth0="192.168.0.255 192.168.0.255"

#netmask_eth0="255.255.255.0 255.255.255.0"

# For setting the default gateway

#

#gateway="eth0/192.168.0.1"

modules=( "wpa_supplicant" )

wpa_supplicant ath0="-Dmadwifi"

wpa_timeout_ath0=60

modules=( "iwconfig" )

preferred_aps_ath0=( "default" )

associate_order_ath0="any"

#essid_ath0="default"

#config_default=( "dhcp" )

essid_ath0="any"

config_any=( "dhcp" )

```

and here is my /etc/wpa_supplicant.conf

```

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

eapol_version=2

ap_scan=1

network={

        ssid="mystic trees"

        proto=WPA

        key_mgmt=WPA-PSK

        psk="myPassPhrase" #has been changed of coarse

        pairwise=CCMP TKIP

        group=CCMP TKIP WEP104 WEP40

        priority=1

}

```

Am I missing a folder or do I need to make a file? I must be missing something but I don't know what. Any advice is much appriciatedLast edited by info4all on Tue May 17, 2005 1:56 pm; edited 1 time in total

----------

## Sky58

What version of the Madwifi drivers are you running?

----------

## info4all

I just downloaded the masked ones last week. I don't know what version that is and I don't know how to find oput but if you could explain how to find out I will let you know exactly.

Thanks

----------

## tutaepaki

Typo?

In your /etc/conf.d/net file you have

 *Quote:*   

> modules=( "wpa_supplicant" )
> 
> wpa_supplicant ath0="-Dmadwifi"
> 
> wpa_timeout_ath0=60 

 

Shouldn't  the 2nd line be

 *Quote:*   

> wpa_supplicant_ath0="-Dmadwifi"

 

(note the underscore prior to ath0 ??)

----------

## info4all

I fixed the typo but I got the same error. I was reading throught the error when I noticed that it was trying to use other drivers besides my madwifi so I added -Dmadwifi to the command and it got past the first error but this is what I get now.

```
# wpa_supplicant -wdd -c/etc/wpa_supplicant.conf -iath0 -Dmadwifi -K

Initializing interface 'ath0' conf '/etc/wpa_supplicant.conf' driver 'madwifi'

Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'

Reading configuration file '/etc/wpa_supplicant.conf'

ctrl_interface='/var/run/wpa_supplicant'

ctrl_interface_group=0

eapol_version=2

ap_scan=1

Line: 238 - start of a new network block

ssid - hexdump_ascii(len=12):

     6d 79 73 74 69 63 20 74 72 65 65 73               mystic trees    

proto: 0x1

key_mgmt: 0x2

PSK - hexdump(len=32): 74 96 8c f2 43 32 a8 02 cf 7d 7e 9e 0c 0a 70 2a 31 2e 44 67 0c 29 f1 0a 3f 27 27 ff 9a 7b 53 48

pairwise: 0x18

group: 0x1e

priority=1 (0x1)

Priority group 1

   id=0 ssid='mystic trees'

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

Own MAC address: 00:0f:b5:38:a4:68

wpa_driver_madwifi_set_wpa: enabled=1

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

Wireless event: cmd=0x8b06 len=8

RTM_NEWLINK, IFLA_IFNAME: Interface 'ath0' added

RTM_NEWLINK, IFLA_IFNAME: Interface 'ath0' added

Starting AP scan (broadcast SSID)

Wireless event: cmd=0x8b1a len=12

EAPOL: Port Timers tick - authWhile=0 heldWhile=0 startWhen=0 idleWhile=0

EAPOL: Port Timers tick - authWhile=0 heldWhile=0 startWhen=0 idleWhile=0

EAPOL: Port Timers tick - authWhile=0 heldWhile=0 startWhen=0 idleWhile=0

EAPOL: Port Timers tick - authWhile=0 heldWhile=0 startWhen=0 idleWhile=0

Wireless event: cmd=0x8b19 len=12

Received 550 bytes of scan results (3 BSSes)

Scan results: 3

Selecting BSS from priority group 1

0: 00:0f:b5:5b:94:3a ssid='mystic trees' wpa_ie_len=24 rsn_ie_len=0

   selected

Trying to associate with 00:0f:b5:5b:94:3a (SSID='mystic trees' freq=2462 MHz)

Cancelling scan request

Automatic auth_alg selection: 0x1

WPA: using IEEE 802.11i/D3.0

WPA: Selected cipher suites: group 8 pairwise 8 key_mgmt 2

WPA: using GTK TKIP

WPA: using PTK TKIP

WPA: using KEY_MGMT WPA-PSK

WPA: Own WPA IE - hexdump(len=24): dd 16 00 50 f2 01 01 00 00 50 f2 02 01 00 00 50 f2 02 01 00 00 50 f2 02

No keys have been configured - skip key clearing

wpa_driver_madwifi_set_drop_unencrypted: enabled=1

wpa_driver_madwifi_associate

Setting authentication timeout: 5 sec 0 usec

EAPOL: External notification - EAP success=0

EAPOL: External notification - EAP fail=0

EAPOL: External notification - portControl=Auto

Wireless event: cmd=0x8b1a len=25

EAPOL: Port Timers tick - authWhile=0 heldWhile=0 startWhen=0 idleWhile=0

EAPOL: Port Timers tick - authWhile=0 heldWhile=0 startWhen=0 idleWhile=0

EAPOL: Port Timers tick - authWhile=0 heldWhile=0 startWhen=0 idleWhile=0

EAPOL: Port Timers tick - authWhile=0 heldWhile=0 startWhen=0 idleWhile=0

EAPOL: Port Timers tick - authWhile=0 heldWhile=0 startWhen=0 idleWhile=0

Authentication with 00:00:00:00:00:00 timed out.

Added BSSID 00:00:00:00:00:00 into blacklist

No keys have been configured - skip key clearing

EAPOL: External notification - portEnabled=0

EAPOL: External notification - portValid=0

Setting scan request: 0 sec 0 usec

Starting AP scan (broadcast SSID)

Wireless event: cmd=0x8b1a len=12

EAPOL: Port Timers tick - authWhile=0 heldWhile=0 startWhen=0 idleWhile=0

EAPOL: Port Timers tick - authWhile=0 heldWhile=0 startWhen=0 idleWhile=0

EAPOL: Port Timers tick - authWhile=0 heldWhile=0 startWhen=0 idleWhile=0

EAPOL: Port Timers tick - authWhile=0 heldWhile=0 startWhen=0 idleWhile=0

cEAPOL: Port Timers tick - authWhile=0 heldWhile=0 startWhen=0 idleWhile=0

EAPOL: Port Timers tick - authWhile=0 heldWhile=0 startWhen=0 idleWhile=0

Wireless event: cmd=0x8b19 len=12

Received 550 bytes of scan results (3 BSSes)

Scan results: 3

Selecting BSS from priority group 1

0: 00:0f:b5:5b:94:3a ssid='mystic trees' wpa_ie_len=24 rsn_ie_len=0

   selected

Trying to associate with 00:0f:b5:5b:94:3a (SSID='mystic trees' freq=2462 MHz)

Cancelling scan request

Automatic auth_alg selection: 0x1

WPA: using IEEE 802.11i/D3.0

WPA: Selected cipher suites: group 8 pairwise 8 key_mgmt 2

WPA: using GTK TKIP

WPA: using PTK TKIP

WPA: using KEY_MGMT WPA-PSK

WPA: Own WPA IE - hexdump(len=24): dd 16 00 50 f2 01 01 00 00 50 f2 02 01 00 00 50 f2 02 01 00 00 50 f2 02

No keys have been configured - skip key clearing

wpa_driver_madwifi_set_drop_unencrypted: enabled=1

wpa_driver_madwifi_associate

Setting authentication timeout: 5 sec 0 usec

EAPOL: External notification - EAP success=0

EAPOL: External notification - EAP fail=0

EAPOL: External notification - portControl=Auto

Wireless event: cmd=0x8b1a len=25

EAPOL: Port Timers tick - authWhile=0 heldWhile=0 startWhen=0 idleWhile=0

Signal 2 received - terminating

No keys have been configured - skip key clearing

EAPOL: External notification - portEnabled=0

EAPOL: External notification - portValid=0

wpa_driver_madwifi_set_wpa: enabled=0

wpa_driver_madwifi_set_drop_unencrypted: enabled=0

wpa_driver_madwifi_set_countermeasures: enabled=0

Removed BSSID 00:00:00:00:00:00 from blacklist (clear)

```

I kept the passphrase information in because it is not the real passphrase.

Does this make sense to anybody? I'm trying to read it but I am not exactly sure what is going on. This informatio or information like this continues to fill the screen but I have yet to make a connection.

Thanks

----------

## Naan Yaar

FWIW, wpa_supplicant-0.4.0 does not work with WPA-PSK on my machine.  I have a madwifi card (Atheros chipset) with the latest madwifi driver (madwifi-driver-0.1_pre20050420).  When I upgraded to wpa_supplicant-0.4.0, the WPA negotiation fails and I cannot get the wireless connection to work.  I switched back to wpa_supplicant-0.3.8, which was the one I was using previously and which is marked stable.  It works fine without any issues.

You can try emerging 0.3.8 to see whether it works better.  I plan to stick to the stable version of wpa_supplicant in the future.

----------

## info4all

 *Quote:*   

> FWIW, wpa_supplicant-0.4.0 does not work with WPA-PSK on my machine. I have a madwifi card (Atheros chipset) with the latest madwifi driver (madwifi-driver-0.1_pre20050420). When I upgraded to wpa_supplicant-0.4.0, the WPA negotiation fails and I cannot get the wireless connection to work. I switched back to wpa_supplicant-0.3.8, which was the one I was using previously and which is marked stable. It works fine without any issues.
> 
> You can try emerging 0.3.8 to see whether it works better. I plan to stick to the stable version of wpa_supplicant in the future.

 I am currently running the stable version. Would you mind looking at what I have posted and check it against your files. I have been attempting to tweek this for days with no luck. Do you use any other files or folders besides the ones I have posted.

Thanks for your help

----------

## Naan Yaar

Your configuration looks similar to mine.  A couple of differences:

a. Instead of two modules lines in my /etc/conf.d/net, I have:

```

modules=( "wpa_supplicant" "!iwconfig" )

```

Note the !iwconfig above.

b. In wpa_supplicant.conf, you have set eapol_version to 2.  In mine, it is not set; hence it defaults to 1.  You may want to try this.

My configuration files are as follows:

1. /etc/conf.d/net

```

dhcpcd_ath0="-N"

wpa_supplicant_ath0="-Dmadwifi"

modules=( "wpa_supplicant" "!iwconfig" )

```

2. /etc/wpa_supplicant.conf

```

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

fast_reauth=1

network={

        ssid="mylan"

        proto=WPA

        key_mgmt=WPA-PSK

        psk="mypassword"

}

```

What AP are you using?  Are you sure it can negotiate WPA-PSK properly with other clients?

----------

## info4all

 :Smile:  Thank you Naan Yaar. I took the safe path and pasted the changes into my files and now I can associate and negotiate the key with the AP. Just 2 quick questions if you don't mind. 1) wpa-cli only works as root otherwise I get "could not connect to wpa_supplicant - re-trying". Is this normal? 2) What do I have to do to get internet access with the wireless? 

Thank you again for all your help.

Oh BTW my AP is netgear model WGR614 v5 just incase anybody else wanted that information.

----------

## Naan Yaar

Good! Re:

1. wpa_cli needs to be run as root.  The error is normal if you run as a regular user.

2. I use the version of baselayout that has wireless support; when I switched over to a wireless NIC sometime earlier this year, doing this required the use of the ~x86 versions of baselayout and some dependencies.  Right now, my baselayout version is baselayout-1.11.11-r3.  With this version, all I need to do is to have the configuration files that I had posted above and then do:

```

cd /etc/init.d

ln -s net.lo net.ath0

rc-update add net.ath0 default

/etc/init.d/net.ath0 start

```

Before you do this, you need to bring down wpa_supplicant if you had started it manually.

If you want to do a quick check without doing the above first, you can do the following:

a. Bring up wpa_supplicant manually as you did

b. Do:

```

dhcpcd ath0

```

If it works OK, you should see something like the following:

```

ath0      Link encap:Ethernet  HWaddr 00:0F:3D:AE:35:5C

          inet addr:192.168.1.103  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:374484 errors:40637 dropped:0 overruns:0 frame:40637

          TX packets:378750 errors:562 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:199

          RX bytes:211790427 (201.9 Mb)  TX bytes:152475974 (145.4 Mb)

          Interrupt:5 Memory:e0980000-e0990000

```

when you do "/sbin/ifconfig".

 *info4all wrote:*   

>  Thank you Naan Yaar. I took the safe path and pasted the changes into my files and now I can associate and negotiate the key with the AP. Just 2 quick questions if you don't mind. 1) wpa-cli only works as root otherwise I get "could not connect to wpa_supplicant - re-trying". Is this normal? 2) What do I have to do to get internet access with the wireless? 
> 
> Thank you again for all your help.
> 
> Oh BTW my AP is netgear model WGR614 v5 just incase anybody else wanted that information.

 

----------

## info4all

Sorry for the late reply but I am glad to announce that the wireless now works  :Very Happy:   The only odd thing going on now is that mozilla won't use the default account any more. If anyone knows anything about this or can post a link please do. In the mean time I want to thank everyone for their input and I will be hunting for a mozilla solution.

Oh BTW I am using the stable version of baselayout and it seems to be working just fine.

----------

