- 论坛徽章:
- 0
|
我在自己的虚拟机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 |
|