




已阅读5页,还剩86页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Radius 2.0说明文档1前言32RADIUS的安装32.1Solaris版的安装32.1.1运行环境32.1.2环境设置32.1.3安装第三方软件32.1.4安装RADIUS42.2Linux版的安装52.2.1运行环境52.2.2环境设置52.2.3安装第三方软件52.2.4安装RADIUS63运行RADIUS63.1Radius相关文件所在位置63.2配置radius参数73.3RADIUS命令73.3.1RADIUS主程序73.3.2RADIUS辅助程序73.4启动RADIUS83.4.1手工启动83.4.2自动启动84参数设置94.1参数文件定义94.1.1dictionary,dictionary.*94.1.2radiusd.conf104.1.3users164.1.4clients.conf174.1.5mailclients.conf184.1.6ldap.attrmap184.1.7myattr.conf194.1.8sql.conf204.1.9proxy.conf214.1.10profiles.xml234.1.11nas.attrmap234.1.12holidayyear.xml244.1.13宁夏宽窄合一的配置文件244.1.14acct_users264.1.15naslist,naspasswd264.1.16hints274.1.17snmp.conf284.1.18huntgroups284.1.19attrs295参数设置实例305.1radiusd端口305.2关于重新读入配置文件305.3设置用LDAP存储信息的认证305.3.1openldap的配置305.3.2Netscape ldap的配置305.3.3users305.3.4radiusd.conf315.3.5ldap.attrmap325.3.6myattr.conf325.3.7radius属性在LDAP中的设置方法335.3.8LDAP的schema文件335.4关于用户并发数的控制375.4.1users375.4.2radiusd.conf385.5设置detail385.5.1radiusd.conf385.6卡用户认证395.6.1Radiusd.conf395.6.2sql.conf405.6.3users405.7Mail Server配置405.8设置Session_Timeout,Ingress-Policy-Name,Egress-Policy- Name415.9用户服务选择415.10漫游(proxy)设置425.10.1一级代理的设置425.10.2多级代理的设置445.11设置PAP的认证方式455.11.1radiusd.conf455.11.2users455.12设置用SQL存储信息的认证465.13设置CHAP的认证方式465.14线程池的设置465.15设置PAM(Pluggable Authentication Module)的认证方式465.15.1只认证unix用户的设置465.15.2认证任何用户的设置476附录476.1参考资料471 前言RADIUS(Remote Authentication Dial In User Service)是一种基于Client/Server拨号的认证协议,遵循RFC标准,它通过授权认证来提供安全服务。RADIUS服务器提供三个基本功能:authentication(认证),authorization(授权),accounting(计帐)。很多NAS(Network Access Server)厂商(如Cisco,Unisphere,ACS,HuaWei等)的产品都支持RADIUS协议,可作为RADIUS的客户端。2 RADIUS的安装RADIUS可运行的操作系统:linux和solaris操作系统。2.1 Solaris版的安装2.1.1 运行环境Solaris操作系统。2.1.2 环境设置建一个普通用户(bsh):radius 路径:/home/radius注意 若radius为双机并行运行,那么,建radius帐户时,radius1,radius2上的radius帐户应为同组,同id。2.1.3 安装第三方软件 安装LDAP软件LDAP软件可选择以下的一种方式安装。若RADIUS和LDAP不在同一台机器上,可在RADIUS主机上选择安装LDAPSDK。 LDAP软件OpenLdap:(1)安装openssl-0.9.6a (openssl-0.9.6a.tar.gz)()#./config#make#make test#make install(2)install db-3.1.17 (Berkerley-db-3.1.17.tar)#cd db-3.1.17/build_unix#./dist/configure #make#make install(2)gdbm-1.8.0.tar.gz(GNU)(gdbm-1.8.0.tar.gz)#./configure prefix=/usr/local#make prefix=/usr/local#make preix=/usr/local install(4)install openldap2.0.11 (openldap2.0.11.tar.gz) () #./configure -with-wrappers#make depend#make#make test#make installNetscape Ldap: LdapSDK(原代码级安装时需要)Ldapsdk:ldapcsdk50-SunOS51.8_64_OPT.zipcopy ldapsdk50/lib/* to /usr/local/lib/copy ldapsdk50/include/*.h to /usr/include/ 安装关系数据库软件(A) 关系数据库软件:Mysql:#./configure#make#make install2.1.4 安装RADIUS 原代码级%cp radius.tar.gz /home/radius/%gzip -d radius.tar.gz%tar xvf radius.tar%su -#cd /home/radius/radius/#./configure -with-snmp=no -enable-ltdl-install -prefix=/opt/radius#make#make install 目标码级radius安装文件:radius.tar.gz安装:%cp radius.tar.gz /home/radius/%gzip -d radius.tar.gz%su #cd /home/radius/#./installRadius2.2 Linux版的安装2.2.1 运行环境RedHat Linux7.1操作系统(核心版本:2.4.2-2)(Red Hat Linux release 7.1 (Seawolf) Kernel 2.4.2-2 on an i686)2.2.2 环境设置建一个普通用户(bsh):radius ,组:radius路径:/home/radius2.2.3 安装第三方软件 安装LDAP软件LDAP软件可选择以下的一种方式安装。若RADIUS和LDAP不在同一台机器上,可在RADIUS主机上选择安装LDAPSDK。 LDAP软件OpenLdap:Netscape Ldap: Ldap sdk(原代码级安装时需要)Ldapsdk: ldapcsdk50-Linux21.2_x86_glibc_PTH_OPT.zipcopy ldapsdk50/lib/* to /usr/local/lib/copy ldapsdk50/include/*.h to /usr/include/ 安装关系数据库软件(A) 关系数据库软件:Mysql:#./configure#make#make install2.2.4 安装RADIUS 拷贝radius.tar.gz到/home/radius#cp radius.tar.gz /home/radius#gzip -d radius.tar.gz#tar xvf radius.tar 原代码级#cd /home/radius/radius#./configure -with-snmp=no -enable-ltdl-install -prefix=/opt/radius#make#su -#make install 目标码级#su #make install3 运行RADIUS3.1 Radius相关文件所在位置/opt/radius/sbin/:radiusd等/opt/radius/bin/:radclient ,radtest, radwho,radzap等/opt/radius/etc/raddb:radiusd.conf,users,sql.conf,clients.conf,myattr.conf,proxy.conf,profiles.xml,nas.attrmap等配置文件/opt/radius/var/log/radius/radius.log: 日志文件/opt/radius/var/log/radius/radacct:radiusd.label 保存当前detail文件序号的cursorcommon/ :存放普通用户的detail文件card/ :存放卡用户的detail文件proxy/ :存放漫游用户的detail文件(包括漫游入和漫游出)/opt/radius/lib: rlm_* :radius所有的动态库3.2 配置radius参数/etc/hosts/opt/radius/etc/raddb参考参数设置一节3.3 RADIUS命令3.3.1 RADIUS主程序RADIUS主程序:/opt/radius/sbin/radiusd%man radiusdradiusd说明%radiusd hradiusd的执行帮助 -a acct_dir use accounting directory acct_dir. (没用,从radiusd.conf文件里读,若文件里没有, 则用缺省值:/opt/radius/var/radacct) -A Log auth detail.(没用) -d db_dir Use database directory db_dir. -f Run as a foreground process, not a daemon. -h Print this help message. -i address Listen only in the given IP address. -l log_dir Log messages to log_dir. Special values are: stdout = log all messages to standard output. syslog = log all messages to the system logger. -p port Bind to port, and not to the radius/udp, or 1646/udp. -s Do not spawn child processes to handle requests. -S Log stripped names. -v Print server version information. -X Turn on full debugging. (Means: -sfxxyz -l stdout) -x Turn on partial debugging. (-xx gives more debugging). -y Log authentication failures, with password. -z Log authentication successes, with password. 3.3.2 RADIUS辅助程序辅助程序在/opt/radius/bin下:radwho读mysql用户在线表,获取所有在线户。如:查所有在线用户:%radwhoUsage: radwho -lhfnsipcr -l: show local (shell) users too -h: hide shell users from radius -f: give fingerd output -n: no full name -s: show full name -i: show session ID -p: show port type -c: show Calling-Station-Id, if available -r: output as raw data -C: show card user -O: show common user -U username :only show the record where login=username -P phonenumber :only show record where calling-station- id= phonenumber -N nasip :only show record where nas_address=nasip -F frameip :only show record where frame_address=frameip -S servicecode :only show record where service_code=servicecoderadclientradius的client端模拟程序。如:%radclient f data sun250:1645 auth secretdata:(要发送的属性文件)User-Name = radtestPassword = 123456radzap删除radius的在线用户信息,控制用户并发数时使用。如:%radzap localhost -1 user0001当某用户被挂死时,用它通知radiusd将所有通过该NAS登录的该在线用户从mysql中删除,以防止用户不能再登录。注意radzap通过向radiusd发包实现清除用户,它发送给radiusd的acct端口使用/etc/services里的radius-acctradtestshell程序,生成radius客户端的测试数据,调用radclient。3.4 启动RADIUS3.4.1 手工启动*radiusd多线程不安全,请运行在单线程状态下:#./radiusd -s -p1812or(debug状态)# ./radiusd -f -d./etc/raddb -s -p1812 -X 3.4.2 自动启动radius自动启动/关闭的脚本文件启动:#cd /etc/rc3.d#vi S99radius/opt/radius/sbin/radiusd s p1812chmod 644 S99radius注文件开头要为大写的S,跟数字关闭:(可选)#cd /etc/rc0.d#vi K99radius#chmod 644 K99radius注文件开头要为大写的K,跟数字4 参数设置所有的RADIUS参数文件缺省时均在/opt/radius/etc/raddb目录下。参数文件中的参数控制RADIUS运行在不同的状态,实现不同的功能以及运行的效率等。首先要将所有的NAS,mailserver和要连接的数据库(ldap,mysql)所在的主机加入到/etc/hosts文件。4.1 参数文件定义4.1.1 dictionary,dictionary.*dictionary,dictionary.*:说明:dictionary为通用属性字典表,dictionary.*为某NAS厂商特有的属性字典表。格式:$INCLUDE extend-attribute-fileNameVENDOR vendor-Name vendor-codeATTRIBUTE attribute-name attribute-code attribute-type vendor-NameVALUE attribute-name attribute-value attribute-value-code含义:$INCLUDE extend-attribute-fileName 包括扩展属性字典表(可选)VENDOR vendor-Name vendor-codeNAS厂商名,代号ATTRIBUTE attribute-name attribute-code attribute-type vendor-Name属性定义:属性名,属性代号,属性类型,厂商名VALUE attribute-name attribute-value attribute-value-code属性值定义:属性名,属性值,属性值代号说明:属性类型取以下几种:string,integer,date,ipaddr例子:$INCLUDE pat # compability issues$INCLUDE dictionary.unisphere #unisphere$INCLUDE dictionary.onewave #onewaveVENDOR UNISPHERE 4874ATTRIBUTE Ingress-Policy-Name 10 string UNISPHEREATTRIBUTE Egress-Policy-Name 11 string UNISPHEREVALUE Service-Type Login-User 1VALUE Service-Type Framed-User 2VALUE Service-Type Callback-Login-User 3 VALUE Service-Type Callback-Framed-User 4dictionary.onewave:思华公司的属性字典表,定义了我们公司为认证/计费扩展的属性。目前vendor值自定义为8888。dictionary.unishpere:unisphere公司的属性字典表4.1.2 radiusd.conf说明:radius的通用参数配置和模板参数配置。Modules部分,除原有的模板可设置外,以下新增加的模板供选择:mydetail,myldap,myfiles,mysql,myradutmp。格式:通用参数:参数名称 = 参数值模板参数:(可通过$INCLUDE包括定义在其他文件中的模板) modules(模板)模板0 参数名称1 = 参数值1参数名称2 = 参数值2.模板N 参数名称1 = 参数值1参数名称2 = 参数值2. authenticate(认证)模板kauthorize(授权)模板kpreacct(预计费)模板k accounting(计费)模板kSession(在线数控制)模板k下面是主配置文件的说明: 主配置参数 含义 备注max_request_time=30最大请求时间(秒),超过此时间,进程会被kill,返回reject。Not usedcleanup_delay = 5清除cache区的认证结果的延迟时间(秒),当radius发送reply包后,NAS有可能没接收到,那么,在延迟时间内当NAS再次发送该请求时,radius直接将cache区的认证请求结果发送即可,这样可提高效率,防止DOS攻击。max_requests = 0同时处理的最大请求数,radius正在处理的包超过这个值,新的请求将被丢弃。0:无限制 delete_blocked_requests = no释放内存块标记,若出现进程被kill,有可能需释放内存块,但当radius运行在thread状态下时,delete_blocked_requests若设为yes,有可能会dump。Not usedportAuth-port,可以不指定,启动radius时可以命令行指定Not usedallow_core_dumps = nolog_auth = yes是否输出认证日志rad_authlog()log_auth_badpass =nologs password if its rejectedlog_auth_goodpass =nologs password if its correctuser root在后台运行时需要root权限,debug状态不需要group =root在后台运行时需要root权限,debug状态不需要lower_user = no可以设为before,after. Before 将在处理前把username转换为小写;after将对请求包做一次处理后在转换username为小写,如果认证没通过,在做一次处理。Not Usedlower_pass = noUpNot Usednospace_user =noUpNot Usednospace_pass =noUpNot Usedproxy_requests =yes是否处理漫游请求service_flag yes是否有服务类型标识,取值:(yes,no),缺省值:yesservice_delimit用户名!服务类型,分界符只能设置一个特殊符号,而且不能与realm的分界符相同,缺省值:!default_service_code= Internet服务类型缺省值,如果要强制用户在认证时输入用户名时指定是什么服务,可以不设。card_delimit #card卡用户标识符rating_recv_port(卡用户)反算时长进程 portrating_ip(卡用户)反算时长进程 ipsend_card_interval(卡用户)反算请求重发的时间间隔(毫秒)缺省值:200acct_rating_recv_port Rating接收acct包portacct_rating_ipRating 接收acct包iphzStatus no杭州网通status状态特殊处理hzHoliday no杭州网通假日用户ingress_policy_nameDont Setegress_policy_nameDont Setguest Dont Setsession_timeout=0if rating反算失败,we return session_timeout 单位:秒common_user_timeout=12default session_timeout of common user,单位:小时special_proxy=no*not used in standard version of radiusdefault_realm*local_realm*ssg_service_flag*ssg_nas_internal_ip*ssg_nas_internet_ip*pre_lock_flagno预加锁,为了防止同一用户在不同的地方同时发起接入请求以达到同时上网的目的。在用户认证时,Radius会检查mysql判断是否有该用户prelock记录。如果有prelock记录且该记录未超时,表示该用户在其他地方发起的认证请求session还没有完成,这时候认证返回失败。如果没有prelock记录或prelock记录超时,且用户在线数小于最大在线数,则认证通过,这时radius会在mysql中添加一条prelock记录。认证通过后,NAS会发送Accounting-Request(start)包,这时radius会更新prelock记录为onlinepre_lock_time5预加锁超时时间check_nas_port1是否检查NAS-Port-Idcheck_vlan_id0是否检查vlaniduser_caseflag#whether need to translate user(or card)s loginname to upper/lower Case#0 - not change;#1 - lower;#2 - upper;card_caseflag#whether need to translate user(or card)s loginname to upper/lower Case#0 - not change;#1 - lower;#2 - upper;mail_checkflag =0检查mail用户状态方式,mail user只在为closed状态时才reject,暂停,停机时允许收发mail#0 -only check whether it is closed#1 -check whether it is not activenxWlan no宁夏电信wlannxMultiService=no宁夏电信宽窄合一nxCalledMap=no宁夏电信被叫号码映射nxHotspot=no宁夏电信热点区域nxCardPrefix=no宁夏电信窄带旧卡前缀标志NxCardTypeCheck=no宁夏电信窄带旧卡类型检查nxAccessArea=no宁夏电信接入域匹配NxIsdn=no宁夏电信窄带Isdn双通道识别nxPhoneInfo=no宁夏电信窄带与疏忙系统接口。Radius发送用户上下线信息给疏忙系统,疏忙系统在用户端驻留小窗口,用于通知是否有电话打入。nxPhoneInfo_port疏忙系统portnxPhoneInfo_ip疏忙系统ipprofile_ext=yes根据不同的nas类型返回不同的属性,现在只用于宁夏窄带nas 。nx1631630 1631630宁夏电信智能网(主叫号码为1631630)只允许主叫方式接入下面是外含的模块的配置,具体见相应的该配置文件说明的小节:$INCLUDE $confdir/mailclients.conf$INCLUDE $confdir/proxy.conf$INCLUDE $confdir/clients.conf$INCLUDE $confdir/nas.attrmap$INCLUDE $confdir/snmp.conf$INCLUDE $confdir/sql.conf下面是内含的模块的配置: 模板名称配置参数含义备注Unixcache = nopasswd = /etc/passwdAuth-type=Systemgroup = /etc/grouprealm suffixformat = suffixSuffixdelimiter = 指定后缀分割符,一般为preprocess主要做一些跟nas相关属性的特殊处理。acct_uniqueKey指定产生Acct-Unique-Session-Id所使用的属性myldapServer要连接的ldap主机名server1,server2,server3备用的ldap主机名port = 389Ldap 端口IdentityLdap user name PasswordLdap passwordBasedn普通用户的ldap认证目录Cbasedn卡用户的ldap认证目录Gbasedn用户归属组的ldap认证目录dictionary_mappingRadius属性与ldap属性映射文件encrypt_passwd0宁夏电信旧系统密码加密标志0:不检查1:检查,如果用户认证失败,检查encrypt_passwd_file里指定的用crypt密码,再次认证。暂时功能的配置项encrypt_passwd_file宁夏电信导入的旧系统密码保存文件upMyfilesusersfile = $confdir/users用户认证属性,包括检测项和应答项。包括了wellknownuser和serviceCode,见users小节acctusersfile = $confdir/usersUp.处理acct包时检查。mydetaildetailfile = %A/common/detail普通用户detail存放目录Interval普通用户新detail文件的时间间隔。单位为分。Detail文件名采用detail#*格式,每隔interval时间生成一个新的。*表示labelFileminlabel0Detail文件的最小labelFilemaxlabel=9999Detail文件的最大labelAccttypeflag=2记录acct包类型标志.0 :Stop, 1: Start|Stop,others value:All我们现在只记录start,stopcdetailfile = $radacctdir/card/detail卡用户detail存放目录Cinterval600卡用户新detail文件的时间间隔。单位为秒Proxydetailfile漫游detail存放目录Proxyinterval60漫游用户新detail文件的时间间隔。单位为分下面是认证/计费模块的常规配置:authorize preprocesssuffixmyfilesmyldapauthenticate myfilesmyldappreacct preprocesssuffixmyfilesaccounting acct_uniquemydetailmysqlsession mysql4.1.3 users说明:用户认证属性,包括检测项和应答项。包括了主叫用户和服务。此处可设置用户的通用Session数。若想给某些用户单独设置Session数,那么,就要在ldap中加入一个属性:npSessionsAllowed .现在radius支持在loginname,serviceCode两级别指定npSessionsAllowed格式:userName config_items1 := value1, config_items2 = value2,.check_item1=value1,check_item2=value2 reply_item1 = value1, reply_item2 = value2,serviceCode config_items1 := value1, config_items2 = value2,.check_item1 := value1,check_item2 = value2 reply_item1 = value1, reply_item2 = value2, .含义:username/serviceCode:用户名/服务名,可设置DEFAULT;config_items:认证时的辅助属性项,用 “:=” or “+=”,一般标志出Auth-Type,一般为Ldap,也可以指定File(主叫用户),System(unix user)。还可以标志出Simultaneous-Use等check_item:认证时的属性检测项;用”=”,用于检查认证的属性是否等于指定的值reply_item:认证完毕后的应答属性项;用”=”例子:#-ldap serviceCodeInternet Auth-Type := LDAP,Simultaneous-Use := 3 Address-Pool-Name = internetpool, Reply-Message = 1, Ingress-Policy-Name = 1meg, Egress-Policy-Name = 1meg#-File, wellknownuser163 Auth-Type := File, Onewave-Wellknown-User := 1, Onewave-Service-Code+=Isdn, Onewave-Service-Code+=Pstn, Simultaneous-Use := 100000,Password = 163,Onewave-Map-Called=16300 Service-Type = Framed-User, Framed-Protocol = PPP, Session-Timeout = 3600, Reply-Message = 163 OKOK!4.1.4 clients.conf说明:客户端配置文件,客户端是相对radius server而言,如NAS,Mail。将NAS server的主机名和KEY加入。NAS server的主机名加入到/etc/hosts中,KEY要与NAS server设的一样。clients.conf:格式:client client_ipaddress secret= xxxxshortname= xxxxvendor = Onewave含义:client_ipaddress: 客户端的IP地址secret:client和radius server的公共密码shortname:客户端的短名称vendor:nas提供商,跟nas.attrmap对应。 例子:client secret = testing123 shortname =8 vendor =unisphereclient 8 secret =testing123 shortname =acs vendor =genie4.1.5 mailclients.conf说明:Mail服务器的配置文件。格式:mailmail-server-name success_reply_msg = Authentication successfail_reply_msg = Authentication failurenouser_reply_msg = Improper %u specification含义:mail-server-name:Mail服务器主机名success_reply_msg:认证成功时的应答信息。fail_reply_msg:该用户已注册,但认证失败时的应答信息。nouser_reply_msg:无该用户,认证成功时的应答信息。注意:.reply-msg中若包
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2023八年级数学上册 第十三章 轴对称13.3 等腰三角形13.3.2 等边三角形第2课时 含30°角的直角三角形的性质说课稿(新版)新人教版
- 六年级品德与社会下册 放飞和平鸽1说课稿 鄂教版
- 节能路由协议优化-第1篇-洞察及研究
- Unit 1 Shapes说课稿-2023-2024学年小学英语三年级下册牛津上海版(试用本)
- 第五章-二元一次方程组单元说课稿 2025-2026学年北师大版八年级数学上册
- 化工产品设计协议
- 企业网站开发及运营服务协议
- 2025-2030中国量子计算硬件纠错技术突破与行业应用时间预测
- 2025-2030中国脑机接口医学应用伦理审查与临床试验规范
- 2025-2030中国租赁住房行业从业人员培训体系构建
- 科技与全球资源分配问题
- 2024年高等教育教育类自考-00285中国福利思想笔试历年真题荟萃含答案
- 蛋白质相互作用传递信息蛋白质
- 马克思主义劳动观的内涵
- 《金属热处理》课件
- 校园物业巡查方案范文
- 学生上下学交通方式台账
- 路边停车经营管理方案
- 混凝土围墙贴砖施工方案
- 人体工程学室外环境设施课件
- 初次聊天话术900句高情商的对话语录
评论
0/150
提交评论