Allow remote machine to connect Update user set host = '%' where user = 'root';

xiaoxiao2021-03-06  59

RADIUS server erected Freeradius mysql

RADIUS server erected Freeradius mysql

(Original author and unknown, please forgive!)

Some people actually say that Radius is going to sell, I spent a few days, I have seen some information, I finally set up the RADIUS server, and now I put it out and share it.

The platform used by the author is Redhat Linux 7.2

1. Install MySQL

I use the RPM package on the CD

RPM-IVH mysql-3.23.41.1.i386.rpm

Rpm -ivh mysql-wevel-3.23.41.1.i386.rpm

RPM-IVH mysql-server-3.23.41.1.i386.rpm

RPM-IVH mysqlclient9-3.23.22-6.i386.rpm

Launch MySQL service

Service MySQLD START

Change the mysql root password (Note: MySQL root and system root is 2 unused concepts)

MySQL -UROOT -P

Create a RADIUS database

Creat Database Radius;

Use mysql;

Update user set password = password ('Your Password') Where user = 'root';

Allow remote machine connections

Update user set host = '%' where user = 'root';

Exit and restart MySQL

quit

Service MySQLD Restart

2. Install OpenSSL

I also use the RPM package on the CD

RPM-IVH OpenSSL095A-0.9.5A-11.I386.RPM

RPM -IVH openssl096-0.9.6-6.i386.rpm

3. Install FreeRadius

Download freeeraidus from www.freeradius.org, this version is 0.8.1

Compilation and installation

TAR XVFZ FreeRadius.tar.gz

CD XVFZ FreeRadius-0.8.1

Note: If mysql is not installed in / usr / local / directory, you need to make a connection:

Ln -s / path / mysql / / usr / local / mysql

./configure

Make

Make Install

Establish a table of mysql database Radius

CD SRC / MODULES / RLM_SQL / DRIVERS / RLM_SQL_MYSQL

MySQL -UROOT -P password RADIUS

Change the settings of Freeradius

CD / USR / local / etc / raddb

Change radiusd.conf to support SQL (as mentioned below)

Authorize {

Preprocess

chap

MSCHAP

SUFFIX

SQL

}

Accouting {

.

SQL

...

}

Change SQL.conf

Server = "Localhost"

Login = "root"

Password = "password of mysql root"

RADIUS_DB = "Radius"

Change the NAS specific to the client.conf Support to see this document, pay attention to the SECRET is the shared password of the NAS and RADIUS servers.

Database Join Test Account

Join group

MySQL -UROOT -P password RADIUS

insert into radgroupreply (GroupName, Attribute, op, Value) values ​​( 'user', 'Auth-Type', ': =', 'Local'); insert into radgroupreply (GroupName, Attribute, op, value) values ​​( 'user ',' Service-type ',': = ',' framed-user ';

INSERT INTO RADGROUPLY (Groupname, Attribute, Op, Value) Values ​​('user', 'framed-ip-address ",': = ',' 255.255.255.254 ';

INSERT INTO RADGROUPLY (Groupname, Attribute, Op, Value) VALUES ('user', 'framed-ip-netmask', ': =', '255.255.255.0');

Join the test account

INSERT INTO RADCHECK (UserName, Attribute, Op, Value) Values ​​('Test', 'User-Password', ': =', 'Test');

Test account join group

INSERT INTO Usergroup (UserName, Groupname) Values ​​('Test', 'User');

4. Start the RADIUS service, test account

Start to Debug mode

RADIUSD -X

Sometimes I will report that I can't find the file RLM_SQL_MYSQL, just add the library file to the directory of the system search.

such as:

Cp / usr / local / lib / * / usr / lib

Test account

Radtest Test Test Localhost 0 Testing123

转载请注明原文地址:https://www.9cbs.com/read-118207.html

New Post(0)