Using a Unix computer as a 802.11 wireless base station

(For additional information about setting up a FreeBSD base station, see Mike DeGraw-Bertsch's article.)

If you have an Internet connection, and wish to access it using 802.11 wireless LAN cards, then one way to do this is to purchase a specialized 802.11 "Access Point" - e.g., Apple's "AirPort" - and connect this to your Internet connection. Alternatively, you can use a Unix computer as a base station. Using an open system for your base station gives you more flexibility in how you manage the network - for instance, you can also use the Unix system for specialized access control, statistics gathering, DNS, web caching, etc. etc. (Besides, if you already have a Unix system, then it's cheaper to use this, rather than buying a separate, dedicated Access Point.)

This page summarizes my experience in getting a general-purpose FreeBSD and Linux computer to act as a base station for a 802.11 wireless LAN. This should also be possible for other Unix systems (e.g., OpenBSD, Solaris). (It might also be possible with non-Unix systems such as Windows NT and Windows 2000, as they, too, can act as a router.)

(Another, slightly different approach is to take special-purpose 802.11 Access Point hardware, and port a open operating system to it. One recent example of this is "OpenAP", which is a port of Linux to access points based on the Eumitcom WL11000SA-N board.)

I assume here that Proxim (formerly Agere (formerly Lucent)) "Orinoco" (aka. "WaveLAN") PCMCIA cards (Silver or Gold) are used for the 802.11 interface. It's probably possible to use other brands of 802.11 interface instead, although the instructions for these (most notably, the Unix kernel device names) will be slightly different. In any case, I recommend that, whenever possible, wireless clients should use the same type of 802.11 interface as the base station. Although different brands of 802.11 interface are supposed to be interoperable, this is often not the case in practice.


The basics

