[COLUG] Wireless woes

William Yang wyang at gcfn.net
Fri Jul 20 08:09:39 EDT 2007


David McGlone wrote:
> Hi all.
> 
> sorry I accidently sent the unfinished e-mail. laptop touchpad was under my 
> palm.
> 
> I put a wireless nic in my desktop running kubuntu 7.04. I am using 
> ndiswrapper and the card shows at wlan0 but there is something wrong.
> 
> The problem is I cannot connect to my network. I am using 128 bit encryption 
> and when I use a passphrase or hex it will not connect, but if I turn off the 
> encryption on the router everything works fine.
 >
 > Also, everything works fine under windows, with and without encryption.
 >
 >  I've been working on this for 3 days. I've considered ipv6 being on, i've
 > considered the fact the card is  an 802.11b and the router is 802.11G but I
 > have the router set so b and G both can use it. Also that shouldn't be a
 > problem since everything works flawlessly under windows.
 >
 > What am I missing?


Presumably, you're talking about WEP encryption (WPA and others also 
exist).  I haven't had to do a lot of tweaking since I upgraded my laptop 
to something that had good, stable, fully-supported-by-my-distribution 
native Linux drivers, I used the following script.  It may give you a 
decent starting point toward manual configuration.

To use this script, you need to modify the DRIVER and IFACE variables, and 
create a directory structure in $HOME/.802_11/wep.  In that directory, you 
create files named after a SSID ("2WIRE451"), containing the WEP key you 
want to use.

The script can be invoked with an argument (the first argument being the 
SSID to attach to), or without arguments (which will give you a list of 
SSIDs you can connect to and the option to enter the one you want).

No warranties, guarantees, or offers of support.  Use at your own risk.

#! /bin/sh

exit 0     # you have to modify this script to make it work!
IFACE=wlan0
DRIVER=zd1211
ESSID="$1"
TEMP=/tmp/wireless.$$
WEPKEYS=${HOME}/.802_11/wep

if [ `lsmod | grep -c $DRIVER` -le 0 ] ; then
     modprobe -v $DRIVER
fi

ifconfig $IFACE down
ifconfig $IFACE up

[ -f $TEMP ] && /bin/rm -f $TEMP
iwlist $IFACE scanning 2>/dev/null > $TEMP
while [ `grep -c "ESSID:\"${ESSID}\"[ ]*$" $TEMP` -le 0 ] ; do
     grep ESSID: $TEMP
     echo -n "Please enter the ESSID to use: "
     read ESSID < /dev/tty
done
[ -f $TEMP ] && /bin/rm -f $TEMP

if [ -f ${WEPKEYS}/$ESSID ] ; then
     iwconfig $IFACE essid $ESSID key `cat $WEPKEYS/$ESSID`
else
     iwconfig $IFACE essid $ESSID
fi
dhcpcd $IFACE -h `hostname`

-- 
William Yang
wyang at gcfn.net


More information about the colug432 mailing list