freeradius+mysql+ Switch Authentication

Source: Internet
Author: User
Tags freeradius

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.