WPA e FreeRadius HOWTO
WPA + FreeRadius HOWTO
SCHEMA GENERALE
================
| | Windows XP Sp2 o Vista o Linux
| WiFi client |
| |
================
| A
| |
| | WPA
| |
| |
| | ( RADIUS ) (CONTROLLER)
V | Fedora8
================ ================ =====================
| | | Free Radius | | |
| Access Point | -----------> | + | -----------> | Domain Controller |
| | | Samba | | (SAMBA o NT) |
================ ================ =====================
Prima di procedere è necessario verificare la presenza su RADIUS dei pacchetti openssl e openssl-devel
1) PARTE 1: INSTALLAZIONE E CONFIGURAZIONE SAMBA
Scaricare la versione 3.0.31 di Samba (le versioni precompilate che si trovano con le distribuzioni
hanno quasi sempre un bug. Si fa prima a ricompilare Samba che non a trovare la patch o altro)
# cd samba-3.0.31/source
# ./configure --enable-cups --with-pam
NB: necessiata pam-devel e cups-devel (in realtà il supporto cups non è necessario a meno che l'host
non debba funzionare anche come print server)
Il file di configurazione è in /usr/local/samba/lib (da creare dopo l'installazione)
Di seguito c'è quello usato nel sistema di laboratorio di Tecnes
[global]
workgroup = MITEC03 # DA SOSTITUIRE COL NOME DEL DOMINIO
server string = Radius Server
netbios name = vmwaresrv # DA SOSTITUIRE COL NOME DEL SERVER
loglevel=0
# logs split per machine
log file = /var/log/samba/log.%m
# max 50KB per log file, then rotate
max log size = 50
security = domain
password server = dc01 # DA SOSTITUIRE COL NOME DEL DOMAIN CONTROLLER
passdb backend = tdbsam
username map = /etc/samba/smbusers
winbind enum users = yes
winbind enum groups = yes
enable privileges = Yes
domain master = no
domain logons = no
logon path =
add user script = /usr/sbin/useradd "%u" -n -g users
add group script = /usr/sbin/groupadd "%g"
add user to group script = /usr/sbin/usermod -A "%g" "%u"
add machine script = /usr/sbin/useradd -n -c "Workstation (%u)" -M -d /nohome -s /bin/false "%u"
delete user script = /usr/sbin/userdel "%u"
wins support = no
wins server = 172.20.83.15
dns proxy = no
name resolve order = host wins bcast
printcap name = cups
#obtain list of printers automatically on SystemV
printing = cups
load printers = yes
cups options = raw
#============================ Share Definitions ==============================
[homes]
comment = Home Directories
browseable = no
writable = yes
valid users = %S
; valid users = MYDOMAIN\%S
Avviare i servizi
# /usr/local/samba/sbin/smbd -D
# /usr/local/samba/sbin/nmbd -D
# /usr/local/samba/sbin/winbindd -D
Aggiungere RADIUS al dominio
# net join MITEC03 -Uadministrator%
Riavviare i servizi
# killall winbindd
# killall nmbd
# killall smbd
# /usr/local/samba/sbin/smbd -D
# /usr/local/samba/sbin/nmbd -D
# /usr/local/samba/sbin/winbindd -D
verificare il funzionamento di winbind
# /usr/local/samba/bin/wbinfo -D mitec03
Name : MITEC03
Alt_Name :
SID : S-1-5-21-4069564598-3891574429-1339956793
Active Directory : No
Native : No
Primary : Yes
Sequence : 1218623211
#
modificare il file /etc/nsswitch.conf aggiungendo winbind come segue
passwd: files winbind
shadow: files winbind
group: files winbind
Verificare l'autenticazione con ntlm_auth
# /usr/local/samba/bin/ntlm_auth --request-nt-key --username= (es: administrator)
password:
NT_STATUS_OK: Success (0x0)
#
2) PARTE 2: INSTALLAZIONE E CONFIGURAZIONE FREERADIUS
prerequisiti: OPENSSL (anche le librerie openssl-devel)
scaricare i sorgenti da www.freeradius.org
# wtpget ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-.tar.gz
# tar -xzvf freeradius-server-.tar.gz
# cd freeradius-server-
# ./configure
# make
# make install
I file di configurazione vengono creati in /usr/local/etc/raddb
NB: alla prima esecuzione verranno creati i certificati necessari per i metodi di autenticazione TLS
# radiusd -X
Il sistema carica i files di configurazione e crea i certificati necesari.
Sulla console appaiono le seguenti righe
...................
..................
Listening on authentication address * port 1812
Listening on accounting address * port 1813
Listening on proxy address * port 1814
Ready to process requests.
Il server Radius è stato installato e avviato correttamente
Bisogna modificare i seguenti file nella cartella /usr/local/etc/raddb
In clients.conf modificare la chiave (testin123) relativa al client 127.0.0.1 e aggiungere
client {
secret =
shortname = netgear
}
Ovviamente è necessario inserire l'indirizzo IP dell'access Point e la chiave che verrà usata
dall'access point per instaurare la comunicazione con il server Radius
In eap.conf
nella sezione eap
......
#default_eap_type = md5
default_eap_type = peap
.....
nella sezione tls
.....
# make_cert_command = "${certdir}/bootstrap"
......
nella sezione peap
peap {
# The tunneled EAP session needs a default
# EAP type which is separate from the one for
# the non-tunneled EAP module. Inside of the
# PEAP tunnel, we recommend using MS-CHAPv2,
# as that is the default type supported by
# Windows clients.
default_eap_type = mschapv2
................
}
In modules/mschap
mschap {
....................
....................
ntlm_auth = "/usr/local/samba/bin/ntlm_auth --request-nt-key --username=%{User-Name} --challenge=%{mschap:Challenge:-00} --nt-response=%{mschap:NT-Response:-00}"
}
3) PARTE 3: CONFIGURAZIONE ACCES POINT
Io ho realizzato il sistema usando un netgear, ma va bene ogni Access Point che supporta
WPA e Radius (WPA - 802.1x) .
Bisogna andare nella sezione di configurazione dei parametri per il collegamento con il
server Radius ed inserire l'indirizzo del server e la Shared Secret che avete scritto nel file clients.conf
Va inoltre abilitata l'autenticazione di rete WPA con Radius.
Buona fortuna a tutti