Building a Wireless Network with Linux

Want your laptop and PC to talk to each other without having to deal with wires? Here's how.

Wireless networking has been around for a while, but until recently, it was out of reach for Linux users with modest means. Fortunately, a number of manufacturers are beginning to see new venues in marketing inexpensive wireless hardware. One manufacturer, Webgear, Inc., recently introduced a Linux-compatible wireless networking kit.

In this article, I will show how to create an inexpensive wireless network and a wireless networking bridge using Webgear's Aviator 2.4 wireless networking kit, IP masquerading, software routing, a surplus laptop and Linux.

Webgear's Aviator 2.4 wireless kit consists of two Type II PCMCIA cards and two ISA PCMCIA card slots. The kit uses 2.4GHz radio technology to offer 2MBps networking using IEEE 802.11 specifications (frequency-hopping, spread-spectrum networking). The cards appear as Ethernet devices, such as eth0 or eth1, when installed and configured. The original intent of the kit is to offer the ability to create a high-speed wireless link between two desktop PCs, two laptops, or a laptop and desktop PC.

Although the kit is advertised as supporting Linux, it comes with software drivers for only Microsoft operating systems. You'll have to download the Linux device driver, a loadable kernel module named ray_cs.o, from the Web. Even though you can get a stable version through Webgear's support link at www.webgear.com/support/software_top.html, the best place to download the latest version is from the author's web site (see Resources).

Thanks to the generosity of the author, Corey Thomas, you can use the Aviator 2.4 (or more expensive Aviator Pro or Raytheon Raylink series) wireless system with Linux. I downloaded the latest driver, ray_cs version 1.68, onto one of my laptops, then followed his directions on building and installing the driver:

cp ray_cs-1.68.tgz /usr/src/linux/pcmcia-cs-3.1.5
tar xvzf ray_cs-1.68.tgz
make config
make all
make install

These steps should then be repeated on another computer. I initially used two laptops to test the connectivity of the cards. This is essential to ensure the cards and software are working correctly. I had great success with a later version of David Hinds' Card Services, pcmcia-cs 3.1.5, along with the next version, pcmcia-cs 3.1.6.

Peer-to-Peer Wireless Networking

As sold, the kit allows for connection between two wireless points: point A-->point B.

Before enabling the cards, you must first edit /etc/pcmcia/config.opts and insert the line

source ./ray_cs.opts

Upon starting, Card Services will then read in the ray_cs.opts configuration file for the wireless cards (ray_cs.opts is copied into the /etc/pcmcia directory as part of make install). This file contains several important settings, in the form of setup strings, used to configure the Aviator 2.4 card after insertion. The settings line (there are several, as the driver supports at least three different wireless cards) I used was:

module "ray_cs" opts "pc_debug=2 essid=LINUX\
 hop_dwell=128 beacon_period=256 translate=1"
Make sure to use the same settings for each end of the wireless connection. The pc_debug=2 option is a handy way to get more information from /var/log/messages upon insertion or removal of the card. The essid=LINUX option designates a network name of LINUX for the wireless cards (according to Webgear, 61 cards may be on the same network). After installing and configuring the software, I used Red Hat's netcfg tool to create an eth0 interface on each laptop. You can also create your own by editing the /etc/sysconfig/network-scripts/ifcfg-eth0 file:
DEVICE=eth0
IPADDR=192.168.2.37
NETMASK=255.255.255.0
NETWORK=192.168.2.0
BROADCAST=192.168.2.255
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
The cards must be started sequentially. I went to the first laptop, ensured Card Services was running (you can do an /etc/rc.d/init.d/pcmcia start), then inserted one of the Aviator cards. Upon hearing two beeps, I looked at the output of /var/log/messages (not all the output is shown here):
$Id: ray_cs.c,v 1.68 1999/11/21 10:43:35 corey Exp
$-Corey Thomas
corey@world.std.com
ray_cs Detected:
WebGear PC Card WLAN Adapter Version 4.88 Jan 1999
eth0: RayLink, irq 4, hw_addr 00:00:8F:48:E8:DB
ray_cs interrupt network "LINUX" started
The important thing to look for is the “started” string. I then enabled the interface using netcfg, as according to Thomas, you cannot use the ifconfig command to set the IP address using the ray_cs driver. I then went to the other laptop, inserted the other Aviator card, listened for the two beeps, and looked at /var/log/messages:
$Id: ray_cs.c,v 1.68 1999/11/21 10:43:35 corey Exp $-Corey Thomas
corey@world.std.com
ray_cs Detected:
WebGear PC Card WLAN Adapter Version 4.88 Jan 1999
eth0: RayLink, irq 10, hw_addr 00:00:8F:48:E8:45
ray_cs interrupt network "LINUX" joined
Again, the important string to look for is “joined”. This means the cards are communicating. I then enabled the eth0 interface, and voil<\#224>--I could use ping, telnet, ftp and talk between the two laptops wirelessly. FTP file transfers were about 180K per second, and that speed is reasonable enough for remote X11 client launching. This shows that Linux can be used to support wireless networking in a variety of situations where cabled installations are impractical or unnecessary.

______________________

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState