Chinaunix首页 | 论坛 | 博客
  • 博客访问: 347530
  • 博文数量: 79
  • 博客积分: 3053
  • 博客等级: 中校
  • 技术积分: 861
  • 用 户 组: 普通用户
  • 注册时间: 2006-02-27 20:43
文章分类

全部博文(79)

文章存档

2012年(3)

2011年(21)

2010年(15)

2009年(40)

分类: LINUX

2012-01-04 16:01:30

[Radius]服务安装及测试

 

 

 

 

#local net
192.168.67.0/24

#install
1 tar xzvf freeradius-server-2.1.1.tar.gz
2 x86: cd freeradius-server-2.1.1 && ./configure && make && make install
3 x86_64: cd freeradius-server-2.1.1 && ./configure --enable-shared&& make && make install
#config
1 cd /usr/local/etc/raddb
2 vi clients.conf
client 192.168.67.0/24 {
secret = 67
shortname = 67.0/24
}
client 192.168.66.0/24 {
secret = 66
shortname = 66.0/24
}

#start service in debug mode
1 radiusd -X
If ok will receive "Ready to process requests."

#test
1 useradd test
2 echo "test" |passwd test --stdin
3 radtest test test 192.168.67.101 0 67
If ok will receive "rad_recv: Access-Accept"

 

测试配置sql身份验证方式
1 cd /usr/local/etc/raddb/site-available
2 vi default #use sql
authorize {
#unix #rem unix for test
sql #add this line
}
accounting {
sql #add this line
}
3 create radius database and tables #Info just for test use mysql auth
mysql -e "create database radius"
for i in `ls /tmp/freeradius-server-2.1.1/raddb/sql/mysql/*.sql`;do mysql radius < /tmp/freeradius-server-2.1.1/raddb/sql/mysql/$i;done
mysql radius -e "insert into radgroupreply (groupname,attribute,op,value) values ('user','Auth-Type',':=','Local')"
mysql radius -e "insert into radgroupreply (groupname,attribute,op,value) values('user','Service-Type',':=','Framed-Used')"
mysql radius -e "insert into radgroupreply (groupname,attribute,op,value) values('user','Framed-IP-Address',':=','255.255.255.254')"
mysql radius -e "insert into radgroupreply (groupname,attribute,op,value) values('user','Framed-IP-Netmask',':=','255.255.255.0')"
mysql radius -e "insert into radcheck (username,attribute,op,value) values('test','User-Password',':=','test')
mysql radius -e "insert into usergroup (username,groupname) values('test','user')"

4
同样使用radtest测试

阅读(2166) | 评论(0) | 转发(0) |
0

上一篇:sqlalchemy错误

下一篇:turbogears2.1控制器-1

给主人留下些什么吧!~~