WLAN-ArchLinux
Diese Seite behandelt die Verwendung des geschützten WLAN HSR-Secure an der HSR unter ArchLinux. Man authentifiziert sich mit dem HSR-Benutzername und dem HSR-Passwort an einem Radius-Server.
Inhaltsverzeichnis
Installation
Die Netzwerke verwaltet man am besten mit netcfg. Daher wird das Paket installiert:
$ sudo pacman -S netctl
Konfiguration HSR-Secure
Konfigurationsdatei für netctl
Man legt eine Konfigurationsdatei für netctl an:
$ sudo vi /etc/netctl/wlan0-hsr_secure
Mit folgendem Inhalt:
# # /etc/netctl/wlp2s0-HSR-Secure # Description='WLAN HSR-Secure' Interface=wlp2s0 Connection=wireless Security=wpa-configsection IP=dhcp ESSID=HSR-Secure WPAConfigSection=( 'ssid="HSR-Secure"' 'scan_ssid=1' 'key_mgmt=WPA-EAP' 'eap=PEAP' 'identity="eduss"' 'password="_dein_passwort_"' 'phase2="auth=MSCHAPV2"' )
Security
Da das Passwort in Klartext in der Datei /etc/network.d/wlan0-hsr_secure.conf steckt, passt man dort die Berechtigung so an, dass es nur noch von root gelesen oder beschrieben werden darf:
$ sudo chmod 600 /etc/netctl/wlan0-HSR-Secure
Danach sehen die Berechtigungen so aus:
$ ls -l /etc/network.d/wlan0-hsr_secure* -rw-r--r-- 1 root root 418 6. Sep 13:04 /etc/netctl/wlan0-HSR-Secure
Das HSR-Secure Netzwerk benutzen
WLAN starten
$ sudo netctl start HSR-Secure
WLAN stoppen
$ sudo netctl stop HSR-Secure
WLAN automatisch verbinden (wlp2s0 evtl. anpassen)
$ sudo systemctl enable netctl-auto@wlp2s0 $ sudo systemctl start netctl-auto@wlp2s0
WLAN mit wap_spplicant
Man legt eine Konfigurationsdatei für den wpa_supplicant an:
$ sudo vi /etc/netctl/wlan0-hsr_secure.conf
Mit folgendem Inhalt:
######################################################################## # # /etc/netctl/wlan0-hsr_secure.conf # Konfigurationsdatei WLAN HSR-Secure für netcfg via wpa_supplicant # ######################################################################## ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel network={ ssid="HSR-Secure" scan_ssid=1 key_mgmt=WPA-EAP eap=PEAP identity="HSR-Benutzername" password="HSR-Passwort" phase2="auth=MSCHAPV2" }
Man kann die wpa_supplicant Konfiguration auch ohne netcfg verwenden:
$ sudo wpa_supplicant -i wlan0 -c /etc/netctl/wlan0-hsr_secure.conf wlan0: Trying to associate with 6c:50:4d:ab:9b:4c (SSID='HSR-Secure' freq=5240 MHz) wlan0: Associated with 6c:50:4d:ab:9b:4c wlan0: CTRL-EVENT-EAP-STARTED EAP authentication started wlan0: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=25 wlan0: CTRL-EVENT-EAP-METHOD EAP vendor 0 method 25 (PEAP) selected wlan0: CTRL-EVENT-EAP-PEER-CERT depth=1 subject='/C=BM/O=QuoVadis Limited/OU=www.quovadisglobal.com/CN=QuoVadis Global SSL ICA' wlan0: CTRL-EVENT-EAP-PEER-CERT depth=1 subject='/C=BM/O=QuoVadis Limited/OU=www.quovadisglobal.com/CN=QuoVadis Global SSL ICA' wlan0: CTRL-EVENT-EAP-PEER-CERT depth=0 subject='/C=CH/ST=St. Gallen/L=Rapperswil/O=Hochschule Rapperswil/OU=IT-Systems/CN=radius.hsr.ch' EAP-MSCHAPV2: Authentication succeeded EAP-TLV: TLV Result - Success - EAP-TLV/Phase2 Completed wlan0: CTRL-EVENT-EAP-SUCCESS EAP authentication completed successfully wlan0: WPA: Key negotiation completed with 6c:50:4d:ab:9b:4c [PTK=CCMP GTK=CCMP] wlan0: CTRL-EVENT-CONNECTED - Connection to 6c:50:4d:ab:9b:4c completed (auth) [id=0 id_str=]
Mit -B kann man wpa_supplicant auch noch in den Hintergrund versetzen. Dann bekommt man die Meldungen nicht zu sehen:
$ sudo wpa_supplicant -i wlan0 -c /etc/netctl/wlan0-hsr_secure.conf -B
Mann muss sich jedoch selber eine IP-Konfigurations mittels DHCP besorgen:
$ sudo dhclient -v wlan0 Internet Systems Consortium DHCP Client 4.2.4-P1 Copyright 2004-2012 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on LPF/wlan0/58:13:37:23:05:42 Sending on LPF/wlan0/58:13:37:23:05:42 Sending on Socket/fallback DHCPREQUEST on wlan0 to 255.255.255.255 port 67 DHCPACK from 1.2.3.4 bound to 152.96.233.82 -- renewal in 565 seconds.
Man bekommt eine IP-Adresse:
$ ip addr list wlan0 3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000 link/ether 58:13:37:23:05:42 brd ff:ff:ff:ff:ff:ff inet 152.96.233.82/21 brd 152.96.239.255 scope global wlan0 inet6 fe80::5a94:6bff:fee9:fd78/64 scope link valid_lft forever preferred_lft forever
Eine Default-Route:
$ ip route default via 152.96.232.1 dev wlan0 152.96.232.0/21 dev wlan0 proto kernel scope link src 152.96.233.82
Sowie eine Domain und zwei DNS-Server:
$ cat /etc/resolv.conf search hsr.ch nameserver 152.96.20.10 nameserver 152.96.21.10
Viel Spass dabei.