file "/etc/network/interfaces":
auto loiface lo inet loopbackauto eth0iface eth0 inet dhcpauto wlan0iface 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_supplicantiface default inet dhcpAlternative file "/etc/network/interfaces":
auto loiface lo inet loopbackauto eth0allow-hotplug eth0iface eth0 inet dhcp auto wlan0allow-hotplug wlan0iface 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 dhcpwpa_passphrase: utility for generating a 256-bit pre-shared WPA key from an ASCII passphrase.
$ wpa_passphrase SSID_WIFI passwordnetwork={ ssid="SSID_WIFI" #psk="password" psk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}File "/etc/wpa_supplicant/wpa_supplicant.conf":
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdevupdate_config=1network={ 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