Loading

Freeradius + MySQL (Step 1)

svg01/10/2022LinuxDenny

Based on Ubuntu 20.04 box with virtualmin installed, apache, php7.4

Install Freeradius

apt-get update
apt-get install freeradius freeradius-mysql freeradius-utils -y

Create FR database schema

mysql -uroot -pPasswordForRootSql
CREATE DATABASE radius;
exit

cd /etc/freeradius/3.0/mods-config/sql/main/mysql/
 
mysql -uroot -pYourMysqlPass radius < schema.sql
mysql -uroot -pYourMysqlpass radius < setup.sql

Set FR to using MySQL

cd /etc/freeradius/3.0/mods-enabled
ln -s ../mods-available/sql sql

Open “default” config using text editor

cd /etc/freeradius/3.0/sites-available/
vim default

Add sql on every category

authorize {
.....
sql
....
}
accounting {
......
sql
....
}
post-auth {
......
sql
....
}
session{
......
sql
.....}

Edit radius sql module’s config

cd /etc/freeradius/3.0/mods-available
vim sql

Modif following

driver = "rlm_sql_mysql"

dialect = "mysql"

 server = "localhost"
 port = 3306
 login = "root"
 password = "YOURMYSQLPASSWORD FROM STEP 4"
 radius_db = "radius"
read_clients = yes

Fill nas table from freeradius database with shortname (refer to ip address), shortname (server identify, ex. mikrotik), type (fill with other for mikrotik), secret (secret key), description (description).

Running FR debug mode

freeradius -X

Denny Kristna

Motobike & food lovers. Father of four. Workin' on some linux & mikrotik servers. Just simply, enjoyable journey.

svg

What do you think?

Show comments / Leave a comment

Leave a reply

svg
Quick Navigation
  • 01

    Freeradius + MySQL (Step 1)

Kosmo Dapatkan notifikasi untuk setiap update yang ada.
Dismiss
Allow Notifications