- Create MySQL/ Postgresql Database and user
- import FreeRadius database schema in
/usr/local/etc/raddb/mods-config/sql/main/mysql/schema.sql
/usr/local/etc/raddb/mods-config/sql/main/postgresql/schema.sql - edit sql configuration file and fill in database details
/usr/local/etc/raddb/mods-enabled/sql
server = "hostname-here"
port = 3306
login = "database-login-here"
password = "password-here"
radius_db = "database-name-here" - if more than one database (for different application), copy the whole section, add an instance name and change the database details:
sql {
to
sql instance1 { - copy "default" configuration file to "virtual1" (or any name)
- Edit "virtual1" file. and make the following changes
- Change the virtual site name:
server default {
to
server virtual1 { - Change the port number
port = 55555 - enable sql,
find the following line
# sql
and change to
instance1
"instance1" is the sql instance name added in step 4
- Change the virtual site name:
- Add a client for this virtual host
/usr/local/etc/raddb/clients.conf
client your-device {
ipaddr = 192.168.0.0/24
secret = secretPhrase
virtual_server = virtual1
}
your-device is profile name
ipaddr is IP address (or IP address range) for your device(s). If more than 1, need to use "|" to separate
secret is the passphrase to use the radius service
virtual_server is the virtual site name used in step 5.
- add user into the database
insert into radusergroup (username, groupname, priority) VALUES ('username','groupname', 1);
insert into radcheck (username, attribute, op, value) VALUES ('username', 'Cleartext-Password', ':=', 'password');
{{code}}
9. Restart radiusd