当前位置:操作系统 > Unix/Linux >>

OpenLDAP+FreeRADIUS+MySQL+RP-PPPOE 构建PPPOE服务器

经过几天的奋战,总算搞定这个PPPOE服务器。

基本环境:

   Host:       LFS-6.x
   openLDAP:   2.3.19
   MySQL:      5.0.24
   rp-pppoe:   3.8
   freeradius: 1.1.3
   ppp:        2.4.4 (with mppe-mppc patched)
   kernel:     2.6.18 (built-in mppe-mppc support)
  

简介:
   rp-pppoe 作为 PPPOE 服务器,通过 radius 模块,将用户验证交给 freeradius 来处理, freeradius 又使用 LDAP 来保存拨号用户的验证信息(用户名/密码之类的)、MySQL 来存储拨号相关信息(日志记账,如连接时间,流量等)。

步骤:

   至于上述软件的编译就不提了,网上到处都可以找到

配置:

#### ppp: (/etc/ppp/options) ####################################
lock
crtscts
nobsdcomp
nodeflate
nopcomp
debug

plugin /etc/ppp/plugins/radius.so
radius-config-file /etc/radiusclient/radiusclient.conf
#################################################################

#### rp-pppoe: (/etc/ppp/pppoe-server) ##########################
auth
require-pap
default-mru
default-asyncmap
lcp-echo-interval 10
lcp-echo-failure 3
ms-dns 211.161.159.3
ms-dns 211.161.159.5
noipdefault
noipx
defaultroute
noproxyarp
noktune
10.0.0.1:10.0.0.200
netmask 255.255.255.255
logfile /var/log/pppoe.log
#################################################################

#### ldap 数据库 ################################################
# test, pppoe, example.com
dn: cn=test,o=pppoe,dc=example,dc=com
cn: test
objectClass: radiusProfile
radiusAuthType: Local
userPassword: 123456
radiusServiceType: Framed-User
radiusFramedProtocol: PPP
radiusFramedIPAddress: 10.0.0.2
radiusFramedIPNetmask: 255.255.25.0
#################################################################

#### radiusd.conf ###############################################
modules {

ldap {
server = "localhost"
identity = "cn=Manager,dc=example,dc=com"
password = secret
basedn = "o=pppoe,dc=example,dc=com"
filter = "(cn=%{Stripped-User-Name:-%{User-Name}})"
base_filter = "(objectclass=radiusProfile)"
#access_attr = "dialupAccess"
password_attribute = userPassword
}
}

authorize {

# chap
# mschap
# files
ldap
}

authenticate {
Auth-Type LDAP {
ldap
}
}

accounting {
sql
}
#################################################################

MySQL 数据库表和 LDAP 的schema文件可以在freeradius的源代码目录下的 doc/examples
下面找到。
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,