A Writer's View of the Linux Wireless Dream, Part 1

By: Rob Reilly
Monday, June 2, 2003 10:51:02 AM EST
URL: http://www.linuxplanet.com/linuxplanet/tutorials/4825/1/

Wireless Dream, Picture the Scene...

A busy manager, sitting in the airport, checking email on his wireless Linux laptop while waiting for his next flight to Cleveland. The teenage girl instant messaging her friends on her wireless Linux laptop while curled up in front of the TV. How about the friendly Linux writer doing a little research on the web, for a new Linux story, from the comfort of a nice lawn chair out in his back yard?

All are glowing images of fantastic productivity and a future of unbridled freedom to work wherever and whenever you want while staying connected. Finally, a way out of Dilbert's world.

As a necessarily thrifty professional Linux writer my opportunity to try out wireless came last Christmas season when my local computer retailer had a year-end sale. I set out to learn how 802.11 technology worked with a Linux laptop, a wireless card, some ideas about antennas, and a curiosity to see what all the hubbub was about.

My overriding question was "Does wireless really help you become more productive?" Good question. To begin to find the answer, I had to get the wireless card working on my Linux laptop, which is the focus of this article. Subsequent articles take the reader through my whole wireless adventure and allow you to judge how "productive" wireless can be. Here are some hints. Wireless is still a bit of a novelty. And, people are gaining experience but the infrastructure has a ways to go. Oddly, people in public seem suspicious and at the same time, curious of wireless. Also, the logistics of using wireless is a complicated topic that nobody seems to be addressing. . This series of articles will discuss these subjects and give you insight into where the wireless Linux laptop industry is, right now.

I promise I won't do any more marketing spin, either.

Wireless Linux Laptop Requirements

Before I bought the wireless card and router, I put together a list of criteria.

  • Had to be cheap--er, inexpensive.
  • Had to be external antenna capable.
  • Had to be able to be put into monitor mode (for testing and network sniffing).
  • Had to be common off-the-shelf hardware available from consumer retailers.
  • Had to use the wlan-ng driver
  • Should be 802.11b, because it was the current standard and best supported.

I did a little research and found that an SMC 2632 PCMCIA card filled the bill, nicely. The card used the Intersil Prism2 chip-set and had both wlan-ng and Orinoco drivers available in SuSE Linux 8.0. While I could have purchased a high end specialty wireless card with an external antenna connector built in, it would have been much more expensive than the SMC card. Specialty cards also put out up to 200 milliwatts of transmit power. My little SMC transmitted 30. Specialty cards are upwards of $200, and my SMC was $49 with rebates.

Over time, the Linux capable 802.11b cards will probably get harder to find. The computer retailers seem to be pushing the a, g, x, whatever models pretty hard. Good thing they are all standards. Hey, maybe some Windows 802.11g user could give you his old, slow 802.11b card. Right now the 802.11a and -g drivers for Linux are in very early development and not really ready for prime time yet. And don't forget that most current cable or DSL broadband is 10 Mbps Ethernet, anyway. Why spend the cash on a and g cards, if you can't put it to use through your home or cafe broadband connection anyway.

Why did I use the wlan-ng driver? The driver was designed with the Prism chip-set in mind, exactly what the SMC2632W card had in it. The driver seemed stable and people seemed to be happy with its operation. Also, it allowed the card to be put into monitor mode (needed for wireless packet sniffing) without too much trouble.

Setting SuSE 8.0 Linux Up for the SMC2632W Wireless Card

The first order of business was to get the stock card working, before I did any hardware hacking or modifications. Hardware hacking of the card will be described in the next story in this series. Since the SMC 2632 card was a Prism2 chip from Intersil, it was a given I was going to use the wlan-ng drivers. There were a few files that needed to be changed in order to get the card recognized and working properly under the Linux 2.4.18-4GB kernel.

The first file that had to be changed was /etc/modules.config. I added an entry for the wireless card.

alias wlan0 prism2_cs

And, I almost forgot to run depmod, as root.

depmod -a

I also created a file in /etc/sysconfig/network called ifcfg-wlan0. The card was set with DHCP, although you could easily use static IPs too. It looked like this:

DEVICE=wlan0
ONBOOT=no
BOOTPROTO=dhcp
USERCTL=yes
DHCLIENT_SET_DOWN_LINK=yes
STARTMODE=hotplug
MODE="Managed"
UNIQUE=""

