3 <title>Automatic wifi without heavy network manager on debian
</title>
4 <link href=
"style.css" rel=
"stylesheet" type=
"text/css">
8 <p>Install wpa_supplicant and wireless-tools(standard in most distros).
<br />
9 <pre># apt-get install wireless-tools wpa_supplicant
</pre>
11 Identify your wifi controller. This can usually be found by typing
<br />
14 Locate all the config files for your desired networks. Mine are placed in /etc/network/wifi/
<SSID>.conf. More info on creating configs in the end of the file.
</p>
17 <p>Create the SSID selection script.
<br />
18 I've put mine in /etc/network/wifi/select
<br />
21 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
24 Make it executable.<br />
25 <pre># chmod +x /etc/network/wifi/select</pre>
27 Change in /etc/network/interfaces the [INTERFACE] specification.<br />
30 script /etc/network/wifi/select
36 iface [SSID]1 inet dhcp
37 wpa_conf /etc/network/wifi/[SSID]1.conf
39 iface [SSID]2 inet dhcp
40 wpa_conf /etc/network/wifi/[SSID]2.conf
44 iface eduroam inet dhcp
45 wpa_conf /etc/network/wifi/eduroam.conf
48 You're finished! Restart the network service with:<br />
49 <pre># service networking restartworking restart</pre>
50 And you can connect to a available network by running this command.<br />
51 <pre># ifup [INTERFACE]</pre>
52 If you want to force an [SSID] you can run:<br />
53 <pre># ifup [INTERFACE]=[SSID]</pre></p>
55 <h3>CONFIG CREATION</h3>
56 <p>Standard wpa2 network configs can be created by running:<br />
57 <pre># wpa_passphrase [SSID] [PASSWORD] > /etc/network/wifi/[SSID].conf</pre>
59 For eduroam you can use this example:<br />
65 phase2="auth=MSCHAPV2
"
66 ca_cert="/etc/ssl/certs/AddTrust_External_Root.pem
"
67 identity="login@university.nl
"
69 password="YOURPASSWORD
"
72 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)<br />
73 <pre>$ echo -n [PASSWORD] | iconv -t UTF16LE | openssl md4</pre>
74 You should replace the plaintext string with: "hash:[HASHOUTPUT]
"<br />
75 note: don't use quotes.</p>
76 <footer>update 2014-03-04: fixed a few small errors concerning hashing and config files</footer>