My introduction to wireless networking was right here at O'Reilly Network, where our own Rob Flickenger has set up an 802.11b network spanning the three buildings that house the home offices of O'Reilly & Associates.
The idea of a wireless network was right on my wavelength. "You mean I can get Ethernet-speed web browsing, file transfers, and the whole works -- with nary a cable connection in sight -- from as far away as the coffeehouse across the street? Um, I'll be working from there this morning. IM me if you need me."
Needless to say, it wasn't long before I started thinking about other applications for this technology. I wanted Net access on my notebook computer from anywhere in or near my apartment, too. I started thinking about how I might control my stereo. I envisioned working on my laptop at a little garden table on a beautiful day under a stand of trees on my property, while birds chirp, leaves rustle, a light breeze wafts by, and one of Beethoven's symphonies blares from my window at, say, 80 dB. Freude! Naturally, the IEEE 802.11b wireless networking standard was the logical candidate for a means of implementing this nefarious scheme.
However, OEM wireless "residential gateway" hardware isn't exactly cheap, running into the hundreds of dollars and even thousands before you even start thinking about radios for the portables. And bona fide access points are even pricier. Why go to all that expense, I reasoned, when hardware that's gathering dust in my friends' closets -- hardware that they're not using, and would part with for nothing -- will do the job just as well, with only a little extra effort on my part. People have been using free operating systems to build dedicated firewalls and routers on i386 and i486 machines for years. Why not add wireless?
So I set about about building a wireless gateway using Linux, 802.11b, and an old PC. The project was a stunning success. Doing it right took some research, and a bit of trial-and-error, but it seemed to me that, in the end, the task was straightforward enough that anyone with the right hardware and a little know-how could easily replicate our results. Therefore I've endeavored to produce my "recipe" for an 802.11b gateway for you to follow at home. (It didn't hurt that my manager, Peter, was interested in building one for his house.) Those of you who own the home version of our show should be able to play along.
Ingredients for a wireless gateway:
apt-getor the equivalent, to make sure your distribution is up to date. In addition to the usual stuff, you'll definitely want to install the following packages:
pcmcia-cspackage works a lot better. Trust us.
If you use LILO (which we do), and you prefer to
make bzImage and install the kernel by hand (which we did), don't forget to edit
/etc/lilo.conf and then run
/sbin/lilo (which we also did the first time).
make modules_installand the kernel image installation steps. We did this, and it saved us a lot of time and trouble. It's hard to get a sense of how much faster computers really are these days -- until you try compiling a current Linux kernel on a 486 processor with 16 megabytes of RAM, and discover how long you end up waiting for it to finish.
make config. Answer the questions. Sensible defaults are provided, and it's normally OK to enable CardBus support even if you don't have 32-bit PCMCIA cards.
makesuffices to build the package, but, amusingly, the package doesn't come with a
make installoption (as of this writing, anyway). You'll have to copy the
/usr/local/sbin(or wherever you prefer to keep them) by hand. Likewise with the main pages (such as, the
ESSID, which will uniquely identify your local wireless net, and another string to serve as your WEP (Wired Equivalent Privacy) encryption key. Set the rate to "auto", and the mode to "ad hoc".
/etc/pcmcia/network.opts(sample). For our example, we set the IP address (IPADDR) to 192.168.1.1 and net mask to 255.255.255.0. You may want to flavor these settings to taste.
/etc/sysconfig/network-scripts/eth0to DHCP, or setting the IP address to a static value. If you're using a modem-based PPP link, you'll need to configure PPP in
/etc/ppp/options(sample). The PPP how-to document may be of service here. If you're on DSL, but don't have a DSL router, and need to use PPP-over-Ethernet (PPPoE), things get a little trickier, but not much. See the Roaring Penguin PPPoE site for information and downloads.
/etc/rc.d/init.d, and then create "symlinks" in each
rc*.ddirectory, or use
chkconfig. If you're running a 2.4.x kernel, you'll want to use
iptablesinstead, but the basic concepts are the same.
/etc/dhcpd.conf(sample). Providing DHCP on your wireless net ensures that you won't have to worry about manually setting IP addresses on each of the notebook machines -- you can just configure them to request an available address from the gateway when they need one.
/etc/rc.d/rc*.ddirectories, or use
chkconfig. If you don't know what a service is, or what it does, TURN IT OFF. You can always turn it back on later, if you wind up needing it. Be sure to leave network and PCMCIA services running, as well as
wireless.optsconfiguration, but, if you don't, be sure that the
KEYsettings are the same on the clients. If you want to run Windows on your notebook, refer to Rob Flickenger's reference on setting it up for 802.11b.
dhcpcd. You can set the wireless card to try to obtain a lease via DHCP every time the interface comes up, by setting the DHCP variable to "true" in
/etc/pcmcia/network.opts. In Windows, you'll want to turn on the "Obtain IP address automatically" feature on the wireless network interface in the Control Panel, and reboot.
The morning after I set all this up in my home, I found myself reading the news, checking my mail, chatting on AIM, and playing MP3s on the stereo in the living room, all before I got out of bed. (This wireless stuff can be hazardous to your health, eh?)
Furthermore, once you've got this up and running, adding more gee-whiz features is easy. For example, I put a sound card in my gateway box, and connected it to my stereo. Now I can play MP3s from anywhere in the vicinity of my apartment, using an
xmms session running on the gateway. One could, as another example, set up
ntpd on the gateway, and have the client machines keep their system clocks synchronized wirelessly. The possibilities are almost endless -- if you come up with novel variations, please don't hesitate to let us know. We'd love to hear about them.
The coolest part of this whole project is that it isn't something that might happen next year, or even next month -- it's something you can go out this very afternoon, and put together for the cost of a PCMCIA adapter and a couple of 802.11b cards.
I think we have seen the future, folks, and it is definitely wireless. Here at O'Reilly Network, plans are afoot to mount a volunteer-sponsored community wireless cooperative. Rob and I have begun development on a floppy-based wireless Linux distribution, inspired by the Linux Router Project. We're hoping to plaster Sonoma County with homegrown, community-supported wireless access points. We'll have more to say about that once we really get started, so stay tuned!
Meanwhile, I've been having so much fun with my new wireless gateway that I haven't even had time to go out and price garden furniture.
Schuyler Erle had nothing to do with the Tunguska explosion of 1908. No, really.
Return to the Wireless DevCenter.
Copyright © 2009 O'Reilly Media, Inc.