CLI - Connect to a wireless network via command line.
You may have to:
service network-manager stop
For wep:
if using eth0, wlan0 or wlan1 substitute
ifconfig wlan0 down
iwconfig wlan0 essid AP_NAME
iwconfig wlan0 key AP_KEY
ifconfig wlan0 up
dhclient wlan0
check status:
iwconfig wlan0
or
ping -c3 newbielink:http://www.google.com
[nonactive]to scan:
iwlist scan
check hardware:
lspci | grep -i net
For WPA:
go to /etc/dbus-1/system.d
make a copy of wpa_supplicant file
then go back to that file and config like this:
network={
ssid="ssid_name"
psk="password"
}
leave the "" just enter yer AP and pass, delete everything else
save exit
from cli:
wpa_supplicant -B -Dwext -iwlan0 -c/etc/dbus-1/system.d/wpa_supplicant.conf -dd
then: dhclient wlan0
use the commands above to check status etc.
lt
Note: while ifconfig wlan0 down you can also do:
macchanger -r wlan0
ifconfig wlan0 promisc
or
ifconfig wlan0 hw ether 00:11:22:33:44:55
thanx ZEROF

Another update 05.08.13
if you are connecting to a hidden ssid,
you need to add ssid_scan=1 to the wpa_supplicant.conf file
i went into my router, took my ssid off broadcasting, didn't realize it'd
mess the wpa_supplicant up, coz couldn't get dhclient to connect
so added the scan to the config was good to go