PPPTP概述

tcp1723

1,安装

rpm -ivh ppp--14.1.rhel5.x86_64.rpm #安装ppp

rpm -ivh pptpd--.rhel5.x86_64.rpm #安装pptp

2,修改配置

[root@lanny ~]# vim /etc/pptpd.conf

 localip 192.168.14.128

 remoteip 

3,为客户端提供DNS地址

[root@lanny ~]# vim /etc/ppp/options.pptpd

ms-dns 114.114.114.114

4,添加帐号密码

vi /etc/ppp/chap-secrets

####### system-config-network will overwrite this part!!! (begin) ##########

lanny *  *

####### system-config-network will overwrite this part!!! (end) ############

第一列用户名 第三列密码

5,启动服务

[root@lanny tools]# /etc/init.d/pptpd start

Starting pptpd: [ OK ]

[root@lanny tools]#

如果启动报错:看ppptp日志:

[root@lanny tools]# cat /var/log/messages

Dec  :: moban pppd[]: local IP address 192.168.14.128

Dec  :: moban pppd[]: remote IP address 172.16.1.100

[root@lanny ~]# netstat -nutlp |grep pptp

tcp    /pptpd

监控日志脚本:

cat /etc/ppp/ip-up

......

echo "$PEERNAME 分配IP: $5 登陆IP:$6 登陆时间:`date -d today +%F_%T`" >> /var/log/pptpd.log

exit

cat /etc/ppp/ip-down

......

echo "$PEERNAME 下线IP: $6 下线时间:`date -d today +%F_%T`" >> /var/log/pptpd.log

exit

=============

追加到ip-up脚本exit 0前

echo "$PEERNAME allocate IP: $5 login IP:$6 login time:`date -d today +%F_%T`" >> /var/log/pptpd.log

追加到ip-down脚本exit 0前

echo "$PEERNAME logoff IP: $6 logofff:`date -d today +%F_%T`" >> /var/log/pptpd.log

[root@lanny ~]# cat /var/log/pptpd.log

lanny logoff IP: --13_22::

lanny allocate IP: --13_22::

http://www.nenew.net/pptp-vpn-log-user-time-ip-net-traffic-info.html

客户端设置:

1,添加PPPTP客户端

Linux PPTP搭建-LMLPHP

Linux PPTP搭建-LMLPHP

2,优化设置

Linux PPTP搭建-LMLPHP

Linux PPTP搭建-LMLPHP

05-11 15:08