# Running USB WiFi in hostap mode



## Enlightenment (Nov 29, 2008)

Hello everyone,

For a friend i'm building a small NAT gateway running FreeBSD 7.0 i386. It is a small form factor PC with one onboard 10/100Mbps ethernet which works fine and an USB Wlan 54g device supported by the rum driver. The setup looks like:


*WAN* --> *Modem* --(ethernet)--> *FreeBSD Gateway* --(wireless)--> *Ubuntu client* --(bridge)--> *LAN*


To communicate with the LAN, the wlan USB device on the FreeBSD server is configured in hostap mode ("access point" mode) and the Ubuntu clients connects to server with a WPA2 config which works great.

*The problem*: the rum-driver does not support changing the link speed dynamically while operating in hostap mode, causing the Linux client to loose connection when it tries to downgrade to a lower speed. The FreeBSD server will just keep running on 54Mbps while the clients wants to downgrade to 32Mbps or something, and then the connection drops. So it keeps re-associating and dis-associating which is an unusable solution.

The manual driver says:


> The rum driver supports automatic control of the transmit speed in BSS
> mode only.  Therefore the use of a rum adapter in Host AP mode is dis-
> couraged.



I thought i could circumvent this restriction by letting the Ubuntu client connect with a static link speed (like 5Mbps), but i can't seem to set the link speed directly. Another option is to let Linux play access point and let FreeBSD connect to the Ubuntu box. But that would not be ideal given the purpose of the FreeBSD server as gateway NAT-appliance.

So right now, i'm kind of stuck. Anyone has any recommendations?


PS. I'm extremely excited to see FreeBSD now has official forums, thanks to everyone who made that possible.


----------



## Mel_Flynn (Dec 2, 2008)

The best advice is to use an atheros based card for your AP. It's the only driver I know of that is reliable for the task.


----------



## Enlightenment (Dec 7, 2008)

Well, as far as i know all USB WiFi drivers under FreeBSD have this limitation. So that means i need a PCI adapter but there is no space for one, not even with a riser. So USB is the only workable option i'm afraid.

That's why i thought i could simply set the Linux client to use 11Mbps for example and have a stable link without dynamic link changes (which aren't supported by the rum-driver in hostap mode). In theory this should work, the problem is that i have been unable to set the link speed directory on Linux, while it works on FreeBSD. So i guess i'm kind of stuck now. I was hoping for some great idea i have not yet considered.


----------

