it:linux:wpa-eap

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
it:linux:wpa-eap [2012/08/15 08:30] berniit:linux:wpa-eap [2020/12/22 15:31] (aktuell) – [wpa_supplicant] admin
Zeile 11: Zeile 11:
  
 Als Radius-Server wird [[http://freeradius.org/|Freeradius]] verwendet. Als Radius-Server wird [[http://freeradius.org/|Freeradius]] verwendet.
 +
 +===== Freeradius Konfiguration =====
 +==== /etc/freeradius/clients.conf ====
 +
 +Will ein Client (in unserem Beispiel ein AP) eine Verbindung zum Radiusserver aufbauen, benötigt man einen entsprechenden Eintrag in der Datei "/etc/freeradius/clients.conf".
 +<code bash>
 +...
 +client 10.0.0.1 {
 +  secret = changeme
 +  shortname = ap-main
 +  nastype = other
 +}
 +...
 +</code>
 +
 +==== /etc/freeradius/eap.conf ====
 +
 +
 +Des Weiteren ist EAP zu konfigurieren.
 +"/etc/freeradius/eap.conf"
 +<code bash>
 + eap {
 + default_eap_type = tls
 + timer_expire     = 60
 + ignore_unknown_eap_types = no
 + cisco_accounting_username_bug = no
 + max_sessions = 4096
 +
 + tls {
 + certdir = ${confdir}/certs
 + cadir = ${confdir}/certs
 + private_key_file = ${certdir}/freeradius.key
 + certificate_file = ${certdir}/freeradius.crt
 + CA_file = ${cadir}/ca.crt
 + dh_file = ${certdir}/dh2048.pem
 + random_file = /dev/urandom
 + check_crl = no
 + CA_path = ${cadir}     
 + cipher_list = "DEFAULT"
 +
 + cache {       
 +       enable = no
 +       lifetime = 24 # hours
 +       max_entries = 255
 + }
 +
 + }
 +
 + peap {
 + default_eap_type = mschapv2
 + copy_request_to_tunnel = no
 + use_tunneled_reply = no
 + virtual_server = "inner-tunnel"
 + }
 +
 + mschapv2 {
 + }
 + }
 +</code>
 +
 +==== /etc/freeradius/sites-available/myconfig ====
 +<code bash>
 +authorize {
 + preprocess
 +  if("%{NAS-Identifier}" == "homenet") {
 +    update control {
 +      EAP-TLS-Require-Client-Cert = Yes
 +    }
 +    eap
 +  }
 +
 +  if("%{NAS-Identifier}" == "guestnet") {
 +    files
 +    eap
 +  }
 +}
 +
 +authenticate {
 + eap
 +}
 +
 +preacct {
 + preprocess
 + acct_unique
 + suffix
 + files
 +}
 +
 +accounting {
 + detail
 + unix
 + radutmp
 + exec
 + attr_filter.accounting_response
 +}
 +
 +session {
 + radutmp
 +}
 +
 +post-auth {
 + exec
 + Post-Auth-Type REJECT {
 + attr_filter.access_reject
 + }
 +}
 +
 +pre-proxy {
 +}
 +
 +post-proxy {
 + eap
 +}
 +</code>
 +
 +Das hier ist die zentrale Konfig des Radiusservers.
 +Es wird zwischen zwei NAS-Identifier unterschieden: "guestnet" und "homenet".
 +Beim Anmelden im "homenet" wird ein Client-Zertifikat verlangt.
 +
 +Config aktivieren:
 +<code bash>
 +cd /etc/freeradius
 +rm sites-enabled/default
 +ln -s sites-available/myconfig sites-enabled
 +</code>
 +
 +
 +===== PKI =====
 +
 +Wie in der Konfigdatei zu sehen ist, benötigt man eine Art [[http://en.wikipedia.org/wiki/Public_key_infrastructure|PKI]].
 +Um diese Anzulegen wird [[http://openvpn.net/index.php/open-source/documentation/miscellaneous/77-rsa-key-management.html|easy-rsa]] verwendet.
 +Bei Verwendung von Ubuntu findet man easy-rsa nach der Installation des Pakets "openvpn" unter "/usr/share/doc/openvpn/examples/easy-rsa/".
 +
 +  - "vars" editieren: <code bash>...
 +export KEY_COUNTRY="DE"
 +export KEY_PROVINCE="BY"
 +export KEY_CITY="MeinStadt"
 +export KEY_ORG="ex23"
 +export KEY_EMAIL=pki@home.local
 +export KEY_CN=wpa-eap-pki
 +export KEY_NAME=ex23
 +export KEY_OU=it_linux
 +</code>
 +  - Vorbereiten: <code bash>source ./vars
 +./build-dh && ./build-ca
 +</code>
 +  - Zertifikat für den Server erzeugen:<code bash>./build-key-server freeradius</code>
 +  - Zertifikat für einen Client erzeugen:<code bash>./build-key client01</code>
 +  - Zertifikat ([[http://en.wikipedia.org/wiki/PKCS12|PKCS12]]) für einen Client (z.B. IPhone, Windows, ...) erzeugen:<code bash>./build-key client02</code>
 +
 +Alle erzeugten Dateien befinden sich anschließend im Verzeichniss "keys":
 +<code bash>/tmp/easy-rsa/2.0 % ls keys
 +01.pem  client01.crt  client02.p12    freeradius.csr      serial
 +02.pem  client01.csr  client-new.crt  freeradius.key      serial.old
 +03.pem  client01.key  client-new.csr  index.txt
 +04.pem  client02.crt  client-new.key  index.txt.attr
 +ca.crt  client02.csr  dh1024.pem      index.txt.attr.old
 +ca.key  client02.key  freeradius.crt  index.txt.old
 +</code>
 +
 +==== Dateien für den Radiusserver ====
 +  * ca.crt: Das Certificate-Authority Zertifikat
 +  * freeradius.key: Der Private Schlüssel des Radiusservers
 +  * freeradius.crt: Das Zertifikat des Radiusservers
 +  * dh1024.pem: [[http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange|Diffie-Hellman-Parameter]]
 +
 +Diese Dateien werden unter "/etc/freeradius/certs" abgelegt.
 +
 +==== Dateien für den Client ====
 +  * ca.crt: Das Certificate-Authority Zertifikat
 +  * client01.key: Der Private Schlüssel des Clients
 +  * client01.crt: Das Zertifikat des Clients
 +
 +Im Falle einer PKCS12 Datei, muss nur diese verteilt werden.
 +
 +===== Accesspoints =====
 +Nach dem Installieren von OpenWRT muss noch das Paket "wpad" installiert werden:
 +
 +<code bash>
 +opkg update
 +opkg remove wpad-mini
 +opkg install wpad
 +</code>
 +
 +==== /etc/config/network ====
 +<code bash>
 +
 +config 'interface' 'loopback'
 +        option 'ifname' 'lo'
 +        option 'proto' 'static'
 +        option 'ipaddr' '127.0.0.1'
 +        option 'netmask' '255.0.0.0'
 +
 +config 'switch'
 +        option 'name' 'rtl8366rb'
 +        option 'reset' '1'
 +        option 'enable_vlan' '1'
 +
 +#VLAN ID 4 shall be the guestnet
 +#VLAN is tagged for CPU (@5) and WAN Port (@0)
 +config 'switch_vlan'
 +        option 'device' 'rtl8366rb'
 +        option 'vlan' '4'
 +        option 'ports' '0t 5t'
 +
 +#VLAN ID 5 shall be the homenet
 +#VLAN is tagged for CPU (@5) and WAN Port (@0)
 +config 'switch_vlan'
 +        option 'device' 'rtl8366rb'
 +        option 'vlan' '5'
 +        option 'ports' '0t 5t'
 +        
 +#IP config for homenet
 +config 'interface' 'home_net'
 +        option 'proto' 'static'
 +        option 'ifname' 'eth0.5'
 +        option 'netmask' '255.255.255.0'
 +        option 'type' 'bridge'
 +        option 'gateway' '10.0.3.250'
 +        option 'dns' '10.0.3.1'
 +        option 'ipaddr' '10.0.3.250'
 +
 +#IP config for guestnet
 +config 'interface' 'guest_net'
 +        option 'type' 'bridge'
 +        option 'proto' 'static'
 +        option 'ifname' 'eth0.4'
 +        option 'netmask' '255.255.255.0'
 +        option 'ipaddr' '10.0.2.250'
 +</code>
 +
 +==== /etc/config/wireless ====
 +<code bash>
 +...
 +
 +config 'wifi-iface'
 +        option 'device' 'radio0'
 +        option 'mode' 'ap'
 +        option 'ssid' 'gastnetz'
 +        option 'network' 'guest_net'
 +        option 'encryption' 'wpa2'
 +        option 'auth_secret' 'changeme'
 +        option 'auth_server' '10.0.3.1'
 +        option 'acct_server' '10.0.3.1'
 +        option 'acct_secret' 'changeme'
 +        option 'nasid' 'guestnet'
 +
 +config 'wifi-iface'
 +        option 'device' 'radio0'
 +        option 'mode' 'ap'
 +        option 'ssid' 'heimnetz'
 +        option 'network' 'home_net'
 +        option 'encryption' 'wpa2'
 +        option 'auth_secret' 'changeme'
 +        option 'auth_server' '10.0.3.1'
 +        option 'acct_server' '10.0.3.1'
 +        option 'acct_secret' 'changeme'
 +        option 'nasid' 'homenet'
 +</code>
 +
 +**HINWEISE:**   
 +  * Der Radiusserver ist unter der IP 10.0.3.1 zu erreichen.
 +  * Der gemeinsame Schlüssel zwischen Radiusserver und Client ist "changeme"
 +  * Der NAS-Identifier für das "gastnetz" ist "guestnet" und für das "heimnetz" ist er "homenet"
 +
 +==== wpa_supplicant ====
 +
 +=== /etc/network/interfaces ===
 +<code bash>
 +...
 +auto wlan0
 +allow-hotplug wlan0
 +iface wlan0 inet dhcp
 +  wpa-driver wext
 +  wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
 +...
 +</code>
 +=== EAP-TLS ===
 +
 +<code bash>
 +ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
 +update_config=1
 +country=DE
 +fast_reauth=1
 +p2p_disabled=1
 +
 +network={
 +  ssid="<SSID>"
 +  eap=TLS
 +  key_mgmt=WPA-EAP
 +  pairwise=CCMP TKIP
 +  proto=RSN
 +  group=CCMP TKIP
 +  identity="<DEVICE_IDENTITY>"
 +  ca_cert="/etc/cert/ca.crt"
 +  client_cert="/etc/cert/device.crt"
 +  private_key="/etc/cert/device.key"
 +  private_key_passwd="<PRIVATE KEY>"
 +
 +}
 +
 +</code>
 +
 +
 +====== Links ======
 +  * [[http://en.wikipedia.org/wiki/Wi-Fi_Protected_Access#EAP_extensions_under_WPA_and_WPA2_Enterprise]]
 +  * [[http://en.wikipedia.org/wiki/Extensible_Authentication_Protocol]]
 +  * [[http://en.wikipedia.org/wiki/Extensible_Authentication_Protocol#PEAP]]
 +  * [[http://www.tp-link.com/en/products/details/?model=TL-WR1043ND]]
 +  * [[http://en.wikipedia.org/wiki/Virtual_LAN]]
 +  * [[http://freeradius.org/]]
 +
 +
 +
  
  • it/linux/wpa-eap.1345019433.txt.gz
  • Zuletzt geändert: 2015/12/24 14:25
  • (Externe Bearbeitung)