One, close firewall and SELinux
[[Email protected] raddb]# service iptables stop
[Email protected] raddb]# Vim/etc/selinux/config
Selinux=disabled
Second, installation Freedius
[[email protected] RADDB] #yum install freeradius*-y
Third, need to install MySQL
(1) CREATE DATABASE: creat db radius;
(2) Landing mysql,use radius
Import Two tables:
Mysql> Source/etc/raddb/sql/mysql/schema.sql
Mysql> Source/etc/raddb/sql/mysql/nas.sql
(3) Enable SQL authentication
[Email protected] sites-enabled]# Vim/etc/raddb/sites-enabled/default
Remove the # in front of SQL in authorize{}, accounting {}, and add the files in the authorize{} to the previous #;
(4) Modify the configuration file connected to the MySQL database
[Email protected] raddb]# vim/etc/raddb/sql.conf
Database = "MySQL"
#
# which Freeradius driver to use.
#
Driver = "Rlm_sql_${database}"
# Connection Info:
Server = "localhost"
#port = 3306
Login = "root"
Password = "111111"
# Database table configuration for everything except Oracle
radius_db = "radius"
(5) Modifying client configuration information
Client 127.0.0.1 {
Secret = testing123
ShortName = localhost
Nastype = Other
}
Client 192.168.11.254 {
# # Secret and password are mapped through the "Secrets" file.
Secret = testing123
ShortName = Liv1
# # The following three fields is optional, but may is used by
# # checkrad.pl for simultaneous usage checks
Nastype = Livingston
Login = xxxxxxx
Password = xxxxxxx
}
(6) Modifying RADIUS configuration files
/usr/local/etc/raddb/radiusd.conf
Modules {}
Be sure to uncomment this line: $INCLUDE sql.conf
(7) Re-running Radiusd-x will have the following problems. Yum-y Install Mysql-devel
Iv. Database Operations
mysql> use RADIUS;
mysql> INSERT INTO radgroupreply (groupname,attribute,op,value) VALUES (' User ', ' auth-type ', ': = ', ' Local ');
mysql> INSERT INTO radgroupreply (groupname,attribute,op,value) VALUES (' User ', ' service-type ', ': = ', ' Framed-user ') ;
Create User information:
mysql> INSERT INTO Radcheck (username,attribute,op,value) VALUES (' xxxxx ', ' User-password ', ': = ', ' xxxxxxx ');
mysql> INSERT INTO Radusergroup (username,groupname) VALUES (' xxxx ', ' user ');
Five, start testing
#radiusd-X
Pkill RADIUSD
To re-open a shell terminal to execute the following command
#radtest test test localhost 0 testing123
Six, switch configuration:
RADIUS scheme xxxx
Server-type Extended
Primary authentication 192.168.11.34
Domain xxxxx
Authentication login Radius-scheme xxxxxx
Access-limit Disable
State Active
Idle-cut Disable
Self-service-url Disable
Domain default enable xxxxxxx
This article from "Bobcat" blog, declined reprint!
freeradius+mysql+ Switch Authentication