c3d2-wiki/Wpa_supplicant.mw
2014-06-19 16:02:41 +00:00

89 lines
2.3 KiB
Plaintext

== wpa_supplicant ==
Ist eine Variante wie die WLAN-Netzwerke konfiguriert werden können. Im Vergleich zum Networkmanager u.a. unter Gnome (Paket gnome-network-manager) ist dies weniger Fehleranfällig und leichter direkt aus dem Terminal konfigurierbar. Ein weiteres Feature ist die Priorisierung von Netzwerken. Die Konfigurationsdatei liegt als Plaintext vor und ist damit auch eine brauchbare Dokumentation.
=== Installation ===
==== Debian ====
1. Paket installieren
<source lang=bash>
sudo apt-get update
sudo apt-get install wpasupplicant
</source>
2. Rechte auf Interfaces beschränken
<source lang=bash>
sudo chmod 0600 /etc/network/interfaces
</source>
3. Interfaces prüfen
<source lang=bash>
cat /etc/network/interfaces
</source>
oder setzen:
<source lang=bash>
sudo cat >/etc/network/interfaces<<EOF
# The loopback network interface
auto lo
iface lo inet loopback
auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
EOF
</source>
=== Konfiguration ===
==== Offenes WLAN konfigurieren ====
erstmal ansehen:
<source lang=bash>
cat /etc/wpa_supplicant/wpa_supplicant.conf
</source>
die Datei kann so zum freien WLAN im HQ führen:
<source lang=bash>
cat >/etc/wpa_supplicant/wpa_supplicant.conf<<EOF
### ### ### C3D2 ### ### ###
network={
ssid="C3D2"
key_mgmt=NONE
priority=0
}
### ### ### C3D2 ### ### ###
EOF
</source>
==== Passwortgeschütztes WLAN konfigurieren ====
mit wpa_passphrase am Bsp. [[C3D2-fallback]] als Einzeiler:
<source lang=bash>
wpa_passphrase C3D2-fallback >> /etc/wpa_supplicant/wpa_supplicant.conf
</source>
mit <code>wpa_cli</code> (nähere Erläuterung s. Quelle)
<pre>scan
scan_results
add_network
set_network 0 ssid "WLAN-Network"
set_network 0 psk "SupahSecretPassphrase"</pre>
==== Priorisierung ====
Für jedes Netzwerk kann über den Wert <tt>priority=x</tt> ein Wert <tt>x</tt> (Ganze Zahlen -ge 0) definiert werden. Die Verbindung wird zum Netzwerk mit der höchsten Priorität zuerst aufgebaut, bei gleicher Priorität wird die Reihenfolge durch die Eintragung in der Konfiguration bestimmt.
== Quellen ==
* wpa_supplicant im [https://wiki.debian.org/WiFi/HowToUse#wpa_supplicant Debian-Wiki]
* [http://sirlagz.net/2012/08/27/how-to-use-wpa_cli-to-connect-to-a-wireless-network/ wpa_cli erläutert]