FreeRADIUS_安装

1、安装
Installing:
freeradius i386 1.0.1-3.RHEL4.5 base 1.2 M
Installing for dependencies:
libtool-libs i386 1.5.6-5.el4_8 update 23 k
lm_sensors i386 2.8.7-2.40.5 base 426 k
net-snmp i386 5.1.2-18.el4 base 508 k
net-snmp-utils i386 5.1.2-18.el4 base 160 k
Updating for dependencies:
net-snmp-libs i386 5.1.2-18.el4 base 1.8 M

mysql
freeradius-mysql

2、mysql
建立mysql的數據庫raius的表
MySQL root 登入
mysql -uroot -p密碼

建立 radius 資料庫
create database radius;

quit


mysql -uroot -p密碼 radius < cd /usr/share/doc/freeradius-1.1.3/examples/mysql.sql

mysql -uroot -p密碼
use radius
insert into radcheck (username,attribute,op,value) values ('test','User-Password',':=','123456');


quit
service radiusd start


3、 設定 RADIUS
更改freeradius的設置
cd /etc/raddb
備份原始設定檔

程式碼:
cp /etc/raddb/radiusd.conf /etc/raddb/radiusd.conf-def
cp /etc/raddb/clients.conf /etc/raddb/clients.conf-def
cp /etc/raddb/sql.conf /etc/raddb/sql.conf-def
cp /etc/raddb/eap.conf /etc/raddb/eap.conf-def
cp /etc/raddb/users /etc/raddb/users-def


更改 radiusd.conf 部份設定 如下列
authorize {
preprocess

auth_log

attr_filter

chap

mschap

suffix

eap

files

sql #去掉注释

}


1248行去掉注释
$INCLUDE ${confdir}/sql.conf


在 clients.conf 增加下列設定

程式碼:
client 192.168.1.1 {
secret = testing123
shortname = test
}

更改 sql.conf 部份設定如下列

程式碼:
sql {

driver = "rlm_sql_mysql"

server = "localhost" # MySQL 主機位置
login = "radius" # MySQL 帳號
password = "radius" # MySQL 密碼

radius_db = "radius" # MySQL 資料庫名稱



更改 users 如下列
在第96行增加

程式碼:
"testf" Auth-Type := Local, User-Password == "testf"
Reply-Message = "Hello, %u"

註解 第 154 ,155 行
#DEFAULT Auth-Type = System
# Fall-Through = 1
測試 flies 認證
radtest testf testf localhost 0 testing123

測試 MySQL 認證
radtest test 123456 localhost 0 testing123

相关文档
最新文档