With the following command you can see a list of available Access Points (AP).
$ iwlist wlan0 scan
Find the one you want to use and pick the ESSID, i.e. ESSID: "my_network"
When using Wi-Fi Protected Access (WPA) you will need to generate the Pre-shared key (PSK) with your (E)SSID you picked before and the PASSWORD used to connect to the Access Point:
$ wpa_passphrase ESSID PASSWORD
$ wpa_passphrase my_network 123456789
network={
ssid="my_network"
#psk="123456789"
psk=1aff74de016d74e09ece8d09db76478f20bc1032e3b52d5c0053f655a279a880
}
Open the wpa_supplicant.conf file as root with the editor of your choice:
$ sudo vi /etc/wpa_supplicant/wpa_supplicant.conf
$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Insert the network informations you created with wpa_passphrase, i.e:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="my_network"
#psk="123456789"
psk=1aff74de016d74e09ece8d09db76478f20bc1032e3b52d5c0053f655a279a880
}
To see you actual network interfaces you can use these tools:
# see the actual configured interfaces
$ ifconfig
# see the configuration for wireless interfaces
$ iwconfig
Pick your wireless interface and try to start it, i.e. wlan0:
$ sudo ifup wlan0
Eventually you will need to get an IP-adress:
$ dhclient wlan0
After a restart your wireless network should start automatically.