Diary of a Sys Admin

It isn't really a diary, but I am a sys admin.

Tuesday, February 22, 2005

Linksys WPC11 and Mandrake 10.1

The Linksys WPC11 card has been described as "notorious" in some online documentation — during each of its incarnations it has remained awkward or (seemingly) impossible to configure. I bought version 4 of this card, but could only find instructions about using version 3 or earlier with ndiswrapper. After many hours of failed attempts to make it work, I'm finally fully-connected via wireless to my ADSL router. Here follows the low-down.

I assume Mandrake 10.1 official because that's what I'm using now. All these instructions require a root shell. Type "su -" and enter the root password from a terminal, or log in as root.

First, if using Mandrake 10.1, uninstall ndiswrapper. The one which is distributed with Mandrake 10.1 official will cause problems.
  1. rpm -qa | grep ndis should tell you the precise name of the ndiswrapper RPM package on your system.

  2. Type rpm -e <packagename> to erase it.
If you have urpmi set up, re-install ndiswrapper using urpmi ndiswrapper (this version works for me where the default one didn't).

Now download the drivers for the WPC11, from their official site or (in case it moves) from this server. Unzip the downloaded file:

unzip "ndis5x-8180(173).zip"

Quotes around the filename are required since the braces in the filename will be misinterpreted by the shell, if you're using bash. Type "urpmi unzip" if the unzip program is not already installed.

Here are the steps to get the drivers installed:
  1. Create the file /etc/sysconfig/network-scripts/ifcfg-wlan0 with these contents:
    DEVICE=wlan0
    BOOTPROTO=dhcp
    ONBOOT=no
    MII_NOT_SUPPORTED=no
    WIRELESS_MODE=Auto
    WIRELESS_ESSID=whatever
    WIRELESS_ENC_KEY=6E9DA44251
    NEEDHOSTNAME=no
    IPV6INIT=no
    IPV6_ROUTER=no
    IPV6_AUTOCONF=no
    Type chmod 755 /etc/sysconfig/network-scripts/ifcfg-wlan0. You should insert your own values for WIRELESS_ESSID and WIRELESS_ENC_KEY, although the latter is not required if you don't use WEP (although it is advisable). I disabled IPV6 since it seemed an unnecessary complication during setup, but you may wish to re-enable it for secure networking.

  2. Install the downloaded driver: ndiswrapper -i NET8180.INF

  3. Check it installed OK: ndiswrapper -l should produce output similar to
    Installed ndis drivers:
    net8180 hardware present
    If it says "hardware not present", you're out of luck: find another howto ...

  4. Load the driver: modprobe ndiswrapper

  5. Check your system logs by typing "dmesg" — you want to see various happy-time messages like this:
    ndiswrapper version 0.8 loaded
    ndiswrapper adding rtl8180.sys
    PCI: Enabling device 0000:06:00.0 (0000 -> 0003)
    ACPI: PCI interrupt 0000:06:00.0[A] -> GSI 9 (level, low) -> IRQ 9
    PCI: Setting latency timer of device 0000:06:00.0 to 64
    wlan0: ndiswrapper ethernet device 00:0c:41:bb:bc:80 using driver rtl8180.sys
  6. Save your configuration: ndiswrapper -m
Now, at this point it's supposed to work, according to other sources I searched, but for me it didn't, even after a reboot (and even if I set "ONBOOT=yes" in ifcfg-wlan0). I found out after a while that these commands (maybe not all are needed) will bring the card to life:
/sbin/iwconfig wlan0 key restricted 6D9C042141
/sbin/iwlist wlan0 scan
/sbin/dhclient wlan0
Remember again to change the items in blue to match your router's settings. When the final command is entered, you should see negotiation between your DHCP server (the router, in my case) and your PC. Eventually, it should acquire an IP address.

Typing "iwconfig" at this point should show something like this:
wlan0 IEEE 802.11b ESSID:"whatever"
Mode:Managed Frequency:2.462GHz Access Point: 00:0F:B5:51:27:9C
Bit Rate:11Mb/s Tx-Power:20 dBm Sensitivity=0/3
RTS thr:2432 B Fragment thr:2432 B
Encryption key:6E9D-A442-51 Security mode:restricted
Power Management:off
Link Quality:100/100 Signal level:-70 dBm Noise level:-256 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
And typing "ifconfig" should show something like this:
wlan0 Link encap:Ethernet HWaddr 00:0D:41:AB:BD:80
inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:41ff:ffbb:bc80/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2386 errors:0 dropped:0 overruns:0 frame:0
TX packets:977 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:753147 (735.4 Kb) TX bytes:299268 (292.2 Kb)
Interrupt:9 Memory:11000000-110000ff
Finally, to make it all happen automatically when I reboot, I put these lines at the end of the file /etc/rc.d/rc.local
# Start wireless network
/sbin/iwconfig wlan0 key restricted 6D9C042141
/sbin/iwlist wlan0 scan
/sbin/dhclient wlan0
I hope this works for you. I wish I'd bought a different card but it seems to be working perfectly now. If you have further info or corrections, post a comment.

1 Comments:

At 1:43 AM, Blogger cjb said...

Followed similar procedure for installing Netgear WG111 on Mandrake 10.1. Had to remove the official Mandrake verson of ndiswrapper as it did not recognise the hardware. Downloaded and compiled ndiswrapper 1.0 from sourceforge and installed device without a problem. Had to then reboot after configuring the device as it would not obtain a DHCP address but came up and works fine after reboot.

 

Post a Comment

<< Home