= FreeRadius Installation = In questa sezione verrà mostrato come installare FreeRadius e tutte le sue componenti su Ubuntu Server 8.04.3. Ovviamente la guida da per scontato che abbiate installato Ubuntu Server 8.04.3. == Installation of base packages == {{{ system@meshboard:~$ sudo apt-get install freeradius freeradius-mysql system@meshboard:~$ mysql -u root -p Enter password: mysql> CREATE DATABASE radius; mysql> quit system@meshboard:~$ sudo zcat /usr/share/doc/freeradius/example/mysql.sql.gz | mysql -u root -p radius Enter Password : system@meshboard:~$ mysql -u root -p Enter password : mysql> GRANT ALL PRIVILEGES ON radius.* TO 'radius'@'localhost' IDENTIFIED BY ''; mysql> FLUSH PRIVILEGES; mysql> quit }}} A questo punto avrete Freeradius installato sulla vostra macchina con tanto di database (rlm_sql). Ovviamente per avere Freeradius funzionante in realtime è necessario apportare qualche modifica ai file di configurazione di freeradius istruendolo su come connettersi a mysql. {{{ system@meshboard:~$ sudo vim /etc/freeradius/sql.conf }}} e cambiare i parametri di connessione al database in accordo con quelli che avete scelto precedentemente: {{{ server = "localhost" login = "radius" password = "" }}} Aggiungiamo un NAS di test su localhost {{{ system@meshboard:~$ sudo vim /etc/freeradius/clients.conf }}} {{{ client 127.0.0.1 { secret = radiussecret } }}} === Testiamo la configurazione === A questo punto conviene testare la configurazione per verificare che tutto stia funzionando come dovrebbe: Apriamo il file di configurazione degli utenti (non realtime) {{{ system@meshboard:~$ sudo vim /etc/freeradius/users }}} e aggiungiamo un utente di prova decommentando: {{{ "John Doe" Auth-Type := Local, User-Password == "hello" Reply-Message = "Hello, %u" }}} Verifichiamo che non ci siano errori di battitura nel file di configurazione: {{{ system@meshboard:~$ sudo /etc/init.d/freeradius stop system@meshboard:~$ sudo freeradius -XXX -A }}} Se l'ultima riga contiene qualcosa di simile, vuol dire che tutto è andato a buon fine: {{{ Gio Gen 28 12:34:35 2010 : Info: Ready to process requests. }}} A questo punto rifacciamo partire il servizio freeradius e testiamo una richiesta di login in locale {{{ system@meshboard:~$ sudo /etc/init.d/freeradius start system@meshboard:~$ sudo radtest "John Doe" hello 127.0.0.1 0 radiussecret }}} Se non ci sono stati problemi dovreste leggere una roba del genere: {{{ Sending Access-Request of id 136 to 127.0.0.1 port 1812 User-Name = "John Doe" User-Password = "hello" NAS-IP-Address = 255.255.255.255 NAS-Port = 0 rad_recv: Access-Accept packet from host 127.0.0.1:1812, id=136, length=37 Reply-Message = "Hello, John Doe" }}}