What's new

tutorial Install and Configure FreeRADIUS & daloRADIUS on Debian 9 with MySQL (PART 2)

ah nou nhy mou

Moderator
Staff member
Moderator
Established
Awards
2
  • SikatPInoy Staff
  • medal 1
Install and Configure FreeRADIUS & daloRADIUS on Debian 9 with MySQL (PART 2)
Install FreeRADIUS on Debian 9

Install FreeRADIUS and it’s dependencies:
1​
$ sudo apt install -y freeradius freeradius-utils freeradius-mysql
Enable FreeRADIUS so it runs after you restart the system:
1​
$ systemctl enable freeradius
For now stop FreeRADIUS so you can run it in debug mode and check if everything’s running correctly:
1​
$ systemctl stop freeradius
Next, run FreeRADIUS in debug mode:
1​
$ freeradius -X
If everything’s working OK, the output should be something like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19​
...
listen {
type = "acct"
ipv6addr = ::
port = 0
limit {
max_connections = 16
lifetime = 0
idle_timeout = 30
}
}
Listening on auth address 127.0.0.1 port 18120 bound to server inner-tunnel
Listening on auth address * port 1812 bound to server default
Listening on acct address * port 1813 bound to server default
Listening on auth address :: port 1812 bound to server default
Listening on acct address :: port 1813 bound to server default
Listening on proxy address * port 37669
Listening on proxy address :: port 58519
Ready to process requests
Log into the MySQL console as root:
1
2​
$ mysql -u root -p
Enter Password: S0me_Str0ng_Passw0rd
Create a database and user for RADIUS:
1
2
3
4​
create database radius;
grant all privileges on radius.* to [email protected] identified by '[email protected]';
flush privileges;
quit
Next, import the FreeRADIUS database schema that shipped with FreeRADIUS – it’s located at /etc/freeradius/3.0/mods-config/sql/main/mysql/schema.sql:
1
2​
$ mysql -u root -p radius < /etc/freeradius/3.0/mods-config/sql/main/mysql/schema.sql
Enter Password: S0me_Str0ng_Passw0rd
Enable the FreeRADIUS SQL module by creating a symbolic link to the sql module from /etc/freeradius/3.0/mods-available/ to mods-enabled:
1​
$ ln -s /etc/freeradius/3.0/mods-available/sql /etc/freeradius/3.0/mods-enabled/
Open /etc/freeradius/3.0/mods-available/sql with your favorite editor…
1​
$ nano /etc/freeradius/3.0/mods-available/sql
Change the following values, as well as uncommenting them by removing the # sign at the beginning of their lines:
1
2
3
4
5
6
7
8​
dialect = "mysql"

server = "localhost"
port = 3306
login = "radius"
password = "[email protected]"

radius_db = "radius"
Look for the line locating read_clients = yes. You’ll probably see that it starts with a # sign, which means that it’s commented out. Delete the # sign to enable FreeRADIUS to read clients from the database. It should look like this after you’re done:
1
2
3
4
5​
...
# Set to 'yes' to read radius clients from the database ('nas' table)
# Clients will ONLY be read on server startup.
read_clients = yes
...
Save and exit the file when you’re done.
Change the ownership and group for the SQL module to freerad with the following command:
1​
$ chown -h freerad.freerad /etc/freeradius/3.0/mods-enabled/sql
Restart FreeRADIUS:
1​
$ systemctl restart freeradius
Install daloRADIUS on Debian 9
daloRADIUS is an open-source, advanced RADIUS web control panel. It provides an easy interface for managing users, graphical reporting, accounting, a billing engine, and it integrates with Google Maps. Common uses for daloRADIUS are managing ISP deployments and hotspots.
Prerequisites
First, install some required PHP extensions:
1​
$ apt install php-mail php-mail-mime php-pear
Install the PHP Pear DB library:
1​
$ pear install DBRADIUS 3.jpg
 
Top