|
|
| LinkSys Wireless Network Howto |
| A howto on how to get your LinkSys WPC54G pcmcia card to work with a wireless LAN
under linux. |
| |
| The Author and Owner sincerely ask that this text not be copied or replicated, in
whole, anywhere without explicit written consent, and proper references and credits. If you wish to extract
portions of this text for various uses, full public permission is granted under the condition that
a reference to either this specific page url or the main website
(www.intuitivecreations.com) url is
referenced along with the borrowed text. |
|
| |
|
|
| |
| |
|
Overview |
| This is a text describing how to get a LinkSys WPC54G PCMCIA card to work
with a LinkSys Access Point under RedHat 9. Most of the information should be (at least mostly)
neutral to specific OS distributions and OS versions. |
| I am new to wireless networking myself, and I can
not verify this, but
I don't think the specific model or manufacturer of the access point is all that important, as long
as the card and the access point use compatible network specifications. |
| Depending on the state of your Linux installation,
you might be able to
skip nearly all of the steps involved in this howto. My installation was running a little behind the
times and needed a bunch of updates to get drivers that worked with this card. |
| It would seem that the manufacturer of the chipset
on the LinkSys PC
card (which is NOT LinkSys! LinkSys is a supporter of open source), who's name escapes me,
simply refuses to help develop, or even disclose the appropriate information to make development
possible of a native driver for this card. Why? Good question.. |
|
|
| |
| |
|
Software Requirements |
| These software requirements are what I used to get the card working.
To get the minimum software requirements, you should check the documentation within the
ndiswrapper and other pieces of software packages. |
The latest rpms can be downloaded from the fedora
project, started by redhat. Check out mirrors for fedora downloads at
http://fedora.redhat.com/download/mirrors.html.
All the rpms I upgraded to came from the fedora project. The rpms listed below might have required
dependencies themselves, which I will not list, but which will also be available from fedora. The paths
to the rpms and srpms on the fedora ftp sites is a little strange so it's worth noting:
Path to the SRPMS:/redhat/fedora/linux/core/1/SRPMS
Path to the RPMS: /redhat/fedora/linux/core/1/i386/os/Fedora/RPMS
the ndiswrapper kernel module and utilities as of this writing should be downloaded from CVS. The
difference between the last official release and what is in CVS is huge. The directions to download
the package from cvs are on the sourceforge site. Click on the CVS link at the top and follow the
directions. |
| Kernel 2.6.3 (2.6.x should be good enough)
(www.kernel.org)
kernel-pcmcia-cs 3.1.31-13 RPM (fedora)
wireless-tools 26 (fedora) (SRC RPM, NOT PREBUILD RPM)
module-init-tools 3.0 (www.kernel.org)
ndiswrapper (http://ndiswrapper.sourceforge.net/)
CVS DOWNLOAD (a must, do NOT download the .4 package)
The latest Windows XP driver from LinkSys
(www.linksys.com) |
|
|
| |
| |
|
Nutshell Installation Summary |
| Install the wireless access point to your existing hub.
Configure the wireless access point to work with your network.
Build a kernel with at least pcmcia, wireless (not hamradio), and basic networking support.
Reboot into the new kernel
Make sure (at least on redhat) that /usr/include/linux points to the actual new kernel headers.
Install the latest pcmcia rpm package.
Install the latest wireless src rpm, build the rpm and install it.
Install the module-init-tools package.
Install the ndiswrapper package.
Use the ndiswrapper utilities to install the LinkSys Win XP driver.
Bring up the interface and rejoice in your new found freedom! |
|
|
| |
| |
| |
|
Wireless Network Installation Details |
| |
| |
|
Access Point Installation |
| The installation of a wireless access point is incredibly simple. I come
from the (increasingly deprecated) world of hard-wired networks. Admittedly, the idea of a
"hub" with only one port threw me for a second, but of course, once you think about how
it works, it makes sense. |
| To install your wireless access point, take it out of
the box <grin>, put it on a surface <grin>, plug in the power source, and plug the network
cable in the back of the ap and the other end into your hub. I verified that you do not need to
"uplink" the ap from your hub, it will work either way (at least with my netgear 8 port hub).
As soon as it has power and is plugged in to your hub, it will be ready to work out of the box. |
|
|
| |
| |
|
Access Point Configuration |
| Wireless Access Points are configured differently from manufacturer
to manufacturer, so work with your documentation that came with the ap for this step. I'm using
LinkSys' Wireless-G AP, and configuration of this one was simple as well. The details may differ from
ap to ap, but the ideas are the same... |
LinkSys' Wireless-G came with a web front-end interface
on CD which made the configuration simple. If you do not have another computer hard-wired to the LAN,
you'll have to follow the documentation of your AP to get it configured. I would definitely recommend
using a hard-wired computer to configure your ap. Through the interface I was able to set the ap's network
information, I use a 10.0.5.x scheme, and set the ap IP to 10.0.5.2 . You can also change the SSID,
encryption scheme, and channel. You should leave the encryption disabled until you get everything working.
I also had an issue with RedHat's network configuration tool where it wouldn't let me change the channel,
but upon starting up the interface, it seems to find the channel on it's own. At a minimum you need
to change
The ap's network configuration to match your network scheme (192.x.x.x or 10.x.x.x)
The ESSID. Change this to something simple; I made mine "wireless"
Make sure encryption is disabled
And that's it! Your AP should be configured and ready to use. |
|
|
| |
| |
|
Build a Recent Kernel |
Obviously directions on how to build a kernel is beyond the scope of
this howto. There are howto's around the internet specifically on this topic, as well as documentation
that comes with the kernel itself. Breathe! It's not that tough to compile a kernel!
I am running on a Compaq Armada E500 Laptop, and have included my 2.6.3 Kernel .config file in the
reference section in case you need some help configuring your kernel.
The kernel source code, utilities including module-init-tools as well as documentation can be found
at www.kernel.org. You can also check out some howtos at the Linux
Document Project at www.tldp.org, the kernel-HOWTO specifically,
is located at
http://www.tldp.org/HOWTO/Kernel-HOWTO/index.html. The basic idea is this:
Download the latest kernel (as of this writing 2.6.3)
Unpack the kernel (in redhat I put it with the others in /usr/src
Make a symlink from /usr/src/linux-2.6.3 to /usr/src/linux
cd into /usr/src/linux
do a shell>make mrproper
if you are recompiling the same kernel after a failed attempt, dont forget to make clean
Under gnome do shell>make gconfig or under kde do shell>make xconfig
Configure the kernel for the things you need, including networking support, wireless (not hamradio)
support, and pcmcia support. Each option has a little blurb of help describing the option, and usually
a default choice, so take some time to go to through the options and read what they do. Don't worry,
if you mess up, you can recompile! (and you will at least once..)
Once configured do a shell>make bzImage
Then shell>make modules
Then shell>make modules_install if you are recompiling the same kernel, I usually rm -fr
/lib/modules/2.6.3 before this step to make sure I don't have anything old lying around
Then shell>make install beware, this step adds the necessary configuration in /etc/lilo.conf, even
if you have already run this step on a previous install, so it'll keep appending the same config over
and over. I also had an issue with the line append="root=LABEL=/" which the kernel wouldn't
boot, so I simply replaced that line with the good old root=/dev/hda1 (or what ever your boot
partition is).
Next shell>/sbin/lilo (or if you use grub replace the lilo steps with the appropriate grub steps)
I also had one issue with the USB INPUT support where (old init scripts possibly?) the main USB INPUT
driver was looking for the keybdev and mousedev modules which are now called usbkdb and usbmouse, so I
simply linked usbkdb to keybdev and usbmouse to mousedev (these lie within
/lib/modules/2.6.3/kernel/drivers/usb/input/), which seems to work fine.
boot into the new kernel.
You will need to replace the glib-kernelheaders in /usr/include/linux with the new kernel headers
from the kernel source code to compile some of the software below. I just moved the directory
/usr/include/linux to /usr/include/linux.rpmold and threw in a symlink to /usr/src/linux/include/linux
which did the trick. People who know a lot more about this than I are probably laughing their butts off,
but it worked for me..
You need to make sure that there is a /proc/net/wireless file, else you forgot to add wireless support
to your kernel. |
| That is all there is to the new kernel. As I've
said before, it might not
be necessary to compile a new kernel. I did see references to the 2.4 kernel from within the ndiswrapper
documentation. You also might have a 2.6 kernel running already. You can try the following steps without
compiling a new kernel if you wish. |
|
|
| |
| |
|
Upgrade & Install Software |
| Most of the software I had to upgrade wasn't necessarily directly
related to getting the wireless card to work. I upgraded my kernel to 2.6.3 from a 2.4.x version, which
seems to be worlds apart, many, many new changes, and a bunch of older software became broken. Namely,
the kernel module utilities, like modprobe, lsmod, etc. After downloading the module-init-utils v3.0
package from kernel.org and installing those, the problems stopped. |
A very important note for RedHat users: After
booting into the new 2.6.3 kernel I found that RPM
was completely unusable. After a lot of searching I found that a simple environment variable seems to fix
it to it's former glory: LD_ASSUME_KERNEL which needs to be assigned to the value 2.2.5 . RPM only
seemed to be broken for root, but all other users on my system don't have write access to the rpm
database, so that's probably why. All that need be done is edit root's .bash_profile file within root's
home directory. You could probably also put it in the system wide bash_profile file, but why fix what
isn't broken? So, somewhere in root's .bash_profile, stick in the line
export LD_ASSUME_KERNEL=2.2.5
and everything should be fine. |
Untar the module-init-tools-3.0 in your favorite
directory. There weren't many options or tweaking I had to give it, I only told it where to install
(the prefix) and to handle zipped modules.
shell>./configure --prefix=/ --enable-zlib
Important: Make sure to run shell>make moveold
This enables you to boot back into a lesser kernel, like 2.4 in case you need to do so.
After that it's as simple as running make and make install. |
| You might or might not need to upgrade your pcmcia
package. I had some problems with my pc cards, but I think that was due to a mis-configured kernel.
If you do need to upgrade your pcmcia packages, just download the latest rpm from fedora and
install it. |
I downloaded the fedora wireless SRPMS so that I can
keep the RPM database up to date, and try to keep the system clean. You need the SRPMS so you can compile
the binaries yourself with your new kernel headers. The readme within the source actually recommends this.
I had absolutely no issues with building the rpm and the basic commands are as follows:
install the SRPM: shell>rpm -Uvh wireless-tools-26-1.src.rpm
cd to the build environment directory, usually something like /usr/src/redhat
run rpmbuild: shell>rpmbuild -bb SPEC/wireless-tools.spec
install the rpm: rpm -Uvh RPMS/i386/wireless-tools-26-1.i386.rpm
and you are done! |
Now the ndiswrapper kernel module. This piece of software
rocks, and much kudos to the brilliant people who made it. What it does is basically implement the microsoft
networking driver API, so you can actually run the Windows XP drivers from within your kernel.. cool huh?
Once you've used CVS to checkout the ndiswrapper, cd into the source directory and read the readme.
There's no excuse to not read the documentation. At the root of the source run shell>make install
This should install the kernel modules and the utilities. Once this is done, unzip the LinkSys drivers
to a temporary directory and run
shell>ndiswrapper -i /path/to/your/LinkSys/Driver/inffile.inf
This will install the driver files necessary to the /etc/ndiswrapper directory. Run
shell>ndiswrapper -l to verify the installation went ok. Once the drivers are installed you have
finished installing the software required to get networking up and running. |
|
|
| |
| |
|
Configure Hardware & Networking |
If you haven't done any research or perusing for information, you
really should check out at least a couple of documents on related topics. Here are some links to some
that are directly related on tldp.org.
|
The first thing you need to do is load the ndiswrapper module into
the kernel by running
shell>modprobe ndiswrapper
You can verify that everything went ok by checking dmesg . There should be some gibberish about a wlan0
interface at a mac address. If all went ok, you can move on to configuring the wireless interface.
run shell>iwconfig
This will bring up a list of wireless interfaces on your system. You should see some variation of an
interface called wlan0. You need to set up the basic configurations to make wlan0 see the wireless
network: essid, channel, and mode. Those three settings are the same as your access point configuration
and are configured as follows:
ESSID: shell>iwconfig wlan0 essid wireless
CHANNEL: shell>iwconfig wlan0 channel 6
MODE: shell>iwconfig wlan0 mode Managed
Some or all of these settings might be configured automatically from /proc/net/wireless or from the XP
drivers.
Once your card is configured to talk on the wireless LAN you are ready for the normal network
configuration. Next you need to use ifconfig and route to set up wlan0 to talk on the network.
First assign the network parameters using ifconfig: (replace the IP, Netmask, etc. to your network
scheme)
shell>ifconfig wlan0 10.0.5.69
shell>ifconfig wlan0 netmask 255.255.255.0
shell>ifconfig wlan0 broadcast 10.0.5.255
This sets an IP address for the wireless Lan card, it's network Mask, and it's broadcast address,
respectively. You can check to make sure the settings are correct by typing:
shell>ifconfig -a
which will show you all the adapters, whether they are up and active or not. Bring up the interface
by typing
shell>ifconfig wlan0 up
Next set the routes. The basic network route (destination 10.0.5.0) is added by ifconfig simply by
assigning the network configuration to the interface. Next you only need to tell the routing table where
the interface's default gateway is. You can do this with the following command: (obviously replace
the gateway's IP with the appropriate information for your network:
shell>route add default gw 10.0.5.1 dev wlan0
After typing in this command you should be able to get out to the internet and surf your own LAN.
Woot! |
|
|
| |
| |
|
Automate Things |
You've compiled your kernel, you've tweaked and upgraded your software
installations, and you've already checked your inbox at yahoo mail, all from the comfort of your couch in
the upstairs living room! Now what?
I don't know about you, but the idea of modprobing, and adding default routes to the kernel's routing table
every time I reboot my laptop gives me the shivers. Let's get all this automated! |
First thing is first: Use the ndiswrapper
utility to set up the correct
modprobe aliases so that modprobe knows what to do when asked for this driver:
shell>ndiswrapper -m
That will set up the modprobe alias configuration for you. Next you need to set up the network
configuration which can be done in two ways: On the later redhat systems you can use
redhat-config-network to set up networking with
a gui (older systems will give you linuxconf [remember that? Oh those were the days!]
to configure your network devices, but I'll not cover linuxconf here), or you can hand edit the
/etc/sysconfig/network-scripts/ifcfg-wlan0 file. |
| To use redhat-config-network, start it up by the
command line, or through one of the menus, and click on the devices tab. Hit the New button, choose wireless
connection and hit forward. You should see the ndiswrapper(wlan0) driver in the list that comes up. Make sure
this is selected and click forward. In the next screen, make sure Managed is selected for your mode, choose
or specify your SSID, set any other settings that are appropriate for your wireless access point (that was
all the settings I needed) and click Forward. The next screen should be familiar. Set your IP (I use static
IP's on my LAN), Netmask and gateway and move on. Confirm your settings and click Finish.
If you want this interface to come up at boot time, open up the properties from the device list,
and select the option to activate the interface when the computer starts. |
If you want or need to set the configuration by hand,
I'll give you a template to work from. This file should be placed in /etc/sysconfig/network-scripts and
should be called ifcfg-wlan0 (or ifcfg-whateveryourdeviceiscalled).
| Configuration File
/etc/sysconfig/network-scripts/ifcfg-device |
DEVICE=wlan0
BOOTPROTO=none
ONBOOT=yes
IPADDR=10.0.5.69
NETMASK=255.255.255.0
IPXPRIMARY_802_2="no"
IPXACTIVE_802_2="no"
IPXPRIMARY_802_3="no"
IPXACTIVE_802_3="no"
IPXPRIMARY_ETHERII="no"
IPXACTIVE_ETHERII="no"
IPXPRIMARY_SNAP="no"
IPXACTIVE_SNAP="no"
GATEWAY=10.0.5.1
TYPE=Wireless
USERCTL=no
NETWORK=10.0.5.0
BROADCAST=10.0.5.255
PEERDNS=yes
DOMAIN=
HWADDR=00:0c:41:2d:be:22
DHCP_HOSTNAME=
ESSID=wireless
CHANNEL=6
MODE=Managed
KEY=
RATE=54Mb/s |
This was my file. Adjust it as necessary to work with your network. Only worry about the lines that you
can fill in. No one expects you to know your NIC cards hardware address! Just leave the lines you don't know
blank. Once this file is in place from either method, you should be able to run
shell>/etc/init.d/network restart
and it should come up without a problem, even from a full system reboot!
Another note for RedHat Users: I'm not sure when this was implemented, but there are now profiles
for network devices. The above file would be placed in /etc/sysconfig/networking/devices and
/etc/sysconfig/networking/profiles/default as well as /etc/sysconfig/network-scripts, and also in
the aforementioned directories there would contain a separate
file called keys-device (i.e. keys-wlan0) if you had encryption enabled (which we'll get to!). The above
file would not have the KEY= line in it anymore. |
|
|
| |
| |
|
Using Encryption |
If your neighbor is close enough, he can not only eavesdrop on your
internet communications, he can actually use your network to get out to the internet himself! In fact,
this actually happened to a friend of mine who hacked his access point to give a much stronger range,
and his neighbor in the next house was using his internet connection without even knowing it! Funny?
Yes, but scary too!
If you simply set up a little encryption on your network, people can still "sniff" your
communications, but with a strong key and algorithm, all they get is worthless garble that is very
difficult to decrypt. Also, a wireless access point won't let a client use it without the key! |
Setting up encryption is easy. First, bring up
the web front end for your access point, and turn on wireless security. Bring up the security settings
and set the security mode to WEP. Hopefully your administration front end does some kind of pass phrase
generation for you, so you don't have to come up with 26 letters in hex yourself... I set my encryption
level to 128 bit (because I'm a paranoid kinda guy), but you could set it to 64 it you wish. The
difference in the strength of the security is obvious, but, so is the latency on the network! The less
encryption you have, the faster your network will be. Nothing is free.
If your admin page doesn't have a generator of some type, here's a couple keys for you, all 128 bit:
| Pass Phrase |
64 Bit Key |
128 Bit Key |
| l1nuxw1llch4ng3th3w0rld |
BC94E4DDE9 |
91B7842A7951D1AF51FF1F70DC |
| m1cr0s0fth4t3sl1nux |
F77314667F |
C3FBBAFE848B14B4DE327986FE |
| y3tth3yus31t1nth13rpr0ducts |
3E3056A080 |
56883BB707B770A3B041A19898 |
| 1h0p31m4l1v3t0s33th13rd34th |
30AFCD8E29 |
196591D9B9B7AA244EF07EED4E |
You only need one. Put one in the access point's configuration, and apply the changes. Take the same
key and put it in the wireless settings of your adapter within redhat-config-network.
Don't forget that within the redhat-config-network front end, the text box where you enter the key
should have a 0x before the key (a zero and a lower case X which specifies hexadecimal). This is just for
redhat-config-network, so it knows that the key you are entering is in hexadecimal.
If you don't use redhat-config-network then create a file called keys-wlan0 (or key-yourdevice) within
/etc/sysconfig/network-scripts . This file should have one line:
KEY=yourkey
Don't put the 0x, that's just for redhat-config-network.
That should be it! Restart networking and start surfing with the piece of mind that only 128-bit
encryption can offer! |
|
|
| |
| |
|
References |
If anything in this document is wrong, or you are having a bit more
trouble than I had getting this running, feel free to drop me a line at
info@intuitivecreations.com.
As promised, here are the links to my kernel config file, make sure
to rename it .config when you put it in the kernel source directory, and also a link to the
ifcfg-wlan0 file.
kernel-2.6.3.config
ifcfg-wlan0 |
Here are some links to the various things related
to this howto, and other helpful places:
www.kernel.org The official site of the Linux Kernel, hosting (obviously)
the source code for the Linux Kernel as well as utilities and other oddities used or related to the
linux kernel.
www.linksys.com Linksys makes (among other things) wireless
networking hardware.
fedora.redhat.com The fedora project started by redhat
pcmcia-cs.sourceforge.net The official pcmcia-cs homepage
ndiswrapper.sourceforge.net The ndiswrapper
kernel module homepage
www.tldp.org The linux document project
www.linux-laptop.net Linux on Laptops, a great archive of
information related to running (you guessed it) linux on laptops! |
| For what it's worth, I would like to express my
gratitude to the countless blur of names listed within the credits of the silent readme files of
the millions of software packages created and distributed selflessly around the internet. Most people
spend their time trying to figure out how to increase their own positions. Yet there are those who work
for the love of their craft, and give selflessly to any and all who want it, for nothing. |
|
|
| |
| |
Written By: Justin Camp
Published Date: March 1st, 2004
Copyright © Intuitive Creations, Inc. 2008 |
|