免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4480 | 回复: 7
打印 上一主题 下一主题

大家帮忙看看,虚拟机上架设的pppoe-server,通过radius-server认证客户端出错 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-06-12 19:30 |只看该作者 |倒序浏览
我在自己的虚拟机redhat9.0上用ppp-2.4.4和rp-pppoe3.8建了一个pppoe-server,用window的client端去连接成功。

下一步打算用radius-server来帮pppoe-server认证客户端。于是在虚拟机上安装了两包代码:radiusclient-0.3.2-0.dag.rh90.i386.rpm 和freeradius-1.1.5。
按照hefish的方法配置freeradius;
1)        修改 clients.conf
# vi /usr/local/freeradius/etc/raddb/clients.conf
client 127.0.0.1 {
secret = 123456
shortname = localhost
nastype = other
}
2)        修改 naslist ,加入:
# vi /usr/local/freeradius/etc/raddb/naslist
localhost local portslave
3) 编辑 users ,加入用户: (这个用户是保存在文本文件里的,做测试用)
# vi /usr/local/freeradius/etc/raddb/users
test Auth-Type:=local, User-Password==123456
          Service-Type = Framed-User,
          Framed-Protocol = PPP,
          Framed-IP-Address = 10.0.0.2,
          Framed-IP-Netmask = 255.255.255.0
4)        启动radiusd,测试radiusd服务:
# /usr/local/freeradius/sbin/radiusd -X
# /usr/local/freeradius/bin/radtest test 123456 localhost 0 123456
出现 Access-Accept的字样,说明radius-server可以工作了。

接下来配置pppd,使其和radius一起工作
1)        建立一个 /etc/ppp/radius 目录,用来存放radius的配置,然后把ppp-2.4.4里面的radius相关配置复制过来:
# mkdir /etc/ppp/radiuds
# cd ppp-2.4.4pppd/plugins/radius/etc
# cp * /etc/ppp/radius
2)        编辑 /etc/ppp/options , 加上radius 支持
# vi /etc/ppp/options 加上下面两句
plugin /etc/ppp/plugins/radius.so // 注意pppd安装时候radius.so的位置
radius-config-file /etc/ppp/radius/radiusclient.conf
3) 编辑 radiusclient.conf 文件,如下:(主要是修改一些默认的文件路径,其他没什么要改的)
# cat /etc/ppp/radius/radiusclient.conf
auth_order radius
login_tries 4
login_timeout 60
nologin /etc/nologin
issue /etc/ppp/radius/issue
authserver localhost:1812
acctserver localhost:1813
servers /etc/ppp/radius/servers
dictionary /etc/ppp/radius/dictionary
login_radius /usr/local/sbin/login.radius
seqfile /var/run/radius.seq
mapfile /etc/ppp/radius/port-id-map
default_realm
radius_timeout 10
radius_retries 3
login_local /bin/login
4)配置 /etc/ppp/pppoe-server-options
# cat /etc/ppp/pppoe-server-options
auth
require-chap
lcp-echo-interval 60
lcp-echo-failure 5
5)        设置密码文件 (先实现文本文件密码认证)
# cat /etc/ppp/chap-secrets
test  * 123456 *
6)        编辑 servers ,设定radius 服务器的位置
# cat /etc/ppp/radius/servers
localhost 123456 // 这里的123456是我前面设置的访问radius服务器的密码
7)        编辑 dictionary ,修改一些路径设置,主要是最后一个dictionary.microsoft 的路径设置
# vi /etc/ppp/radius/dictionary
..
...
INCLUDE /etc/ppp/radius/dictionary.microsoft


最后启动radiusd和pppoe-server,然后用windows的client拨号,显示错误691:由于域上的用户名和、或密码无效而拒绝访问。
查看/var/log/messages:
Jun 12 17:47:36 localhost pppoe-server[2291]: Session 1 created for client 00:16:ec:87:33:e5 (10.67.15.1) on eth0 using Service-Name ''
Jun 12 17:47:36 localhost pppd[2291]: Plugin /etc/ppp/plugins/radius.so loaded.
Jun 12 17:47:36 localhost pppd[2291]: RADIUS plugin initialized.
Jun 12 17:47:36 localhost pppd[2291]: pppd 2.4.4 started by root, uid 0
Jun 12 17:47:36 localhost pppd[2291]: Using interface ppp0
Jun 12 17:47:36 localhost pppd[2291]: Connect: ppp0 <--> /dev/pts/2
Jun 12 17:47:36 localhost /etc/hotplug/net.agent: assuming ppp0 is already up
Jun 12 17:47:46 localhost pppd[2291]: Peer test failed CHAP authentication
Jun 12 17:47:46 localhost pppd[2291]: Connection terminated.
Jun 12 17:47:46 localhost pppoe[2292]: read (asyncReadFromPPP): Session 1: Input/output error
Jun 12 17:47:46 localhost pppd[2291]: Exit.
Jun 12 17:47:46 localhost pppoe-server[2290]: Session 1 closed for client 00:16:ec:87:33:e5 (10.67.15.1) on eth0
Jun 12 17:47:46 localhost pppoe-server[2290]: Sent PADT
Jun 12 17:47:46 localhost pppoe-server[2290]: Sent PADT
Jun 12 17:47:47 localhost /etc/hotplug/net.agent: NET unregister event not supported


