# WPA Madwifi Hell - I can't be the only one!

## msalerno

I know I am not the only one going through this hell!  With the current config, the adapter does not start automatically.

I have been able to get ath0 to connect to the network, but only manually, by following these steps:

1. /sbin/wlanconfig ath0 create wlandev wifi0 wlanmode sta

2. wpa_supplicant -Dmadwifi -iath0 -c /etc/wpa_supplicant.conf -dd

3. ifconfig ath0 192.168.10.5 netmask 255.255.255.0

4. route add default gw 192.168.10.1

I know that at this point, I need to be close, but I am missing something.  I have spent so much time going through these config files that I am sure it's something really simple I overlooked.

Any assistance would be greatly appreciated!

wpa_supplicant-0.5.1

madwifi_driver-0.1443.20060207

madwifi_tools-0.1443.20060207

sys-apps/baselayout-1.11.14-r5

/etc/conf.d/net

```
/sbin/wlanconfig ath0 create wlandev wifi0 wlanmode sta

wpa_supplicant -Dmadwifi -iath0 -c /etc/wpa_supplicant.conf -dd

ifconfig ath0 192.168.10.5 netmask 255.255.255.0

route add default gw 192.168.10.1

]ifconfig_ath0=("192.168.10.5 netmask 255.255.255.0")

routes_ath0=("default via 192.168.0.1")

modules=( "wpa_supplicant" )

wpa_supplicant_ath0="-Dmadwifi" # For Atheros based cards

wpa_timeout_ath0=10

config_ESSID=( "Mapuche" )

preup() {

        if [ "${IFACE}" = "ath0" ]; then

                /sbin/wlanconfig ath0 create wlandev wifi0 wlanmode sta

        return $?

        fi

}

postdown() {

        if [ "${IFACE}" = "ath0" ]; then

                killall wpa_supplicant

                /sbin/wlanconfig ath0 destroy

                return $?

        fi

}
```

/etc/wpa_supplicant.conf

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

fast_reauth=1

ap_scan=1

network={

        ssid="Mapuche"

        scan_ssid=1

        proto=WPA

        key_mgmt=WPA-PSK

        psk="D75B4BC374CC1B51F11F1B4D80"

}
```

Last edited by msalerno on Fri Feb 24, 2006 5:09 am; edited 2 times in total

----------

## RayDude

You're lucky your trying now, for a while (about four to five months) last year there was no way to get it to work without using old versions of stuff.

I am running, here's what I'm using:

```
*  sys-apps/baselayout

      Latest version available: 1.12.0_pre16-r1

      Latest version installed: 1.12.0_pre16-r1

*  net-wireless/wpa_supplicant

      Latest version available: 0.5.1

      Latest version installed: 0.5.1

 

*  net-wireless/madwifi-driver

      Latest version available: 0.1443.20060207

      Latest version installed: 0.1443.20060207

*  net-wireless/madwifi-tools

      Latest version available: 0.1443.20060207

      Latest version installed: 0.1443.20060207
```

Please note: to get these you have to add this to your /etc/portage/package.keywords:

```
sys-apps/baselayout ~x86

net-wireless/madwifi-driver ~x86

net-wireless/madwifi-tools ~x86

