(欢迎专业人士拍砖,这样才能进步)
本人菜鸟一枚,现在因为做本科毕业论文接触了radius协议。
在安装freeradius的时候遇到了一些问题。下面特此共享一下。
服务器是: RedHat4. 内核:2.6.9-78.Elsmp
装的freeradius在freeradius官网上下载.
Server: freeradius-server-2.1.10
Client: freeradius-client-1.1.6
1. 安装freeradius-client
很简单的三部曲:
(1). / configure (权限不够,先运行 chmod a+x ./configure,然后再运行这个步骤)
(2)make
(3)make install
2. 安装freeradius-server
参考:
http://freeradius.1045715.n5.nabble.com/Version-2-1-10-has-been-released-td2856754.html
也是三部曲。但是这个freeradius-server的这个版本貌似有点问题。
(1). / configure
(2) make
出问题了。大致如下:
In function `main': /usr/local/dnsnode/src/radiusd/freeradius-server-2.1.10/src/main/radsniff.c:489: undefined reference to `pcap_dump_fopen' .libs/radsniff.o(.text+0xe8b):/usr/local/dnsnode/src/radiusd/freeradius-server-2.1.10/src/main/radsniff.c:467: undefined reference to `pcap_fopen_offline' collect2: ld returned 1 exit status gmake[4]: *** [radsniff] Error 1 gmake[4]: Leaving directory `/usr/local/dnsnode/src/radiusd/freeradius-server-2.1.10/src/main' gmake[3]: *** [main] Error 2 gmake[3]: Leaving directory `/usr/local/dnsnode/src/radiusd/freeradius-server-2.1.10/src' gmake[2]: *** [all] Error 2 gmake[2]: Leaving directory `/usr/local/dnsnode/src/radiusd/freeradius-server-2.1.10/src' gmake[1]: *** [src] Error 2 gmake[1]: Leaving directory `/usr/local/dnsnode/src/radiusd/freeradius-server-2.1.10' make: *** [all] Error 2
解决方法:
在. / configure之后,make之前编辑(vi命令)src/main/Makefile ,找到这句话:
BINARIES += radsniff
删掉或者注释掉即可
附英语原文: The solution (for now) is to just edit src/main/Makefile/ Find the line saying: BINARIES += radsniff and delete it. Do this *after* the "configure' step.
(3) make install
又有错了:(
错误是什么我忘了(怪当时没有做一下记录)
解决方案还是在那个网页里。
解决方法:
在make之后,make install 之前,注释掉这句话:
$(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) radsniff$(EXEEXT) $(R)$(bindir)
附英语原文:If anyone else is in the same boat (RHEL4), comment this line too (so you can 'make install'): $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) radsniff$(EXEEXT) $(R)$(bindir)
现在是安装上了,好了,后面还有好多事情要做。
------------------------------------------------------------------------------------------------------
在网上搜到的很多配置方法都是和MySQL连接起来的。可是对于我这样的菜鸟,真是一件难事。装了好几天,也没搞出来。
如果你也想这么做,这个链接挺好的
http://www.cnitblog.com/chlclan/archive/2006/08/28/16076.html
后来就想搜一搜不要装MySQL的,结果找到了。链接:
http://blog.chinaunix.net/space.php?uid=21275705&do=blog&cuid=2371224
在这个文章中,作者把客户端和服务器端安装在了一个机器上。如果你是这样做的参考上面这个文档。如果不是,继续看下面(其实只是需要改一点点为了方便,我连名字什么的都没改。感谢作者)。
在安装的时候我不知道可以把客户端和服务器端装在一个机器上(server和client的名字都叫做 Localhost)。我是装在两个服务器上。服务器A用作client,服务器B用作server。
3. freeradius-client-1.1.6 配置
(1)/usr/local/etc/radiusclient/radiusclient.conf
#鉴权顺序 auth_order radius,local #login 登陆次数 login_tries 1 #超时时间,单位:秒 login_timeout 5 nologin /etc/nologin issue /usr/local/etc/radiusclient/issue #鉴权服务器IP或name,也可以加上端口、共享口令,例:#localhost:1812:testing
#如果你把server和client装在一台机器上的话用下句,否则下下句 #authserver localhost
authserver server的IP #计费服务器IP或name
#如果你把server和client装在一台机器上的话用下句,否则下下句 #acctserver localhost
acctserver client的IP 服务器共享口令文件路径 servers /usr/local/etc/radiusclient/servers dictionary /usr/local/etc/radiusclient/dictionary login_radius /usr/local/sbin/login.radius seqfile /var/run/radius.seq mapfile /usr/local/etc/radiusclient/port-id-map #默认域名 default_realm #radius 登陆超时时间,单位:秒 radius_timeout 5 #radius 登陆次数 radius_retries 1 radius_deadtime 0 bindaddr * #本地登陆 程序 login_local /bin/login
(2)/usr/local/etc/radiusclient/servers
#localhost testing123
Server的IP testing123
4. freeradius-server-2.1.10 简单安装和配置(为测试client)
(1)安装
./configure make make install
(2)/usr/local/etc/raddb/user (用户名:jj 口令:jj)
jj Cleartext-Password := "jj" Service-Type = Framed-User, Framed-Protocol = PPP,
#改成自己的client的IP Framed-IP-Address = 192.168.2.179,
Framed-IP-Netmask = 255.255.255.0, Framed-Routing = Broadcast-Listen, Framed-Filter-Id = "std.ppp", Framed-MTU = 1500, Framed-Compression = Van-Jacobsen-TCP-IP
(3)/usr/local/etc/raddb/clients.conf
#client localhost {
#共享口令 # secret = testing123 # shortname = private-network #}
client client的IP{
secret = testing123
shortname = XXX(自己随便起)
}
5. 测试结果
运行radius服务器 [root@localhost freeradius-client-1.1.6]# radiusd -X 测试客户端 [root@localhost freeradius-client-1.1.6]# radlogin ($Id: radlogin.c,v 1.9 2008/01/09 07:04:18 sobomax Exp $) ----------------------------------------------------- Linux 2.6.18-164.el5 (localhost.localdomain) (port 0) ----------------------------------------------------- login: jj Password: RADIUS: Authentication OK This is the dummy login.radius script. If you want that this script does something useful you'll have to replace it.
The following RADIUS environment variables are set: RADIUS_FILTER_ID=std.ppp RADIUS_FRAMED_COMPRESSION=Van-Jacobson-TCP-IP RADIUS_FRAMED_IP_ADDRESS=192.168.2.179 RADIUS_FRAMED_IP_NETMASK=255.255.255.0 RADIUS_FRAMED_MTU=1500 RADIUS_FRAMED_PROTOCOL=PPP RADIUS_FRAMED_ROUTING=Broadcast-Listen RADIUS_SERVICE_TYPE=Framed-User RADIUS_USER_NAME=jj
Bye, bye.
[root@localhost freeradius-client-1.1.6]# radexample login: jj Password: "jj" RADIUS Authentication OK
[root@localhost freeradius-client-1.1.6]# radacct(回车) User-Name=jj Password=jj Acct-Status-Type=7 (按Ctrl+D) RADIUS accounting OK
注:Ctrl+D是发送 EOF(end of file)。(看看程序src/radacct.c就明白了)
转载请注明出处:piaoxuwuyu的博客。谢谢!
好了,现在证明是好的了。但是有个地方你试试就知道错了--------radembedded(下篇博客详述)
