Install wpa_supplicant and wireless-tools(standard in most distros).
# apt-get install wireless-tools wpa_supplicant
$ iwconfig
Create the SSID selection script.
I've put mine in /etc/network/wifi/select
#!/bin/sh ifconfig [INTERFACE] up 1> /dev/null && { iwlist [INTERFACE] scan | grep -o "\".*\"" | tr -d \'\" | sort | uniq; grep -o "map\ .*" /etc/network/interfaces | awk '{print $2}'; } | sort | uniq -d | head -1
# chmod +x /etc/network/wifi/select
mapping [INTERFACE] script /etc/network/wifi/select map [SSID]1 map [SSID]2 .. map eduroam iface [SSID]1 inet dhcp wpa_conf /etc/network/wifi/[SSID]1.conf iface [SSID]2 inet dhcp wpa_conf /etc/network/wifi/[SSID]2.conf .. iface eduroam inet dhcp wpa_conf /etc/network/wifi/eduroam.conf
# service networking restartworking restartAnd you can connect to a available network by running this command.
# ifup [INTERFACE]If you want to force an [SSID] you can run:
# ifup [INTERFACE]=[SSID]
Standard wpa2 network configs can be created by running:
# wpa_passphrase [SSID] [PASSWORD] > /etc/network/wifi/[SSID].conf
network={ ssid="eduroam" key_mgmt=WPA-EAP eap=TTLS phase2="auth=MSCHAPV2" ca_cert="/etc/ssl/certs/AddTrust_External_Root.pem" identity="login@university.nl" scan_ssid=1 password="YOURPASSWORD" }If you don't want your password in a config you can also use a hash generated by this command. (Don't forget to remove it from ~/.bash_history afterwards)
$ echo -n [PASSWORD] | iconv -t UTF16LE | openssl md4You should replace the plaintext string with: "hash:[HASHOUTPUT]"