net-wireless/wpa_supplicant ~x86
```

There is one small problem I just figured out.

net.eth0 starts, even if you have removed it from startup with rc-update del net.eth0.

If you're like me and don't have your ethernet connected at some point you will not be able to connect to the internet (even though local lan works, looks like DNS fails).

However you can get it back by typing: /etc/init.d/net.eth0 stop

Strange...

Good luck, feel free to ask more questions.

Raydude

----------

## msalerno

I used to have it all working, but I upgraded then I downgraded and went back and forth a few times, then the ebuild for wpa_supplicant-0.4.5 was removed, and I saw that madwifi was supported by the new wpa client, so I wanted to try it. I am just looking for some help with the configuration.  I would imagine (purposely don't use assume  :Wink:  ), that if I can get it working by using the existing wpa_supplicant configuration from the command line, I must have something screwed up in my /etc/conf.d/net file.

----------

## Pandor

 *msalerno wrote:*   

> ...I must have something screwed up in my /etc/conf.d/net file.

 

pre up and post down, are no longer needed in your net script.

prior to version 1407, you had to manually create the device. (you could use the preup and postdown, or an udev rule).

But now the driver itself creates it by default.

see http://madwifi.org/wiki/UserDocs/autocreate

and Bug #121913 .

----------

## MadScientist

 *msalerno wrote:*   

> 
> 
> ```
> psk="D75B4BC374CC1B51F11F1B4D80"
> ```
> ...

 

Assuming you changed this since posting it - it is your password to get on the network...

----------

## Pandor

 *MadScientist wrote:*   

>  *msalerno wrote:*   
> 
> ```
> psk="xxxxxxxxx"
> ```
> ...

 

And quoting it again is a good thing. 

You'dd better wacht out now, you gonna get some leechers camping at your door   :Rolling Eyes: 

btw, *the above was meant sarcastic*...   :Wink: 

----------

## TenPin

I'm using the same versions as you.

wpa_supplicant-0.5.1, madwifi-driver-0.1443.20060207, wireless-tools-28_pre10, latest baselayout

The trick for me to getting it working was simply to set wpa_timeout_ath0=90 in /etc/conf.d/net

For some reason the new driver takes about twice as long as the old driver to connect to my access point.

Here is my wpa_supplicant.conf, I'm using WPA-PSK with AES.

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

eapol_version=1

ap_scan=1

fast_reauth=1

network={

    ssid="wander"

    psk=2338f3dc97d2a573cuahsdkfuh7hihqi3h7777739e3f8a81b79eff550b259f46a9cf2

    priority=1

    scan_ssid=1

}

----------

## msalerno

Awesome!  I am in the process of getting married this week, so I'll put it in place next week!

----------

## LimeFrog

Yay, i finally got my wireless WPA-PSK network running by adding this line to wpa_supplicant.conf.

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

network={

    ssid="Valhalla"

    ---> bssid=00:00:00:00:00:00 <---

    proto=WPA

    key_mgmt=WPA-PSK

    pairwise=TKIP

    group=TKIP

    psk="password"

}
```

Set the bssid to your AP's MAC-adress.

I hope that it helps, it did for me atleast.  :Very Happy: 

----------

## plonka2000

Hi,

Can someone advise a method to configure wpa_supplicant to connect to a unsecured network?

My network at the moment is technically unsecured but is hardware MAC filtered.

When I try and connect, I get errors.

I basically just want it to connect to a specific ssid without any encryption.

This is my current /etc/wpa_supplicant.conf:

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

network={

   ssid="wireless1"

   scan_ssid=1

   key_mgmt=IEEE8021X

   eap=TLS

   identity="user@example.com"

   ca_cert="/etc/cert/ca.pem"

   client_cert="/etc/cert/user.pem"

   private_key="/etc/cert/user.prv"

   private_key_passwd="password"

   eapol_flags=3

}
```

----------

## LimeFrog

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

network={

    ssid="your network"

    key_mgmt=NONE

}
```

Something like this?  :Smile: 

----------

## plonka2000

 *LimeFrog wrote:*   

> 
> 
> ```
> ctrl_interface=/var/run/wpa_supplicant
> 
> ...

 

Hi and thanks for the reply.

I have done that after piecing together lots of info from forums and the official wpa_supplicant readme.

Its got to the point that I've already started my own thread about it https://forums.gentoo.org/viewtopic-t-438895.html. Its been an ongoing issue for nearly a week now.

The connection just seems to 'loop'.  :Sad: 

----------

## LimeFrog

Gah, it looks like i spoke to soon. I'm still having problems getting my connection up.

But it goes up after some restarts of ath0, though wpa_supplicant says the process fails. So all i have to write is "ifconfig ath0 192.168.0.3/24" and it works.

Ideas anyone?  :Rolling Eyes: 

----------

## sundialsvc4

 *msalerno wrote:*   

> Awesome!  I am in the process of getting married this week, so I'll put it in place next week!

 

 :Very Happy:  Congratulations!  :Very Happy: 

----------

## RayDude

 *LimeFrog wrote:*   

> Gah, it looks like i spoke to soon. I'm still having problems getting my connection up.
> 
> But it goes up after some restarts of ath0, though wpa_supplicant says the process fails. So all i have to write is "ifconfig ath0 192.168.0.3/24" and it works.
> 
> Ideas anyone? 

 

Are you running ifplugd or netplug?

It helps keep my eth0 (which is unplugged) from screwing up my DNS.

Raydude

----------

## LimeFrog

No but net.eth0 never starts up, atleast that's what "ifconfig -a" tells me.  :Smile: 

----------

