1. 所需软件为:
dkms-
kernel_ppp_mppe-
kernelmod-
ppp-
pptpd-
2. 升级内枋模块
首先查看是否已经支持mppe功能:modprobe ppp-compress-18 && echo ok
如果显示ok,那么内核已经具备了mppe支持。如果不支持,需安装:
dkms-
kernel_ppp_mppe-
对于低版本的内核是必须安装kernelmod-
3. 安装ppp
在上面的网址下载最新的ppp软件包,源包用最常规的方法,configure,make,make install。注意:新版的没有复制范例配置文件,需要用 make install-etcppp 来安装范例配置文件。一般可用rpm软件包:
rpm –Fvh ppp-
4. 安装pptpd
在上面的网址下载最新的pptp软件包,源包用最常规的方法,configure,make,make install。一般采用pptp软件包:pptpd-
5. /etc/pptp.conf内容如下:
ppp /usr/local/sbin/pppd
option /etc/ppp/options.pptpd
bcrelay eth0
#listen
localip 192.168.x.x
remoteip 192.168.x.1-254
netmast 255.255.255.0
6. /etc/ppp/options.pptpd内容如下:
lock
dump
logfd 2
logfile /var/log/pptpd.log
name pptpserver
proxyarp
auth
mtu 1450
nobsdcomp
require-mschap-v2
#require-mppe-128
require-mppe
ipparam options.pptpd
ms-dns 192.168.x.x
ms-dns 202.86.252.254
7. /etc/ppp/ip-up内容如下:#!/bin/bash
# This file should not be modified -- make local changes to
# /etc/ppp/ip-up.local instead
PATH=/sbin:/usr/sbin:/bin:/usr/bin
export PATH
LOGDEVICE=$6
REALDEVICE=$1
[ -f /etc/sysconfig/network-scripts/ifcfg-${LOGDEVICE} ] && /etc/sysconfig/network-scripts/ifup-post ifcfg-${LOGDEVICE}
/etc/ppp/ip-up.ipv6to4 ${LOGDEVICE}
#################### Log ########################
pptplogdirectory="/etc/ppp"
dialinfo=`/sbin/ifconfig $1`
dialtime=`/bin/date`
userip=`ifconfig $1|grep inet|awk '{print $3}'|awk -F: '{print $2}'`
localinfo=`/bin/cat /etc/ppp/chap-secrets|grep $userip|awk '{print "username:"$1"\t","localIP:" $4,"logon Successfull"}'`
#username=`/bin/cat /etc/ppp/chap-secrets|grep $userip|awk '{print $1}'`
#remoteinfo=`/usr/bin/tail /var/log/daemon -n100|grep "CTRL: Client"|grep "control connection started"|tail -n1|awk -F"Client" '{print $2}'|awk '{print "remoteIP:",$1}'`
if [ -e $pptplogdirectory/userlog ];then
/bin/cat /etc/ppp/chap-secrets|grep $userip|awk '{print logontime"\t","username:"$1"\t","IP:"$4,"logon Successfull""\t","remoteIP:"'$6'}' logontime="`/bin/date`" >>$pptplogdirectory/userlog
#/bin/cat /etc/ppp/chap-secrets|grep $userip|awk '{print logontime"\t","username:"$1"\t","IP:"$4,"logon Successfull""\t","remoteIP:"'$6'}' logontime="`/bin/date`" >>$pptplogdirectory/userlog
#/bin/echo $0 $1 $2 $3 $4 $5 $6 $7 >>$pptplogdirectory/userlog
#/bin/echo $dialtime $localinfo $remoteinfo >>$pptplogdirectory/userlog
#/bin/cat /etc/ppp/chap-secrets|grep $userip|awk '{print logontime"\t","username:"$1"\t","IP:"$4,"logon Successfull"}' logontime="`/bin/date`" >>$pptplogdirectory/userlog
#/bin/cat /etc/ppp/chap-secrets|grep $userip|awk '{print logontime"\t","username:"$1"\t","IP:"$4,"logon Successfull""\t",remoteinfo}' logontime="`/bin/date`" remoteinfo="`/usr/bin/tail /var/log/daemon -n100|grep "CTRL: Client"|grep "control connection started"|tail -n1|awk -F"Client" '{print $2}'|awk '{print "remoteIP:",$1}'`" >>$pptplogdirectory/userlog
#echo "456"|awk '{print a$0b}' a="$a" b="$b"
else
/bin/touch $pptplogdirectory/userlog
fi
####################################################
/sbin/ifconfig $1 mtu 1446
#[ -x /etc/ppp/login.sh ] && /etc/ppp/login.sh "$@"
[ -x /etc/ppp/ip-up.local ] && /etc/ppp/ip-up.local "$@"
exit 0 8. /etc/ppp/chat-secrets内容如下:
# Secrets for authentication using CHAP
# client server secret IP addresses
“test” pptpserver “dfd&890” 192.168.x.x
9. 略
二、 pptp服务器管理1. 新建用户
Vi /etc/ppp/chat-secrets增加一条即可,并指定IP
2. 查看登录日志
tail –n100 /etc/ppp/userlog |
pptp服务器配置与管理
转载
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
vsftp服务器配置与管理
ftp的两种工作模式: 2,被动模式 主动模式与被动模式的比较:
职场 休闲 vsftp