# hostapd & windows-clients



## tuhoaja (Jan 19, 2011)

Hi

I'm trying to setup 


```
FreeBSD 8.2-RC2 FreeBSD 8.2-RC2 #0: Wed Jan 12 17:26:33 UTC 2011     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
```

as a wireless access point for my computers.  I have ath0, where i have configured wlan0 to access internet and wlan1 to act as an access point.
In rc.conf i have


```
wlans_ath0="wlan0 wlan1"
create_args_wlan0="mode 11g country Finland"
create_args_wlan1="wlanmode hostap mode 11g country Finland"
ifconfig_wlan0="WPA inet <my ip> netmask 255.255.255.0"
ifconfig_wlan1="inet 192.168.0.1 netmask 255.255.255.0 channel 11"
```

and hostapd.conf as 


```
interface=wlan1
driver=bsd
debug=11
ctrl_interface=/var/run/hostapd
ctrl_interface_group=wheel
#country_code=FI
#dtim_period=2
ssid=freebsdap
wpa=2
wpa_passphrase=<my_secret_password>
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
```

Well it works, kindof.  With my iPad it connects just fine and gets ip from my DHCP-server, no problem, i can surf the web and do whatever I do.  But when I try to use it with my Windows XP or Windows 7 laptops, it does not work.

With wlandebug I managed to get the following output, repeated all over again:


```
Jan 19 07:15:22 reming kernel: wlan1: [00:0e:9b:ae:d7:6f] recv auth frame with algorithm 0 seq 1
Jan 19 07:15:22 reming kernel: wlan1: [00:0e:9b:ae:d7:6f] station authenticated (open)
Jan 19 07:15:22 reming kernel: wlan1: [00:0e:9b:ae:d7:6f] RSN ie: mc 1/0 uc 1/0 key 2 caps 0x0
Jan 19 07:15:22 reming kernel: wlan1: [00:0e:9b:ae:d7:6f] station associated at aid 1: short preamble, short slot time, QoS
Jan 19 07:15:22 reming kernel: wlan1:
Jan 19 07:15:22 reming kernel: [00:0e:9b:ae:d7:6f] station unauthorize via MLME
Jan 19 07:15:22 reming kernel:
Jan 19 07:15:25 reming kernel: wlan1: [00:0e:9b:ae:d7:6f] station deauth via MLME (reason 2)
Jan 19 07:15:25 reming kernel: wlan1: [00:0e:9b:ae:d7:6f] send station deauthenticate (reason 2)
Jan 19 07:15:25 reming kernel: wlan1: [00:0e:9b:ae:d7:6f] station with aid 1 leaves
```

It seems to authenticate just fine, but then bail out for some reason.

Anyone have any idea what to do or how to fix this?  Do I need some special configuration for windows-machines? Any ideas how to debug this further?


----------



## SirDice (Jan 19, 2011)

Try running hostapd by hand and add one or more '*-d*' options to turn on debugging. See if that gives any clues.


----------



## tuhoaja (Jan 21, 2011)

I did some changes, in rc.conf:


```
ifconfig_wlan1="-bgscan inet 192.168.0.1 netmask 255.255.255.0 channel 11"
```

And in hostapd.conf:


```
preamble=1
wpa_pairwise=CCMP
wpa_gmk_rekey=600
```

Now it seems that all the clients can connect, but the connection seems to drop every now and then(restarting hostapd helps on this).
I think I'll let it run for a while and try to debug the situation.


----------

