I. ການຕຕິດຕຕຕັ້ງ RADIUS SERVER ມມີ 3 ຢຢາງຄຄ Freeradius2 + Mysql + Daloradius

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 4

I.

RADIUS SERVER 3
Freeradius2 + Mysql + Daloradius

a) System services
#setup
-Atd
-Autofs
-Crond
-Httpd
-Mysqld
-Netfs
-Network
-Nfslock
-Snmpd
-Sshd
-Syslog

b) packet freeradius-1.1.3-1.2.el5 Internet


#cd /home
#mkdir radius
#cd radius
#tar zxvf freeradius-server-2.1.6.tar.gz
#cd freeradius-server-2.1.6
#./configure
#make
#make install
start radius
#radiusd -X
=========================================
==================
Listening on authentication address * port 1812
Listening on accounting address * port 1813
Listening on proxy address * port 1814
Ready to process requests.
=========================================
==================
ssh
radius test radius
radtest root 123456 localhost 1812 testing
# radtest root 123456 localhost 1812 testing
Sending Access-Request of id 138 to 127.0.0.1 port 1812
User-Name = "root"
User-Password = "123456"
NAS-IP-Address = 127.0.1.1
NAS-Port = 1812

rad_recv: Access-Accept packet from host 127.0.0.1 port 1812,


id=138, length=20
Access-Accept radius
radius
c) database
#mysqladmin -uroot -p create radius
Enterpassword:
password
#mysql
mysql>FLUSH PRIVILEGES;
mysql>GRANT ALL ON radius.* TO 'radius'@'localhost' IDENTIFIED
BY 'radpass';
mysql>quit
#mysql -uroot -p radius < /usr/local/etc/raddb/sql/mysql/schema.sql
#mysql -uroot -p
mysql>use radius;
nas
mysql>CREATE TABLE nas (id int(10) NOT NULL auto_increment,
nasname varchar(128) NOT NULL, shortname varchar(32), type
varchar(30) DEFAULT 'other', ports int(5), secret varchar(60)
DEFAULT 'secret' NOT NULL, community varchar(50), description
varchar(200) DEFAULT 'RADIUS Client', PRIMARY KEY (id), KEY
nasname (nasname));
usergroup
mysql>CREATE TABLE usergroup (
username varchar(64) NOT NULL default '',
groupname varchar(64) NOT NULL default '',
priority int(11) NOT NULL default '1',
KEY username (username(32))
);
mysql>quit
# mysql -uroot -p radius < /usr/local/etc/raddb/sql/mysql/ippool.sql
#vi /usr/local/etc/raddb/sql.conf
=========================================
=======================================
# Connection info:
server = "localhost"
login = "radius"
--> radius
password = "radpass"
--> radius
radius_db = "radius"
--> radius
readclients = yes
#vi /usr/local/etc/raddb/sites-enabled/default
set number
154 file # ( #file )

sql #
161
317 file # ( #file )
351 sql #
382 sql #
403 sql #
#vi /usr/local/etc/raddb/radiusd.conf
$INCLUDE sql.conf
#
#mysql -uroot -p
mysql> use radius;
mysql> INSERT INTO radcheck (UserName, Attribute, Value) VALUES
('sqltest', 'Password', 'testpwd');
mysql> FLUSH PRIVILEGES;
mysql> quit
stop radius
#radiusd stop
process
#ps -fe | grep -i radius
process
# killall -9 radiusd
#radiusd -X
=========================================
=========================
Listening on authentication address * port 1812
Listening on accounting address * port 1813
Listening on proxy address * port 1814
Ready to process requests.
=========================================
==================
Mysql
#radtest sqltest testpwd localhost 1812 testing123
Sending Access-Request of id 226 to 127.0.0.1 port 1812
User-Name = "sqltest"
User-Password = "testpwd"
NAS-IP-Address = 127.0.1.1
NAS-Port = 1812
rad_recv: Access-Accept packet from host 127.0.0.1 port 1812,
id=226, length=20
daloradius web Management
#cd /home/radius
#tar zxvf daloradius-0.9-8.tar.gz
#cp -R daloradius-0.9-8 /var/www
php
# rpm -ivh php-dba-5.1.6-20.el5.i386.rpm

# rpm -ivh php-gd-5.1.6-20.el5.i386.rpm


# rpm -ivh php-odbc-5.1.6-20.el5.i386.rpm
# rpm -ivh php-pear-1.4.9-4.el5.1.noarch.rpm
# pear install DB
#chown -R apache:apache /var/www/daloradius-0.9-8
#chmod 644 /var/www/daloradius-0.9-8/library/daloradius.conf.php
#mysql -u root -p radius </var/www/daloradius-0.98/contrib/db/mysql-daloradius.sql
#vi /var/www/daloradius-0.9-8/library/daloradius.conf.php
$configValues['FREERADIUS_VERSION'] = '2';
$configValues['CONFIG_DB_ENGINE'] = 'mysql';
$configValues['CONFIG_DB_HOST'] = 'localhost';
$configValues['CONFIG_DB_USER'] = 'radius'; --> radius
$configValues['CONFIG_DB_PASS'] = 'radpass'; --> radius
$configValues['CONFIG_DB_NAME'] = 'radius'; --> radius
#vi /etc/httpd/conf/httpd.conf
=========================================
=========================
Alias /myradius "/var/www/daloradius-0.9-8/"
<Directory /var/www/daloradius-0.9-8/>
Options None
order deny,allow
allow from all
</Directory>
=========================================
==========================
copy file DB var/www/daloradius-0.9-8
#/apachectl restart
http://yourip/myradius/
user : administrator
password : radius

You might also like