file "/etc/network/interfaces":
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto wlan0
iface wlan0 inet dhcp
pre-up wpa_supplicant -B -Dwext -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -f /var/log/wpa_supplicant.log
post-down killall -q wpa_supplicant
iface default inet dhcp
Alternative file "/etc/network/interfaces":
auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-scan-ssid 1
wpa-ap-scan 1
wpa-key-mgmt WPA-PSK
wpa-proto RSN WPA
wpa-pairwise CCMP TKIP
wpa-group CCMP TKIP
wpa-ssid "SSID_WIFI"
wpa-psk "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
iface default inet dhcp
wpa_passphrase: utility for generating a 256-bit pre-shared WPA key from an ASCII passphrase.
$ wpa_passphrase SSID_WIFI password
network={
ssid="SSID_WIFI"
#psk="password"
psk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
}
File "/etc/wpa_supplicant/wpa_supplicant.conf":
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="SSID_WIFI"
scan_ssid=1
proto=RSN WPA
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
auth_alg=OPEN
priority=0
id_str="home"
#psk="XXXXXXXXXXXXXXXXXXXX"
psk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
}
Leraning about wpa_supplicant file:
ssid: your wifi name.
scan_ssid: set value to 1 if you are trying to connect to hidden network or if you have more than one wireless access point; each with different ssid (suggest you enter value of 1) alternatively, set value of 0 will do the opposite of value 1 (for home networks that broadcasts ssid).
psk: your wifi password.
proto: your choice of RSN or WPA. RSN is WP2 and WPA is WPA1. (most config is RSN).
key_mgmt: your choice of WPA-PSK or WPA-EAP (pre-shared or enterprise respectively).
pairwise: your choice of CCMP or TKIP ( WPA2 or WPA1 respectively).
auth_alg: OPEN option is required for WPA and WPA2 (other option, SHARED & LEAP).
Command to reload or restart network:
# /etc/init.d/networking restart