http://www.wirelessdefence.org/Contents/LinuxWirelessCommands.htm
Note: To connect your Linux machine to a WLAN using WPA, WPA2 or 802.1X you will need to use WPA Supplicant
—————-
Note: replace [interface] with your interface name as required (e.g. eth1, wlan0, ath0 etc.)
iwconfig [interface] mode managed key [WEP key] (128 bit WEP use 26 hex characters, 64 bit WEP uses 10)
iwconfig essid “[ESSID]” (Specify ESSID for the WLAN)
dhclient [interface] (to receive an IP address, netmask, DNS server and default gateway from the Access Point)
ping http://www.bbc.co.uk (if you receive a reply you have access)