First, your Unix kernel needs to be configured as an IP router. (If you're running Linux, your kernel needs to be configured with "CONFIG_IP_ROUTER" set.) The system also needs to have two network interfaces: one connected to the Internet (either directly, or via an Ethernet hub); the other for the wireless LAN interface. Plus, of course, you'll need to assign a range of IP addresses (perhaps served via DHCP) to the wireless LAN interface.

There are four possible ways to connect the wireless LAN card to your computer:

  1. Directly, using a PCMCIA slot
  2. Using a ISA<->PCMCIA adaptor, with the card plugged into this
  3. Using a PCI<->PCMCIA adaptor, with the card plugged into this
  4. (only as a last resort) Using an Orinoco Ethernet converter, with the card plugged into this
If your Unix system already has a PCMCIA interface, then I recommend that you use this (option 1).

If, however, your system doesn't have a PCMCIA interface, you can instead use an Orinoco ISA or PCI Adaptor (option 2 or 3). These are ISA or PCI cards - each currently costing about $US67 - with an integrated PCMCIA slot into which you insert your wireless LAN card. The kernel will then treat the wireless LAN card as if it were in a directly-attached PCMCIA interface. If your system has both a free ISA slot and a free PCI slot, then I strongly recommend that you use the ISA adaptor, rather than the PCI adaptor. Most people have had better results using the ISA adaptor.

  • If you're running FreeBSD, you should be running at least version 4.4-STABLE to use the PCI adaptor. You may also have to add special commands to your "/boot/loader.conf" file; see the FreeBSD release notes for details. (To use the ISA interface, you should be running at least version 3.5-RELEASE, although I recommend at least 4.1-STABLE.)
  • Alberto Escudero reports that the ISA adaptor works OK with Linux. Eberhard Wildermuth reports that the PCI adaptor also works with Linux, but that a patch must be applied to make it work.
With options 1-3, your system needs to be able to access the wireless interface as a PCMCIA device.
  • If you're running FreeBSD, you will need to configure the "wi" device in your kernel (assuming you're using a Proxim/Agere/Lucent Orinoco (aka. WaveLAN) interface). (See Bill Paul's page for more information.) You may also need to create a "/etc/pccard.conf" file (run "man pccard" for details).
  • If you're running Linux, your system needs to be configured with Linux's "Wireless Extensions". If the file "/proc/net/wireless" does not exist, then you'll need to:
    1. Add the line "CONFIG_NET_RADIO=y" to your kernel configuration file (usually "/usr/src/linux/.config")
    2. Rebuild your kernel
If your system doesn't have a PCMCIA interface, or any free ISA or PCI interfaces, but does have a spare Ethernet interface, then - as a last resort - you can use the Orinoco Ethernet converter (option 4). This converter plugs into an Ethernet 10BaseT interface, making the (Orinoco) wireless LAN interface look like a regular Ethernet interface. Unfortunately, this converter costs $US220 (not including the wireless LAN card itself), so you'd probably be better off buying a real access point (like an Apple "AirPort") instead.


We may not be able to support "BSS mode"

To act as a true 802.11 "Access Point", a base station would need to run in "infrastructure BSS mode" (commonly referred to as just "BSS mode", or sometimes called "managed mode"). In this mode, the wireless network acts somewhat like an Ethernet hub: All traffic travels to or from the access point; clients do not communicate directly.

There's no reason in principle why a Unix base station cannot support BSS mode. The problem, though, is that this requires having (read and write) access to the low-level 802.11 data-link layer packet headers, and the magic incantation needed to do this appears to be a closely guarded secret - at least, for the Orinoco card.

Notes

  • FreeBSD 4.5-STABLE (or later) now includes support for BSS mode, but only for interfaces that use the Intersil Prism II or II.5 chip. (This support, which is called "hostap", will not work for Orinoco cards, as they use a different chip (Hermes).
  • I've heard a report that someone has finally succeeded in developing a driver for FreeBSD that will enable it to support BSS mode (for Orinoco cards). This driver has not yet been released publically, and when it is released, it will probably be released as a binary-only module - i.e., without source code. When/if this driver (and/or one for Linux) is released, I will update this web page accordingly.
  • Jouni Malinen has developed a Linux driver that enables wireless LAN cards based on Intersil's Prism II or II.5 chipset to run in BSS mode.


An alternative: "IBSS mode"

Fortunately, however, our base station can run in "independent BSS mode" (commonly referred to as "IBSS mode"). In this mode, the wireless network acts more like a shared Ethernet cable: All traffic is peer-to-peer.

The main disadvantage of IBSS mode is that many of 802.11's "power-saving" features cannot be used. (In BSS mode, the access point can keep track of when clients are asleep in low-power mode, and buffer packets for later delivery.)

  • Another mode, similar to IBSS, is "ad hoc demo" mode. This, however, is non-standard, is not supported by recent versions of drivers for Windows clients, and may not be supported by future versions of drivers for Apple AirPort clients. Therefore, it should not be used. (The terminology here can be rather confusing, because some 802.11 vendors, e.g., Aironet, refer to IBSS mode as "ad hoc".)

Configuring the base station to run in IBSS mode

Important: To be able to run in IBSS mode, the Orinoco cards' firmware (for the base station and all clients) needs to be version 6.04 or greater. If your card is labeled "Orinoco" on the side, then its firmware is probably new enough; however, if it's labeled "WaveLAN", then you may need to upgrade its firmware.

  • If you also plan to use encryption (WEP), your base station and clients' firmware version should be at least 6.16; earlier versions did not implement encryption correctly in IBSS mode.
  • Christophe Kalt reports that he needed to upgrade to firmware version 7.28 in order to get NetBSD to work. (Firmware version 6.06 did not work reliably for him.)

If you need to upgrade your cards' firmware, you can find software to do this on Proxim's web site. (This software will probably need to be run on a Windows computer.)

The base station will also need to be configured with:

  1. A network name (just as with BSS mode)
  2. A special "allow IBSS" bit that needs to be turned on in the network interface

Instructions for FreeBSD

After the card has been inserted and configured, run the following commands - as "root" - to get it to use network name <network_name>, and allowing the use of IBSS mode:
/usr/sbin/wicontrol -i wi0 -n <network_name>
/usr/sbin/wicontrol -i wi0 -p 1
/usr/sbin/wicontrol -i wi0 -c 1
/usr/sbin/wicontrol -i wi0 -s <station_name>
The "-s <station_name>" call is optional; it gives the base station a character-string name that is visible to 802.11 monitoring tools.
  • For the "Aironet" 802.11 interface, the device name is "an", and the control tool is named "ancontrol". (It's arguments are somewhat different from "wicontrol"; run "man ancontrol" for details.)
  • Steve Bellovin reports that these instructions also work for NetBSD 1.5, except that the command is named "wiconfig", not "wicontrol".

Instructions for Linux

First, you'll need to update your Linux PCMCIA software to support IBSS mode:
  1. Download and unpack the latest beta version of "pcmcia-cs version 3.1.22" from here.
  2. Run "./Configure; make; make install"

Next, if you don't already have the "iwconfig" application, you'll need to download and install it. (This is one of Jean Tourrilhes' "Wireless Tools".)

Finally, configure your wireless network interface with the appropriate parameters for this network:

    iwconfig wvlan0 essid <network_name> mode Ad-Hoc nick <station_name>
    /etc/pcmcia/network start wvlan0
Alternatively, to have your network interface configured automatically whenever you boot your system, replace the existing "/etc/pcmcia/wireless.opts" file with the following:
    case "$ADDRESS" in
    # Lucent Wavelan IEEE, wvlan_cs driver
    # Settings for an IBSS network:
    *,*,*,00:60:1D:*|*,*,*,00:02:2D:*)
        ESSID="<network_name>"
        MODE="Ad-Hoc"
        ;;
    esac
(In this case <station_name> will be set automatically, using the "hostname" command.)


Configuring wireless clients to access the network

Note once again that if a client is using a Proxim/Agere/Lucent Orinoco/WaveLAN card, then its firmware must be at least version 6.04.

To configure a FreeBSD or Linux client to access the network, follow the same instructions given above for configuring a base station. (If you're running Linux on a PowerPC Macintosh, see Paul Lucas's page for additional information.)

To configure a Windows client to access the network, follow the usual instructions (in particular, entering the correct network name). Depending on which client configuration/driver software you're using, you may also need to select "peer-to-peer networking" mode. (Do not select "ad hoc demo" mode.)

To configure a MacOS client to access the network, use Apple's "AirPort" driver, available from http://www.apple.com/airport/. (Make sure you're using the latest version.) Note that you should use the AirPort software even if you're using an Orinoco card plugged into a PCMCIA slot. (The AirPort card is really just an Orinoco card without an antenna.) To connect to the network, you may also need to select "computer-to-computer" mode.

Acknowledgements

Several people, including Jim Flowers, Jean Tourrilhes, Cliff Skolnick, Matt Peterson, Paul Lucas and Warner Losh, provided valuable information that helped make this project possible.


Ross Finlayson (email: finlayson at live555.com)
LIVE555.COM
Last-modified date: 2004.07.14