架设Radius服务器 802.1X口令服务器

架设Radius服务器 802.1X口令服务器
2004-03-24          阅读: 2854

  笔者用的平台是RedHat Linux 7.2
http://anheng.com.cn/news/25/221.html

http://anheng.com.cn/news/25/221.html
  1. 安装mysql
http://anheng.com.cn/news/25/221.html
  本人用的是光盘上的RPM包
  rpm -ivh mysql-3.23.41.1.i386.rpm
  rpm -ivh mysql-devel-3.23.41.1.i386.rpm
  rpm -ivh mysql-server-3.23.41.1.i386.rpm
  rpm -ivh mysqlclient9-3.23.22-6.i386.rpm
http://anheng.com.cn/news/25/221.html
  启动mysql服务
  service mysqld start
http://anheng.com.cn/news/25/221.html
  更改mysql的root密码(注意:mysql的root 和系统的root是2个不用的概念)
  mysql -uroot -p
http://anheng.com.cn/news/25/221.html
  创建radius数据库
  creat database radius;
  use mysql;
  update user set password=password('你的密码') where user='root';
http://anheng.com.cn/news/25/221.html
  允许远程机器连接
  update user set host='%' where user='root';
http://anheng.com.cn/news/25/221.html
  退出及重新启动mysql
  quit
  service mysqld restart
http://anheng.com.cn/news/25/221.html
  2. 安装openSSL
http://anheng.com.cn/news/25/221.html
  本人也是用的光盘上的RPM包
  rpm -ivh openssl095a-0.9.5a-11.i386.rpm
  rpm -ivh openssl096-0.9.6-6.i386.rpm
http://anheng.com.cn/news/25/221.html
  3. 安装freeradius
http://anheng.com.cn/news/25/221.html
  从www.freeradius.org上下载freeraidus,本文版本是0.8.1
  编译和安装
  tar xvfz freeradius.tar.gz
  cd xvfz freeradius-0.8.1
http://anheng.com.cn/news/25/221.html
注: 如果mysql不是安装在/usr/local/目录下需要做个连接:
ln -s /PATH/mysql/ /usr/local/mysql
http://anheng.com.cn/news/25/221.html
  ./configure
  make
  make install
http://anheng.com.cn/news/25/221.html
  建立mysql的数据库radius的表
  cd src/modules/rlm_sql/drivers/rlm_sql_mysql
  mysql -uroot -p密码 radius < db_mysql.sql
http://anheng.com.cn/news/25/221.html
  更改freeradius的设置
  cd /usr/local/etc/raddb
  更改radiusd.conf,让其支持sql (如下面所说)
http://anheng.com.cn/news/25/221.html
  authorize {
  preprocess
  chap
  mschap
  suffix
  sql
  }
  accouting {
  ….
  sql
  …
  }
http://anheng.com.cn/news/25/221.html
  更改sql.conf
  server="localhost"
  login="root"
  password="mysql的root的密码"
  radius_db="radius"
http://anheng.com.cn/news/25/221.html
  更改 client.conf支持所用的NAS具体可以看该文档,要注意的是secret是NAS和radius服务器的共享密码
数据库加入测试账号
http://anheng.com.cn/news/25/221.html
  加入组
http://anheng.com.cn/news/25/221.html
  mysql -uroot -p密码 radius
http://anheng.com.cn/news/25/221.html
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-Address',':=','255.255.255.254');
insert into radgroupreply (GroupName,Attribute,op,value) values ('user','Framed-IP-Netmask',':=','255.255.255.0');
http://anheng.com.cn/news/25/221.html
  加入测试账号
insert into radcheck (UserName,Attribute,op,Value) values ('test','User-Password',':=','test');
http://anheng.com.cn/news/25/221.html
  测试账号加入组
insert into usergroup (UserName,GroupName) values ('test','user');
http://anheng.com.cn/news/25/221.html
  4. 启动radius服务、测试账号
http://anheng.com.cn/news/25/221.html
  启动到debug模式
http://anheng.com.cn/news/25/221.html
  radiusd -X
http://anheng.com.cn/news/25/221.html
  有时候会报找不到文件rlm_sql_mysql这个时候只要把库文件加入系统搜索的目录里
http://anheng.com.cn/news/25/221.html
  比如:
http://anheng.com.cn/news/25/221.html
  cp /usr/local/lib/* /usr/lib
http://anheng.com.cn/news/25/221.html
  测试账号
http://anheng.com.cn/news/25/221.html
  radtest test teset localhost 0 testing123
http://anheng.com.cn/news/25/221.html
  如果能看到radius的应答,恭喜服务器设置成功了。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值