Setting up a Wifi Adapter to support "master mode"
What we need for a wireless "base-station" or "access-point" is a wireless network card that does "master mode", which allows our Linux box to behave just like products from the likes of Linksys, Netgear & Belkin - later sections of this HOWTO should be pretty much the same whether you can find a 802.11a, 802.11b or g card that does master mode in Linux.
Purchasing a WiFi adapter
Select a card that supports "master mode". Be careful when buying a card for this project: - WLAN cards documented as Linux-supported often become no longer available. As a common cost-cutting measure, wireless adapter manufacturers will revise an existing product's specifications, substituting a different chipset (or other components) without changing the (formerly Linux-compatible product's) model number. Naturally, this is a common source of confusion for individuals attempting to purchase a compatible adapter, even when they think they know which adapter to buy. Manufacturers don't help matters much, often using strange naming conventions that produce numerous confusingly similar model names and numbers. Consider: At one point D-Link offered 3 different revisions (with 3 different chipsets) of its DWL-520 adapter, as well as the (completely different) DWL-520+, which was not to be confused with the entirely unrelated DWL-G520, DWL-A520, not to mention the 8 varieties of product offered under the "DWL-620" moniker. Thus it is crucially important to pay close attention not just to manufacturer/model names, but also revision numbers (if provided), chipsets, included drivers, etc, as well. (If uncertain, consider purchasing from a retailer who offers a "consumer friendly" return policy, so the product can be returned/exchanged if it turns out to be incompatible.)
There are very few 802.11N USB adapters with chipsets that clearly support master mode on free software platforms. The situation is rapidly deteriorating as chipset manufacturers have not released source code or specifications in many years. One place to purchase a compatible adapter is http://www.thinkpenguin.com/. http://linuxwireless.org/ also maintains a list of adapters and information on master mode compatibility. This list can be very misleading as most adapters which had a compatible chipset have been long discontinued.
When selecting a PCI adapter, cards based on Atheros chipsets tend to be compatible: http://madwifi.org/
Determine wifi adapter chipset
Doing a Google search on the manufactures part number usually gets results e.g. "Cnet CWP-854 chipset" should give you the result of Ralink rt2561 or rt61. The other option is to plug the wifi adapter into a Linux box and type the commands:
for PCI adapters
for USB adapters
Using these commands you should have enough clues to your wifi adapters chipset.
Test an adapter for "master mode"
To check if an adapter and driver can do master mode you can use a program called 'iwconfig'
In the terminal window should list all available wireless interfaces. Assuming your adapter is connected and its drivers are loaded, try the following.
sudo iwconfig wlan1 mode master
Replace wlan1 with whatever Ubuntu is calling your adapter. If you don’t get an error you’re in business.
mac80211 based driver
Many newer drivers use the mac80211 framework. The iwconfig method of checking for master mode doesn't work with these drivers, because they use the new nl80211 interface for userspace communication.
You have to install 'iw' the new wireless configuring tool at first.
sudo aptitude install iw
'iw list' shows all supported features of all installed wireless card supporting the new nl80211 interface.
If there is 'AP' in the list of "Supported interface modes" your device will support the Access Point mode with hostapd.
... Supported interface modes: * IBSS * managed * AP * AP/VLAN * monitor * mesh point ...
Note that cards using these drivers are 11MBPS only.
Jason Boxman provides quite an excellent description of these drivers: HostAP enables 802.11b access point functionality utilizing the secondary (STA) firmware of Intersil's Prism2, Prism2.5, or Prism3 chipsets for time sensitive tasks. All other functionality is handled via the driver, including WEP and passing frames off to a port authenticator, like FreeRADIUS. Presently, HostAP works with Intersil's Prism chipset and cards utilizing PCI and PC Card interfaces to the host system. (PLX bridging is also supported)
Atheros card setup for routing resource =
You have to install the Source to get the driver into Master mode for a WAP
- For "ubuntu server edition" do the following
- For other editions just enable restricted drivers
wget http://downloads.sourceforge.net/madwifi/madwifi-0.9.4.tar.gz tar -xvzf madwifi-0.9.4.tar.gz cd madwifi-0.9.4 sudo apt-get install build-essential linux-headers-server sudo make sudo make install
- # Edit your kernel modules loaded at boot time:
sudo nano /etc/modprobe.d/madwifi
add this to make sure the wireless card goes into Master mode:
options ath_pci autocreate=ap
load the module without a reboot
sudo modprobe ath_pci
mac80211 based drivers
Some mac80211 based drivers are supporting access point or master modus. A good manual for then can be found at: http://linuxwireless.org/en/users/Documentation/hostapd
NDISwrapper cards are NOT SUITABLE for base-station use - they don't do master mode. NDISwrapper is basically a layer of interfacing glue to use Windows drivers with Linux, and so it denies access to some of the more interesting &/or esoteric functions of the wireless card (because NDIS has no programming interface for them, I guess).
If you have a wireless card that you're currently using with NDISwrapper then it's possible that there are native drivers for it - I've seen quite a few posters to the Ubuntu forums suggesting using NDISwrapper with Ralink cards, for instance - but it's more likely that you'll have to bin it (or put it in your sister's Windows PC) and get a card with native drivers that interface properly with the kernel. NOTE: You can accomplish a similar goal with an Ad-Hoc network; this might help.
I wanted a card that supported the Prism54 drivers, as they seemed to be about the most mature ones for "54G" wireless cards under Linux at the time I was looking - my Powerbook has Airport Extreme, Apple's name for 802.11g, so I might as well make use of it. I took a good look through the supported cards and decided upon the Allnet ALL0271. It seemed to be fairly well-recommended on the Prism54.org forums - there are too many short comments saying "worked for me" for me to post all the individual links, so do a search & read all the threads for yourself.
You can order the ALL0271 from the US, from Germany or if you're in the UK, I actually bought a handful, so email me if you'd like to buy one. I also recently got one of these cards working on a friend's SuSE 9.1 box, although the process isn't as brain-dead as it is under Gentoo - portage & the ebuilds automate the process so well.
Ralink rt2400 / rt2500
As I see on the rt2x00 project page, the new branch rt2x00 beta drivers support master mode and all advanced features, but legacy rt2400, rt2500, rt2570, rt61 drivers do not, but I have no way to test such setup.
For more details on this driver see the project homepage.
Broadcom 43xx cards (bcm43xx.ko)
Broadcom cards support master mode using the reverse-engineered kernel driver. You need to enable (or make as a module) the Softmac wireless extensions and BCM43xx wireless driver.
Realtek RTL8180 cards (rtl8180-sa2400 project)
Master mode is working correctly together with promiscuous mode. Supports WEP open encryption and possibly TKIP/CCMP(not tested). Supports only 1/2/5.5/11M modes.
Texas Instruments ACX100/ACX111
In cards based on this chip (ex. D-Link DWL-520+) master mode is not fully implemented (as of 2007-01-01 driver) and there are some different problems like sometimes no beacons are broadcasted and card can't be properly initiated. Supports 1/2/5.5/11M(b) and 22M(b+) modes.
Intel PRO/Wireless (ipwXXXX) series
For ipw2100/ipw2200, unfortunately there is no way to use them as AP, but this can be done for ipw3945 and ipw4965, maybe ipw2915 too, which are pretty good cards anyway, using fully open-source iwlwifi drivers, but it can't be done with old Intel drivers with closed microcode.
ZyDAS ZD1211 802.11b/g USB WLAN chipset Linux drivers Initially contributed by ZyDAS under the GPL license, the ZD1211 Linux driver is maintained by the open source community..
zd1211 chipset supports master mode, but the drivers built into Ubuntu for the zd1211 chipset do not. Luckily another set of drivers exist and they work with master mode. http://zd1211.wiki.sourceforge.net/VendorBasedDriver
If you’re compiling and installing the zd1211 VendorBasedDriver for your wifi module (depending your chipset version) you may need to edit the Makefile to enable zd1211b mode. Also you’ll likely need to blacklist the driver built-in to the kernel to let the new VendorBasedDriver load instead.
sudo echo zd1211rw >> /etc/modprobe.d/blacklist