-<html>
- <head>
- <title>Automatic wifi without heavy network manager on debian</title>
- <link href="style.css" rel="stylesheet" type="text/css">
- </head>
- <body>
- <h3>PREREQUISITES</h3>
- <p>Install wpa_supplicant and wireless-tools(standard in most distros).<br />
-<pre># apt-get install wireless-tools wpa_supplicant</pre>
- <br />
- Identify your wifi controller. This can usually be found by typing<br />
- <pre>$ iwconfig</pre>
- <br />
- 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>
-
- <h3>INSTALLATION</h3>
- <p>Create the SSID selection script.<br />
- I've put mine in /etc/network/wifi/select<br />
-<pre>
-#!/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
-</pre>
- <br />
- Make it executable.<br />
- <pre># chmod +x /etc/network/wifi/select</pre>
- <br />
- Change in /etc/network/interfaces the [INTERFACE] specification.<br />
-<pre>
-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
-</pre>
- <br />
- You're finished! Restart the network service with:<br />
- <pre># service networking restartworking restart</pre>
- And you can connect to a available network by running this command.<br />
- <pre># ifup [INTERFACE]</pre>
- If you want to force an [SSID] you can run:<br />
- <pre># ifup [INTERFACE]=[SSID]</pre></p>
-
- <h3>CONFIG CREATION</h3>
- <p>Standard wpa2 network configs can be created by running:<br />
- <pre># wpa_passphrase [SSID] [PASSWORD] > /etc/network/wifi/[SSID].conf</pre>
- <br />
- For eduroam you can use this example:<br />
-<pre>
-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"
-}
-</pre>
- 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 />
-<pre>$ echo -n [PASSWORD] | iconv -t UTF16LE | openssl md4</pre>
- You should replace the plaintext string with: "hash:[HASHOUTPUT]"<br />
- note: don't use quotes.</p>
- <footer>update 2014-03-04: fixed a few small errors concerning hashing and config files</footer>
- </body>
-</html>