# WPA && WG511 && ndiswrapper

## Ghostryder

Hi,

up to now I was using my WG511 without an encryption. Now I want to use WPA. So I installed

*  net-wireless/wpa_supplicant

      Latest version available: 0.4.1

      Latest version installed: 0.4.1

      Size of downloaded files: 2,269 kB

      Homepage:    http://hostap.epitest.fi/wpa_supplicant/

      Description: IEEE 802.1X/WPA supplicant for secure wireless transfers

      License:     || ( GPL-2 BSD )

and

*  net-wireless/ndiswrapper

      Latest version available: 1.1-r1

      Latest version installed: 1.1-r1

I read some howtos too but I could not manage to get it working. Trying 

wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -D ndiswrapper -d

just gives me

ioctl[SIOCSIWPMKSA]: No such device

and then the card is blinking some time and stops after one or two seconds.

I already configured the file /etc/wpa_supplicant.conf.

I don't know where to go now? I can't get any other debugging message....

I also installed the latest version of baselayout. I also tried to use the program 'wpa_gui' but that leads just to the error:

Failed to open control connection to wpa_supplicant.

PING failed - trying to reconnect

PING failed - trying to reconnect

PING failed - trying to reconnect

PING failed - trying to reconnect

PING failed - trying to reconnect

PING failed - trying to reconnect

PING failed - trying to reconnect

No matter if I restart /etc/init.d/wpa_supplicant...

Any suggestions?

thanks in advance to everybody

----------

## RayDude

 *Ghostryder wrote:*   

> Hi,
> 
> up to now I was using my WG511 without an encryption. Now I want to use WPA. So I installed
> 
> *  net-wireless/wpa_supplicant
> ...

 

This is a known issue, and it means absolutely nothing. The driver is working.

I want to mention that wpa_supplicant is a daemon, it runs all the time and does not exit. When you get no messages from it, that usually means that its connecting.

 *Quote:*   

> and then the card is blinking some time and stops after one or two seconds.
> 
> I already configured the file /etc/wpa_supplicant.conf.
> 
> I don't know where to go now? I can't get any other debugging message....
> ...

 

wpa_supplicant takes serveral seconds to connect on my laptop. It is the biggest boot up delay on my laptop. But its worth it for the extra security. I have six neighbors with wifi and I feel better knowing they can't easilly hack me. Of course most of them aren't even running WEP... But that's another story.

It took me a good day to figure out how to configure wpa_supplicant. I first got WPA PSK running on my wife's Windows Machine to insure it worked, that made it easier as I knew it was purely Gentoo config from then on.

You didn't post wpa_supplicant.conf, so here's mine for example WPA PSK is the easiest to configure from what I have found and its pretty secure because machines must know the psk code to connect to the network and this code isn't transmitted (I think).

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

eapol_version=1

ap_scan=1

fast_reauth=1

network={

        ssid="SECRET"

        scan_ssid=1

        proto=WPA

        key_mgmt=WPA-PSK

        pairwise=TKIP

        group=TKIP

        psk="secret_password"

# The higher the priority the sooner we are matched.

        priority=5

}
```

And here's what my /etc/conf.d/net looks like: (you should post yours if you can't get it to work.)

```
iface_ath0="dhcp"

dhcpcd_ath0="-t 30 -N"

wpa_supplicant_ath0="-Dmadwifi"

modules=( "!iwconfig" "wpa_supplicant" )
```

If you have iwconfig installed, you really need the !iwconfig to keep baselayout on the right track.

Obviously you'll specify the ndiswrapper interface with -Dndiswrapper.

Raydude

----------

## Ghostryder

Thanks at first for your help. I have changed my files to the following:

[code]ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

eapol_version=1

ap_scan=1

fast_reauth=1

network={

        proto=WPA

        key_mgmt=WPA-PSK

        pairwise=TKIP

        group=TKIP

        ssid="XXXXX"

        scan_ssid=1

        psk="xxxxxxx"

        #psk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

        priority=5

}

[/code]

and 

[code]# /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="dhcp"

iface_wlan0="dhcp"

#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_wlan0="-t 30 -N"

wpa_supplicant_wlan0="-Dndiswrapper"

modules=("!iwconfig" "wpa_supplicant")

# 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=( "!iwconfig" )

#wpa_supplicant_eth1="-Dndiswrapper"

#wpa_timeout_eth1=60

[/code]

I try to start the interface with the command

[code]/etc/init.d/net.wlan0 start[/code]

The card is blinking for some seconds and then stops... Without any error message.

I don't know where I can get any debugging messages. Isn't there somewhere anything like: 'Your password is wrong. Entrance denied.'????

I really don't know what to do next....

Thanks

----------

## RayDude

I think the first thing to try is running everything on the command line: 

Remove net.wlan0 from your startup scripts: rc-update del net.wlan0, then reboot.

```
ifconfig wlan0 up

wpa_supplicant -dd -Dndiswrapper -iwlan0 -c /etc/wpa_supplicant.conf
```

Please note: wpa_supplicant will not exit and if its working you will only receive the one ioctl error message and nothing more. If you get more, those are your clues to what's failing.

Assuming you get no errors, in another window type:

```
dhcpcd wlan0
```

If that exits, then your network is up, you just gotta figure out why /etc/conf.d/net doesn't work.

I got buches of errors from wpa_supplicant while I was debugging my laptop, if you get errors post them. Maybe me or one of the other guys here can figure it out.

Raydude

----------

## Ghostryder

Ok. I tried the following:

[code]ifconfig wlan up[/code]

Worked without any error. The card started blinking and stopped after some seconds.

Afterwards I started:

[code]wpa_supplicant -dd -Dndiswrapper -iwlan0 -c /etc/wpa_supplicant.conf

ioctl[SIOCSIWPMKSA]: No such device

l2_packet_receive - recv: Network is down

 [/code]

That's it. I was only able to stop it with Ctrl+C. Before doing that I tried:

[code]dhcpcd wlan0[/code]

With no result, neither an error nor a positive message...

I don't know what's wrong, the network works without any problems in Windows XP. 

Thank you.

----------

## RayDude

 *Ghostryder wrote:*   

> Ok. I tried the following:
> 
> ```
> ifconfig wlan up
> ```
> ...

 

I suggest you step back a bit. Disable all security protocols on your router and try to get ndiswrapper working with iwconfig and dhcpcd. Once you can connect to your network, then you can tackle WPA.

Raydude

----------

## Ghostryder

Well I did it. Disabling all security options at my router lead to some achivements. The commands

ifconfig wlan0 up

iwconfig wlan0 essid XXXXX

dhcpcd wlan0

worked for my NIC. So I guess there's everything alright with ndiswrapper and my card. That's really confusing...

----------

## RayDude

 *Ghostryder wrote:*   

> Well I did it. Disabling all security options at my router lead to some achivements. The commands
> 
> ifconfig wlan0 up
> 
> iwconfig wlan0 essid XXXXX
> ...

 

No. That's really good. Now you need to futz with wpa_supplicant until it works. Read the man pages on it and its conf file and play with the settings. That's how I got mine to work.

Once you get it working on the command line, then you can put it in /etc/conf.d/net.

Feel free to ask questions.

Raydude

----------

