# wpa_supplicant+madwifi in master mode

## milosn

Hi

I am trying to set up home AP using wpa_supplicant+madwifi ... where exactly am i suppose to specify (in /etc/wpa_supplicant.conf) that the card should be set to master mode?

Using iwconfig based setup ATM and it works but i would really like to get that wpa_supplicant thingie working. Example configs are most welcome ... otherwise its trial and error i guess  :Wink: .

Regards

Milos

----------

## Adrien

Hi! 

I think there's no need to set the master mode anywhere. Hostapd should take care of this.

EDIT: Sorry, actually madwifi-tools is taking care of this. You have to put this in /etc/udev/rules.d/65-madwifi.rules:

```
KERNEL=="wifi[0-9]*", DRIVER=="ath_pci", ACTION=="add", RUN+="/sbin/wlanconfig ath create wlandev %k wlanmode ap"
```

The thing is, you have to use the latest versions of hostapd and wpa_supplicant and not to forget enabling the madwifi USE flag before emerging.

I also think wpa_supplicant isn't to be configured on the AP side, at least, I think I haven't done anything like this and my AP works just fine.

So here are my config files:

/etc/conf.d/hostapd

```
INTERFACES="ath0"

CONFIGS="/etc/hostapd/hostapd.conf"

OPTIONS="-B"
```

/etc/hostapd/hostapd.conf

```
##### hostapd configuration file ##############################################

bridge=br0 #Comment this out if you iface isn't bridged

interface=ath0

driver=madwifi

logger_syslog=-1

logger_syslog_level=2

logger_stdout=-1

logger_stdout_level=2

debug=0

dump_file=/tmp/hostapd.dump

ctrl_interface=/var/run/hostapd

ctrl_interface_group=0

ssid=my_SSID

macaddr_acl=1

accept_mac_file=/etc/hostapd/hostapd.accept

deny_mac_file=/etc/hostapd/hostapd.deny

auth_algs=3

eap_server=0

own_ip_addr=192.168.1.1

wpa=3

wpa_psk=my_key

wpa_key_mgmt=WPA-PSK

wpa_pairwise=TKIP CCMP
```

Of course you'll have to set the IP adress for ath0 in /etc/conf.d/net. I hope I haven't forgotten anything.

Oh and it's good to take a look at this HOWTO.

Let me know if you have any problems.   :Wink: 

Have fun!

----------

## milosn

 *Adrien wrote:*   

> 
> 
> Oh and it's good to take a look at this HOWTO.
> 
> Let me know if you have any problems.  
> ...

 

that HOWTO is exactly what i was looking for ... thanks

----------

