If Linux recognizes your network card, but you can't get onto an
encrypted network (but you can get on your neighbor's open network), try
these commands (obviously you've got to adapt these to have them sync up with
your distribution. The important lines are in bold.
#!/bin/sh
SSID=virusexperts # duh
NICK=thor # can be anything you like; this is the name of my laptop here
KEY=XXXXXXXXXXXXXXXXXXXXXXXXXX # your 128-bit key (NOT password)
INTERFACE=eth0
IPADDR=192.168.1.200 # i like static ips
BROADCAST=192.168.1.255
NETMASK=255.255.255.0
GATEWAY=192.168.1.1 # ip of your access point
/sbin/ifconfig lo up
/sbin/route del default
/sbin/ifconfig $INTERFACE down
/sbin/ifconfig $INTERFACE $IPADDR netmask $NETMASK broadcast $BROADCAST up
/sbin/iwconfig $INTERFACE essid $SSID nick $NICK
/sbin/iwconfig $INTERFACE key $KEY
/sbin/iwconfig $INTERFACE enc restricted
/sbin/route add default gw $GATEWAY
echo "nameserver $GATEWAY" > /etc/resolv.conf
My wifi setup (from the laptop) didn't work until I forced the encryption
mode to be restricted, that is only allow encrypted packets. By
default, encryption mode is set to open, meaning accept encrypted and
non-encrypted packets. Obviously, you should set it to open if you'll
be using a wifi lan that does not use encryption, in which case you'll also
have to change the SSID. In my opinion, ifplugd/dhclient/etc. interfere with
this kind of setup, which is why one should stop the network and them
manually bring up your wireless interface. If not, just kill the offensive
daemons and you'll be on your way. If you have dynamic IP address assignment,
you don't need to worry about killing anything, just set your encryption key
and poof you're on the net!