PS:试了很多次了,也确定了配置文件,一直不能成功,希望大家帮忙看一看是什么原因。另外,我对radiusclient.conf文件中的一句命令存有疑问:
login_radius /usr/local/sbin/login.radius
login.radius文件本来是没有的,我安装了radiusclient-0.3.2-0.dag.rh90.i386.rpm以后才看到这个文件,查看内容如下,个人觉得貌似没有做什么特别的事情:
#!/bin/sh
#
# $Id: login.radius,v 1.1.1.1 2003/12/02 10:39:23 sobomax Exp $
#
# Copyright (C) 1998 Lars Fenneberg
#
# See the file COPYRIGHT for the respective terms and conditions.
# If the file is missing contact me at lf@elemental.net
# and I'll send you a copy.
#

cat <<EOF
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:
EOF

set | egrep '^RADIUS_'

echo
echo "Bye, bye."

exit 0

论坛徽章:
0
2 [报告]
发表于 2009-06-13 07:23 |只看该作者
没做过

论坛徽章:
0
3 [报告]
发表于 2009-06-15 09:02 |只看该作者
没有人知道吗???

论坛徽章:
0
4 [报告]
发表于 2009-06-16 11:22 |只看该作者

论坛徽章:
0
5 [报告]
发表于 2009-06-16 13:13 |只看该作者
radiusd -X的输出

