RADIUS installation and configuration guide

Source: Internet
Author: User
1FreeRadius1. 1 installation environment RHELAS4 prepare the installation package MySQL in idea? After xzvfxxxx.tar.gz enters the path of the unlocked source code 1 FreeRadius 1.1 Installation

Environment

RHEL AS4

Prepare the installation package

MySQL in http: // dev.Mysql. Com/Download

FreeRadius in http://www.freeradius.org/Download

Install

If the source file package is unlocked, configured, compiled, and then installed

Steps:

Tar? Xzvf xxxx.tar.gz

Go to the path of the unlocked source code:

./Configure

Make

Make install

If it is an rpm package, it is more convenient to directly enter:

Rpm? Ivh xxxx. rpm // The package name is later

Start

Start MySQL: service mysql start

Start FreeRadius: radiusd // the following parameter-x indicates that FreeRadius is started in debug mode.

Troubleshooting:

Some files or libraries (such as openssl097, libstdc ++-33-3.2.3, libmysql14-4.1.12, libfreeradius1-1.0.4) may be missing during installation and can be searched and downloaded from the Internet.

If the required package does not work after installation, you can find the file and create a symbol to connect to the/usr/lib directory, or copy it directly.

For example, the installation prompt "libssl. so.0.9.7 cannot be found" can be processed as follows,

Locate libssl. so.0.9.7 // Search. if you cannot find it, run the updatedb command first.

// The system displays the search result.

Ln? S/path1/xxxx/usr/lib/xxxx

// Or cp/path1/xxxx/usr/lib/xxxx

(You can also add the path of the class library to the system search directory to open/etc/ld. so. conf, create a new row, add the path, and then run ldconfig. However, it is often invalid .)

1.2 Configuration

Configure FreeRadius

After installation, the configuration files are generally stored in the/usr/local/etc/raddb directory.

Modify the clients. conf file:

Client 127.0.0.1 {// IP

Secret = test // public key

Shortname = localhost

Nastype = other

}

Modify the users. conf file:

Add user

Ljy User-Password: = "ljy"

Service-Type = Framed-User,

Framed-Protocol = PPP,

Framed-IP-Address = 192.168.20.128,

Framed-IP-Netmask = 255.255.255.0,

Restart radiusd and enter the test command.

Radtest ljy localhost 0 test

If the message "Access-Accept" is displayed, the operation is successful:

Sending Access-Request of id 172 to 127.0.0.1 port 1812

User-Name = "ljy"

User-Password = "ljy"

NAS-IP-Address = 127.0.0.1

NAS-Port = 0

Rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id = 172, length = 50

Service-Type = Framed-User

Framed-Protocol = PPP

Framed-IP-Address = 192.168.20.128

Framed-IP-Netmask = 255.255.255.0

Configure radiusFrom MySQLAccess data

Configure MySQL first

Create database radius

Import table structure

Mysql-u root-p radius <mysql. SQL // after installation, there will be a data structure file // usr/local/share/doc/freeradius/examples/mysql. SQL

Insert data

// Group information

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 radgroupreply (groupname, attribute, op, value) values ('user', 'framed-IP-netmask', '=', '2017. 255.255.255 ');

Insert into radgroupcheck (groupname, attribute, op, value) values ("user", "Auth-Type", ": =", "Local ");

// User information

Insert into radcheck (username, attribute, op, value) values ('pal ', 'user-password',' = ', 'pal ');

// Add the user to the group

Insert into usergroup (username, groupname) values ('pal ', 'User ');

Configure FreeRadius to support MySQL authentication

Modify the radius. conf file

Authorize {

Preprocess

Chap

Mschap

Suffix

SQL

...

}

Accounting {

...

SQL

...

}

Modify the SQL. conf file

SQL {

Driver = "rlm_ SQL _mysql"

Server = "localhost"

Login = "root"

Password = "mysql password"

Radius_db = "radius"

}

Restart radiusd and enter the test command.

Radtest pal localhost 0 test

If the message "Access-Accept" is displayed, the operation is successful.

Now that the basic configuration is complete, the radius will work properly.

If there is any fault, you can view the log file, usually in the/usr/local/var/log/directory.

1.3 Advanced Configuration

Allow external NASAccess

Modify clients. conf, add its IP address, and modify attributes as needed.

Custom attributes

Go to/usr/local/share/freeradius

Create a dictionary file that contains personalized attributes, such as dictionary. pal:

Vendor pal 88

BEGIN-VENDOR PAL

Attribute pal-Menu 200 string

END-VENDOR PAL

Add it to the dictionary file:

$ INCLUDE dictionary. pal

Restart radiusd.

This Attribute can be used in the radreply or radgroupreply table. for the Attribute field, enter the Attribute name directly. Because a number is returned, it must be resolved by the radius client.

HintsFile

Prompt the server to provide the specified service for the user name created according to the specific method

Login prohibited

Modify the users file

Temp Auth-Type: = Reject

Reply-Message = "Account disabled for nonpayment ."

Suspend user group

Modify the users file

DEFAULT Group = "suincluded", Auth-Type: = Reject

Reply-Message = "Account suincluded for late payment ."

Concurrent logon restrictions

Test Auth-Type: = System, Simultaneous-Use: = 1

Service-Type = Framed User

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.