Sei sulla pagina 1di 2

Freeradius installation on Raspberry Pi (minor mods may be needed to install on

Ubuntu)
1) update System
sudo apt-get update
2)Install prerequisites
sudo apt-get -y install apache2 mc wget rcconf make gcc mysql-server mysql-client
libmysqlclient15-dev libperl-dev curl php5 php5-mysql php5-cli php5-curl php5mcrypt php5-gd php5-snmp php5-common php-pear php-db libapache2-mod-php5
php-mail
Enter a password for MySQL root <secretpassword>
3)Install freeradius with mysql support
sudo apt-get install freeradius freeradius-mysql freeradius-utils
4)Create mysql DB
mysql -u root -pclavesecreta
create database radius;
grant all on radius.* to radius@localhost identified by 'othersecretpassword';
flush privileges;
4)Check your privileges to access the sql directory and import DBs from FreeRadius
Template
mysql -u root -pclavesecreta radius < /etc/freeradius/sql/mysql/schema.sql
mysql -u root -pclavesecreta radius < /etc/freeradius/sql/mysql/nas.sql

Its possible that you will need chmod /etc/freeradius/sql/ first.


5) Create radius users, into MySQL, for testing purposes.
mysql -uroot -psecretpassword
use radius;
INSERT INTO radcheck ( id , UserName , Attribute , op , Value ) VALUES ( NULL ,
'test', 'user-password', '==', 'test');
INSERT INTO radreply (username, attribute, op, value) VALUES ('test', 'Mikrotik-RateLimit', '=', '1024k/1024k');
INSERT INTO radreply (username, attribute, op, value) VALUES ('test', 'Framed-IpAddress', '=', '10.0.0.91');
####

INSERT INTO `radcheck` (`id` ,`username` ,`attribute` ,`op` ,`value` )


VALUES (NULL , 'test', 'MD5-Password', ':=', MD5( 'test' ) ),
(NULL , 'test', 'Simultaneous-Use', ':=', '1');
####Expritation

INSERT INTO radcheck ( id , UserName , Attribute , op , Value ) VALUES (NULL ,


'test', 'Expiration', '=', '20 Jun 2017 15:00');
exit
6)Edit following file /etc/freeradius/sql.conf
sudo nano /etc/freeradius/sql.conf file
#Uncomment the line readclients
readclients = yes

#Write the correct information about your MySQL database server


server = "localhost"
login = "radius"
password = "secretpassword"
...
readclients = yes
7)
accounting
# See Authorization Queries in sql.conf
sql
session
# See Authorization Queries in sql.conf
sql
Post-Auth-Type
# See Authorization Queries in sql.conf
sql
8)
RADIUSD.CONF
Now edit /etc/freeradius/radiusd.conf file
nano /etc/freeradius/radiusd.conf
#Uncomment the following option
$INCLUDE sql.conf
Save and exit the file
9)/etc/freeradius/sites-available/default
Last but no least , edit /etc/freeradius/sites-available/default
nano /etc/freeradius/sites-available/default
Search for LINE
# See Authorization Queries in sql.conf
and UN-COMMENT the SQL word below it.
Example After modification
# See Authorization Queries in sql.conf
sql
Save and exit.
10)
ADDING NAS [Mikrotik] in CLIENTS.CONF
To accept connectivity of Mikrotik with the Freeradius, we need to add the mikrotik IP
and shared secret in clients.conf
Edit /etc/freeradius/clients.conf
nano /etc/freeradius/clients.conf
and add following lines at bottom
client 101.11.11.255 {
secret
= 12345
shortname
= Mikrotik
Note: Change the IP /Secret according to your Mikrotik Network Scheme.

Potrebbero piacerti anche