Next was the config file in /etc/pcmcia directory. I had to make sure that the SMC2632 entry was bound to the prism2 card. It looked like:

card "SMC2632W"
manfid 0x0156, 0x0002
bind "prism2_cs"

The last file that needed editing was the wlan-ng.opts file in the /etc/pcmcia directory. I had to make sure the IS_ADHOC line said "no," like this.

IS_ADHOC=no
# y|n, y - adhoc, n - infrastructure

I also had to set the variables for Auth Type and DesiredSSID. I left the DesiredSSID empty so that it could just pick up the first access point it found. They looked like this:

AuthType="opensystem"     
# opensystem | sharedkey (requires WEP)
DesiredSSID=""

I didn't bother with WEP initially because my location was fairly isolated and I could accept the risk of a neighborhood hacker. This is something you will need to determine on your own, however. If you are in a corporate setting, then you will definitely need to read the wlan-ng documentation to set this security measure up.

WEP isn't all that great anyway, since programs like Airsnort can figure out the encryption keys. VPN sounds like a good start to securing a wireless link, but, I haven't started working with that yet. Perhaps in a later article.

With all the files edited, it was time to start up the stock PCMCIA card, grab an IP and see how it worked.

The Acid Test

I removed the "wired" Ethernet card from the PCMCIA slot and inserted the wireless card. I typed (as root):

rcpcmcia stop
and popped out the wired Ethernet card.
rcpcmcia start
then popped in the new wireless card. Then, I typed
ifup wlan0

At that point the 802.11b card could grab an IP address from the access point. It's important that the IP range for DHCP is wide enough to service the wireless card. If you have four machines wired into the wireless router/access point and you want to be able to grab an IP address for the wireless card, you better have enough addresses to go around. You might set up the DHCP server in the router to allow addresses 192.168.2.2 through 192.168.2.6. On the SMC router, I usually give the router 192.168.2.1. It seems pretty silly, but I did pull my hair out for a while trying to track down the problem of not having enough IP addresses available. Save yourself some trouble.

Finally, I was ready to try and ping something. I typed:

ping [some known ISP or Web site that returns pings]

I also started my browser and surfed to one of my favorite web sites, LinuxToday.com.

Ping returned the usual procession of round-trip packet times and appearing in my browser were all those great Linux stories.

If you go through all of this and it doesn't work, there could be any number of problems and be warned. It could take some real detective work to get everything going properly. Here is a list of things to help you get started on troubleshooting.

  • Is your PCMCIA subsystem set up correctly and working?
  • Is your hotplugging subsystem set up correctly and working?
  • Have you checked lsmod to see if all the correct modules (like prism2_cs) are loaded?
  • Have you restarted he PCMCIA subsystem with rcpcmcia stop/start (as root)?
  • Are you sure the wireless card works?
  • Is the wireless router/access point configured correctly (especially with dhcp and WEP/no WEP)?
  • Do you have enough dynamic IPs available on your system to support the wireless laptop?

After the wireless card worked properly, I thought it would be nice to have it start automatically at bootup. I just fired up the YAST2 Control Center and followed these steps.

  1. Selected the "System" icon from the main control panel.
  2. Selected "Sysconfig Editor" icon.
  3. Under "config options," clicked on the "etc" plus sign (to open up the etc variables).
  4. Changed the hotplug_net_default_hardware variable to pcmcia.
  5. Changed the hotplug_start_net variable to yes.

The Dream Continues

That wrapped up setting up and running the SMC2632W wireless card on my laptop under SuSE Linux 8.0. I was able to walk around in most areas of my house and stay attached to my access point. I could also go outside the house into certain areas of the yard and still stay connected. Overall, the installation leg of the wireless journey was a success.

The next articles will cover improvements to the SMC2632W wireless card, construction of external antennas, and stories of how people give you the evil eye when you have a "Pringle" antenna attached to the top of your laptop, in public. I'll also examine some of the practical and logistical issues of running wireless Linux laptops for everyday use.

Rob Reilly (aka: "Dr. Torque") is a professional writer and senior technology consultant, whose work includes Linux, business systems integration, innovation training and occasional hot rodding excursions. He frequently writes and speaks about these and other topics. He has 17 years experience in the high technology, manufacturing and the utilities industries. He is always 'on-the-lookout' for stories and projects that focus on Linux, business and the cutting edge.

Copyright Jupitermedia Corp. All Rights Reserved.