Build a RADIUS server in Linux (2)

Source: Internet
Author: User
Tags stop script
Article Title: Building a RADIUS server in Linux (2 ). Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Author: He qijun
  
◆ String -- 0 ~ 253 bytes, string
  
◆ Ipaddress -- 32-bit, IP address
  
◆ Integer -- 32-bit, Integer
  
◆ Time -- 32-bit, from 00:00:00 GMT, January 1, 1970 to the current total number of seconds
  
The RADIUS protocol is an indefinite protocol stack.
  
  
Install RADIUS Server
  
  
To install a full set of IC-RADIUS, first we need several packages, as shown in table 9. Note: The Source Code packages in Table 9 are free of charge. They can help us build a complete RADIUS application environment.
  
  
Software source Package Description
Mysql-3.23.39.tar.gz MySQL Database System
DBI-1.18.tar.gz Perl universal interface for calling Databases
Msql-Mysql-modules-1.2216.tar.gz Perl DBI for MySQL Driver, that is, DBD for MySQL
RadiusPerl-1.05.tar.gz Perl Authen module for Radius
Icradius-0.18.1.tar.gz IC-RADIUS source package
  
  
  
Assume that all the original code packages are copied to the/usr/tmp directory.
  
Install MySQL
  
1. decompress the source code package:
  
Linux] # cd/usr/tmp
Linux] # gzip zxvf mysql-3.23.39.tar.gz
# Cd mysql-3.23.39
  
  
  
2. Configure parameters and install the software:
  
// Install mysql in/usr/local/mysql
Linux] #./configure prefix =/usr/local/mysql
Linux] # make // compilation, which takes a long time and requires patience
Linux] # make install // install to/usr/local/mysql
  
  
  
3. Create an initial database:
  
Linux] # cd/usr/local/msyql/bin
Linux] #./mysql_install_db
  
  
  
4. Create a Shared Library Link
  
Linux] # ldconfig // updates the System Shared Library Link
  
  
  
5. Copy the start/stop script:
  
Linux] # cp/usr/tmp/mysql-3.23.39/support-files/mysql. server/etc/rc. d/init. d/mysql. server
  
  
  
6. Copy and modify the initialization configuration file:
  
Linux] # cp/usr/tmp/mysql-3.23.39/support-files/my-medium.cnf/etc/my. cnf
  
  
  
Use vi to open my. cnf, add user = root under [client], and leave the password blank.
  
7. Change the root password:
  
Linux] # mysqladmin u root p password 'new password'
  
  
  
8. If multiple versions of mysql coexist
  
Add the following content to [mysqld] of/etc/my. cnf:
  
1. Log-bin
2. Server-id = 1 // must be unique to distinguish it from the id of another mysql. server.
  
  
  
Install DBI
  
Linux] # cd/usr/tmp
Linux] # tar zxvf DBI-1.18.tar.gz
# Cd DBI-1.18
Linux] # perl Makefile. PL
Linux] # make test
// If the test fails, use make test TEST_VERBOSE = 1
Linux] # make install
  
  
  
Install DBD for MySQL
  
Linux] # cd/usr/tmp
Linux] # tar zxvf Msql-Mysql-modules-1.2216.tar.gz
# Cd Msql-Mysql-modules-1.2216
Linux] # perl Makefile. PL
  
  
  
At this time, the system starts to interact with the user as follows:
  
MySQL only
MSQL only (either of mSQL 1 or mSQL 2)
MySQL and mSQL (either of mSQL 1 or mSQL 2)
MSQL 1 and mSQL 2
MySQL, mSQL1andmSQL2
Enter the appropriate number: [3] 1
  
  
  
In our requirements, we should answer 1 (indicating that this module is for MySQL and mSQL at the same time)
  
Do you want to install the MysqlPerl emulation? You might keep your old Mysql module (to be distinguished from DBD: mysql !) If you are concerned
  
About compatibility to existing applications! [N] n answer n here
  
Where is your MySQL installed? Please tell me the directory that
  
Contains the subdir 'include '. [/usr/local/mysql]?
  
This is the default mysql installation directory. We have installed it as above. MySQL is automatically installed under this directory. Press enter here.
  
Which database shocould I use for testing the MySQL drivers? [Test]
  
Press enter.
  
On which host is database test running (hostname, ip address
  
Or host: port) [localhost]?
  
If the mysql server and icradius server are installed on the same server, press Enter.
  
User name for connecting to database test? [Undef] root?
  
Root Password for connecting to database test? [Undef] passwd?
  
Enter the password of the root user of mysql.
  
Make
Make test
Make install
  
  
  
Install the RadiusPerl: Authen Module
  
Linux] # cd/usr/tmp
Linux] # tar zxvf RadiusPerl-0.05.tar.gz
# Cd RadiusPerl-0.05
Linux] # perl Makefile. PL
Linux] # make
Linux] # make test
Linux] # make install
  
  
  
Install IC-RADIUS
  
1. Install software:
  
Linux] # cd/usr/tmp
Linux] # tar zxvf icradius-0.18.1.tar.gz
# Cd icradius-0.18.1
Linux] # cp Makefile. lnx Makefile
Linux] # make
Linux] # make install
  
  
  
2. Create a radius database:
  
Linux] # cd scripts
Linux] # mysql u root p mysql
Mysql> create database radius; // create a radius database
// Add a radius user
Mysql> grant all on radius. * on radius @ localhost identified by 'radius ';
Linux] # mysqladmin u root p refresh // refresh the database content
  
  
  
3. import data tables:
  
Linux] # mysql-u root-pyourpassword radius <radius. db
Modify dictimport. pl and set
My $ dbusername = 'radius ';
My $ dbpassword = 'radius'
  
  
  
Then, import the dictionary content so that the radius. dictionary data table contains basic attributes and values.
  
Linux] #./dictimport. pl ../raddb/dictionary
  
  
  
The Radius database structure is shown in table 10.
  
  
Radius Database
Dictionary radgroupcheck
Hints radgroupreply
Nas radreply
Radacct realmgroup
Radact_summary realms
Radcheck usergroup
  
  
  
4. Start radiusd
  
Linux] # cd/etc/rc. d/init. d
Linux] # radiusd start
  
  
  
In this way, we have successfully installed a complete RADIUS server on Linux. you can experience the running of the RADIUS server. If you are still interested in the development of the RADIUS protocol, you can perform in-depth research on this basis.
  
(Edit Sunny)
  
Related Article

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.