« Configuring a Rendezvous Point(RP)基本PPP接口地址协商 »

FreeRadius+Mysql做cisco路由器登入认证(基本配置)

拓扑:

 

用FreeRadius+Mysql做cisco路由器登入认证,使客户端允许Telnet到NAS,NAS使用Radius认证

Radius Server配置:

1.首先是在Linux上安装Freeradius和Mysql server

2.在Mysql中添加radius数据库:

# mysql -uroot radius < /usr/share/doc/freeradius-1.0.1/db_mysql.sql 
//这个是freeradius用的Mysql模板,如果是Ubantu,则这个模板在/usr/share/doc/freeradius/mysql.sql.gz中,如果找不到,点这里下载

3.在数据库中添加认证用户信息:

#mysql -ppassword radius
>Insert into radcheck (username,attribute,op,value) values ('test','User-Password','==','123456');
//这里test为用户名,123456为用户密码
 

FreeRadius配置
1.配置/etc/raddb/radiusd.conf,在Ubantu中,为/etc/freeradius/radiusd.conf,这个文件是Freeradius主文件

authorize {       
          Preprocess /*预处理模块
#        Chap                                            /*chap认证处理模块
#        Mschap                                        /*mschap认证处理模块
          Sql                                               /*读取数据库中的用户进行认证
}

用#号注释掉其他授权方式,只留下预处理模块和SQL数据库认证方式

2.配置/etc/raddb/clients.conf,在Ubantu中,为/etc/freeradius/clients.conf,配置NAS信息

client 192.168.111.2 {                               /*也可以是192.168.111.0/24配置一个网段
  secret      = cisco                                     /*NAS与Freeradius之间通讯的密钥。
  shortname       = localhost                       /*NAS名称,可以随便取
  nastype     = cisco                                    /*NAS类型,各种类型,在clients.conf文件里有描述
}
 

3.配置/etc/raddb/sql.conf,在Ubantu中,为/etc/freeradius/sql.conf,配置SQL认证

sql {
server="localhost"                                           /*数据库服务器地址 
login="root"                                                     /*连接数据库使用的用户名
password="bbb"                                              /*连接数据库的密码
radius_db="radius"                                         /*数据库名称
}
 

 NAS配置:

aaa new-model
aaa authentication login default group radius local          /*对login启用radius认证
aaa authentication login radnon none                              /*在console端不进行认证,防止自己被锁在外面
radius-server host 192.168.111.1

line con 0
 login authentication radnon
line vty 0 15
 login authentication default
 

DEBUG:在进行认证的时候,可以在shell下开启Freeradius的DEBUG模式,查看认证过程

# radiusd –xx (-xx表示启动debug模式)      在Ubantu中,为freeradius -X

 

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Tags

Powered By Z-Blog 1.8 Spirit Build 80722

Copyright 2007-2008 John Winning's Blog. All Rights Reserved.