论坛徽章:
0
6 [报告]
发表于 2009-06-16 13:36 |只看该作者
root@localhost root]# /usr/local/freeradius/sbin/radiusd -X
Starting - reading configuration files ...
reread_config:  reading radiusd.conf
Config:   including file: /usr/local/freeradius/etc/raddb/proxy.conf
Config:   including file: /usr/local/freeradius/etc/raddb/clients.conf
Config:   including file: /usr/local/freeradius/etc/raddb/snmp.conf
Config:   including file: /usr/local/freeradius/etc/raddb/eap.conf
Config:   including file: /usr/local/freeradius/etc/raddb/sql.conf
main: prefix = "/usr/local/freeradius"
main: localstatedir = "/usr/local/freeradius/var"
main: logdir = "/usr/local/freeradius/var/log/radius"
main: libdir = "/usr/local/freeradius/lib"
main: radacctdir = "/usr/local/freeradius/var/log/radius/radacct"
main: hostname_lookups = no
main: max_request_time = 30
main: cleanup_delay = 5
main: max_requests = 1024
main: delete_blocked_requests = 0
main: port = 0
main: allow_core_dumps = no
main: log_stripped_names = no
main: log_file = "/usr/local/freeradius/var/log/radius/radius.log"
main: log_auth = no
main: log_auth_badpass = no
main: log_auth_goodpass = no
main: pidfile = "/usr/local/freeradius/var/run/radiusd/radiusd.pid"
main: user = "(null)"
main: group = "(null)"
main: usercollide = no
main: lower_user = "no"
main: lower_pass = "no"
main: nospace_user = "no"
main: nospace_pass = "no"
main: checkrad = "/usr/local/freeradius/sbin/checkrad"
main: proxy_requests = yes
proxy: retry_delay = 5
proxy: retry_count = 3
proxy: synchronous = no
proxy: default_fallback = yes
proxy: dead_time = 120
proxy: post_proxy_authorize = no
proxy: wake_all_if_all_dead = no
security: max_attributes = 200
security: reject_delay = 1
security: status_server = no
main: debug_level = 0
read_config_files:  reading dictionary
read_config_files:  reading naslist
Using deprecated naslist file.  Support for this will go away soon.
read_config_files:  reading clients
Using deprecated clients file.  Support for this will go away soon.
read_config_files:  reading realms
radiusd:  entering modules setup
Module: Library search path is /usr/local/freeradius/lib
Module: Loaded exec
exec: wait = yes
exec: program = "(null)"
exec: input_pairs = "request"
exec: output_pairs = "(null)"
exec: packet_type = "(null)"
rlm_exec: Wait=yes but no output defined. Did you mean output=none?
Module: Instantiated exec (exec)
Module: Loaded expr
Module: Instantiated expr (expr)
Module: Loaded PAP
pap: encryption_scheme = "crypt"
Module: Instantiated pap (pap)
Module: Loaded CHAP
Module: Instantiated chap (chap)
Module: Loaded MS-CHAP
mschap: use_mppe = yes
mschap: require_encryption = no
mschap: require_strong = no
mschap: with_ntdomain_hack = no
mschap: passwd = "(null)"
mschap: authtype = "MS-CHAP"
mschap: ntlm_auth = "(null)"
Module: Instantiated mschap (mschap)
Module: Loaded System
unix: cache = no
unix: passwd = "(null)"
unix: shadow = "(null)"
unix: group = "(null)"
unix: radwtmp = "/usr/local/freeradius/var/log/radius/radwtmp"
unix: usegroup = no
unix: cache_reload = 600
Module: Instantiated unix (unix)
Module: Loaded eap
eap: default_eap_type = "md5"
eap: timer_expire = 60
eap: ignore_unknown_eap_types = no
eap: cisco_accounting_username_bug = no
rlm_eap: Loaded and initialized type md5
rlm_eap: Loaded and initialized type leap
gtc: challenge = "Password: "
gtc: auth_type = "PAP"
rlm_eap: Loaded and initialized type gtc
mschapv2: with_ntdomain_hack = no
rlm_eap: Loaded and initialized type mschapv2
Module: Instantiated eap (eap)
Module: Loaded preprocess
preprocess: huntgroups = "/usr/local/freeradius/etc/raddb/huntgroups"
preprocess: hints = "/usr/local/freeradius/etc/raddb/hints"
preprocess: with_ascend_hack = no
preprocess: ascend_channels_per_line = 23
preprocess: with_ntdomain_hack = no
preprocess: with_specialix_jetstream_hack = no
preprocess: with_cisco_vsa_hack = no
Module: Instantiated preprocess (preprocess)
Module: Loaded realm
realm: format = "suffix"
realm: delimiter = "@"
realm: ignore_default = no
realm: ignore_null = no
Module: Instantiated realm (suffix)
Module: Loaded files
files: usersfile = "/usr/local/freeradius/etc/raddb/users"
files: acctusersfile = "/usr/local/freeradius/etc/raddb/acct_users"
files: preproxy_usersfile = "/usr/local/freeradius/etc/raddb/preproxy_users"
files: compat = "no"
Module: Instantiated files (files)
Module: Loaded Acct-Unique-Session-Id
acct_unique: key = "User-Name, Acct-Session-Id, NAS-IP-Address, Client-IP-Address, NAS-Port"
Module: Instantiated acct_unique (acct_unique)
Module: Loaded detail
detail: detailfile = "/usr/local/freeradius/var/log/radius/radacct/%{Client-IP-Address}/detail-%Y%m%d"
detail: detailperm = 384
detail: dirperm = 493
detail: locking = no
Module: Instantiated detail (detail)
Module: Loaded radutmp
radutmp: filename = "/usr/local/freeradius/var/log/radius/radutmp"
radutmp: username = "%{User-Name}"
radutmp: case_sensitive = yes
radutmp: check_with_nas = yes
radutmp: perm = 384
radutmp: callerid = yes
Module: Instantiated radutmp (radutmp)
Listening on authentication *:1812
Listening on accounting *:1813
Ready to process requests.

论坛徽章:
0
7 [报告]
发表于 2009-06-16 13:49 |只看该作者
# /usr/local/freeradius/bin/radtest test 123456 localhost 0 123456
Sending Access-Request of id 164 to 127.0.0.1 port 1812
        User-Name = "test"
        User-Password = "123456"
        NAS-IP-Address = 255.255.255.255
        NAS-Port = 0
rad_recv: Access-Accept packet from host 127.0.0.1:1812, id=164, length=44
        Service-Type = Framed-User
        Framed-Protocol = PPP
        Framed-IP-Address = 10.0.0.2
        Framed-IP-Netmask = 255.255.255.0

论坛徽章:
0
8 [报告]
发表于 2009-07-10 10:54 |只看该作者

回复 #7 hanhan0218 的帖子

不好意思,才看见你LZ的留言.
之前我配置的过程中,碰见的最大问题,就是软件的版本问题,不要一味的用最新版本的软件.我就是因为用了最新版本,所以一直无法配置成功.
虽然你是自己测试安装,建议还是不要使用redhat9.0.毕竟这个版本已经非主流N年了.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP