# Ath9k master mode with hostapd - What to put in conf.d/net?

## Jords

Hi, I'm trying to setup a Dlink DWA-556 (atheros 5418 chipset, PCIE) to run a 802.11n network in master mode, bridged to my local network (which is on eth0).

My conf.d/net:

```

channel_wlan0="11"

essid_wlan0="THOMSN"

mode_wlan0="master"

config_eth0="null"

config_wlan0="null"

bridge_br0="eth0 wlan0"

config_br0="dhcp"

```

From what i've been able to find out, ath9k cards cannot be configured into master mode using iwconfig, and instead have to be put into this mode using hostapd. My problem, however, is that if I use the net block above, gentoo tries to put the card into monitor mode which fails. However, if i don't specify mode_wlan0="master", it tries to connect to other wireless networks which isn't right either. So how do i get gentoo to just bring up the interface and leave it at that?

My hostapd.conf:

```

interface=wlan0

bridge=br0

driver=nl80211

logger_syslog=-1

logger_syslog_level=2

logger_stdout=-1

logger_stdout_level=2

dump_file=/tmp/hostapd.dump

ctrl_interface=/var/run/hostapd

ctrl_interface_group=0

ssid=THOMSN

hw_mode=g

channel=11

beacon_int=100

dtim_period=2

max_num_sta=255

rts_threshold=2347

fragm_threshold=2346

macaddr_acl=0

auth_algs=3

ignore_broadcast_ssid=0

wme_enabled=0

ieee80211n=1

ht_capab=[HT40-][SHORT-GI-40][DSSS_CCK-40]

eapol_key_index_workaround=0

eap_server=0

own_ip_addr=127.0.0.1

wpa=bit1

wpa_passphrase=*****************

wpa_key_mgmt=WPA-PSK WPA-EAP

wpa_pairwise=TKIP CCMP

```

Does anyone have some experience in setting up ath9k cards in master mode? I'm quite lost with this  :Smile: 

----------

## Jords

I may have fixed this by putting

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

in my conf.d/net file. I say 'may' because i'm currently quite a long way away from the system that i'm setting this up from, everything is starting fine now but will have to see if it works!  :Smile: 

----------

## Mike Hunt

You can also take a look at  The very good Gentoo wireless docs  :Very Happy: 

----------

## Jords

That modules_wlan0 line fixed this.

----------

## risa2000

Looking at your configuration in /etc/conf.d/net I am wondering if the lines:

```
channel_wlan0="11"

essid_wlan0="THOMSN"

mode_wlan0="master" 
```

 are really necessary. I believe these are in fact configured by hostapd. On the other hand, if you disable iwconfig and wpa_supplicant, I wonder what is then used to set them?

I am currently fighting some problems at https://forums.gentoo.org/viewtopic-t-788531-highlight-ath9k+hostapd.html, but the only line I have in my /etc/conf.d/net file is 

```
config_wlan0=( "192.168.2.10/24" )
```

, but this seems to give other troubles...

----------

