1. Linux 版本

[root@as4u4 ~]# uname -a
Linux as4u4.linux 2.6.9-42.EL #1 Wed Jul 12 23:16:43 EDT 2006 i686 i686 i386 GNU/Linux

2. 所需安装文件

安装所需要的安装文件 如下面列出的4 个
安装文件的下载请到 http://www.poptop.org
http://sourceforge.net/project/showfiles.php?group_id=44827
[root@as4u4 ~]# cd ***/
[root@as4u4 ***]# ll
total 644
-rw-r--r-- 1 root root 78681 Jul 1 2007 dkms-2.0.10-1.noarch.rpm
-rw-r--r-- 1 root root 105346 Jul 1 2007 kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm //内核MPPE(Microsoft Point to Point Encryption,微软点对点加密)
-rw-r--r-- 1 root root 356446 Jul 1 09:58 ppp-2.4.3-5.rhel4.i386.rpm
-rw-r--r-- 1 root root 73889 Jul 1 09:58 pptpd-1.3.3-1.rhel4.i386.rpm
[root@as4u4 ***]#

3. 安装过程

[root@as4u4 ~]# rpm -ivh dkms-2.0.10-1.noarch.rpm
warning: dkms-2.0.10-1.noarch.rpm: V3 DSA signature: NOKEY, key ID 862acc42
Preparing... ########################################### [100%]
1:dkms ########################################### [100%]
[root@as4u4 ~]# rpm -ivh kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm
DKMS: install Completed.
[root@as4u4 ~]# rpm -ivh ppp-2.4.3-5.rhel4.i386.rpm
warning: ppp-2.4.3-5.rhel4.i386.rpm: V3 DSA signature: NOKEY, key ID b56a8bac
Preparing... ########################################### [100%]
file /usr/include/pppd/ccp.h from install of ppp-2.4.3-5.rhel4 conflicts with file from package ppp-2.4.2-6.4.RHEL4
file /usr/include/pppd/chap-new.h from install of ppp-2.4.3-5.rhel4 conflicts with file from package ppp-2.4.2-6.4.RHEL4
file /usr/include/pppd/chap_ms.h from install of ppp-2.4.3-5.rhel4 conflicts with file from package ppp-2.4.2-6.4.RHEL4
file /usr/include/pppd/fsm.h from install of ppp-2.4.3-5.rhel4 conflicts with file from package ppp-2.4.2-6.4.RHEL4
file /usr/include/pppd/md5.h from install of ppp-2.4.3-5.rhel4 conflicts with file from package ppp-2.4.2-6.4.RHEL4
file /usr/include/pppd/patchlevel.h from install of ppp-2.4.3-5.rhel4 conflicts with file from package ppp-2.4.2-6.4.RHEL4file /usr/include/pppd/pathnames.h from install of ppp-2.4.3-5.rhel4 conflicts with file from package ppp-2.4.2-6.4.RHEL4
file /usr/include/pppd/pppd.h from install of ppp-2.4.3-5.rhel4 conflicts with file from package ppp-2.4.2-6.4.RHEL4
file /usr/include/pppd/sha1.h from install of ppp-2.4.3-5.rhel4 conflicts with file from package ppp-2.4.2-6.4.RHEL4
file /usr/include/pppd/tdb.h from install of ppp-2.4.3-5.rhel4 conflicts with file from package ppp-2.4.2-6.4.RHEL4
file /usr/sbin/chat from install of ppp-2.4.3-5.rhel4 conflicts with file from package ppp-2.4.2-6.4.RHEL4
file /usr/sbin/pppd from install of ppp-2.4.3-5.rhel4 conflicts with file from package ppp-2.4.2-6.4.RHEL4
file /usr/sbin/pppdump from install of ppp-2.4.3-5.rhel4 conflicts with file from package ppp-2.4.2-6.4.RHEL4
file /usr/sbin/pppstats from install of ppp-2.4.3-5.rhel4 conflicts with file from package ppp-2.4.2-6.4.RHEL4
file /usr/share/man/man8/chat.8.gz from install of ppp-2.4.3-5.rhel4 conflicts with file from package ppp-2.4.2-6.4.RHEL4
file /usr/share/man/man8/pppd.8.gz from install of ppp-2.4.3-5.rhel4 conflicts with file from package ppp-2.4.2-6.4.RHEL4
file /usr/share/man/man8/pppdump.8.gz from install of ppp-2.4.3-5.rhel4 conflicts with file from package ppp-2.4.2-6.4.RHEL4
file /usr/share/man/man8/pppstats.8.gz from install of ppp-2.4.3-5.rhel4 conflicts with file from package ppp-2.4.2-6.4.RHEL4
[root@as4u4 ~]# rpm -Uvh ppp-2.4.3-5.rhel4.i386.rpm // 由于系统已经安装了旧版本,需要升级安装
warning: ppp-2.4.3-5.rhel4.i386.rpm: V3 DSA signature: NOKEY, key ID b56a8bac
Preparing... ########################################### [100%]
1:ppp ########################################### [100%]
[root@as4u4 ~]#
[root@as4u4 ~]# rpm -ivh pptpd-1.3.3-1.rhel4.i386.rpm
warning: pptpd-1.3.3-1.rhel4.i386.rpm: V3 DSA signature: NOKEY, key ID 862acc42
Preparing... ########################################### [100%]
1:pptpd ########################################### [100%]

4. ××× 配置

配置(地址池配置)- pptpd.conf
[root@as4u4 ~]# vi /etc/pptpd.conf
# (Recommended)
#localip 192.168.0.1
#remoteip 192.168.0.234-238,192.168.0.245
# or
#localip 192.168.0.234-238,192.168.0.245
#remoteip 192.168.1.234-238,192.168.1.245
在文件的末尾添加(或修改)
localip 10.1.1.10 // 定义*** 服务器上的IP.(是客户机连上后能与*** 服务通信的IP,也就是客户机可能过这个地址访问*** 服务器)
remoteip 10.1.1.100-150 // 定义客户端的IP 段.
××× 用户帐号和密码配置- chap-secrets
[root@as4u4 ~]# vi /etc/ppp/chap-secrets //编辑/etc/ppp/chap-secrets(配置*** 的用户名与密码)
# Secrets for authentication using CHAP
# client server secret IP addresses
quhh123 pptpd quhh123 10.1.1.101 //创建帐号
qu pptpd qu 10.1.1.102 //创建帐号
只需要加入:
"user" "pptpd" "password" "*" // 将user,password 修改为你的用户名和密码就可以了.
或者:
"user" "pptpd" "password" "10.1.1.101" // 将 * 用ip 代替后,就是指定客户端连上后的ip
配置认证方式- options.pptpd
[root@as4u4 ~]# vi /etc/ppp/options.pptpd
name pptpd
refuse-pap // 拒绝PAP 认证
require-chap // 使用CAHP 认证
refuse-mschap // 拒绝PAP 认证
# Require the peer to authenticate itself using MS-CHAPv2 [Microsoft
# Challenge Handshake Authentication Protocol, Version 2] authentication.
#require-mschap-v2
# Require MPPE 128-bit encryption
# (note that MPPE requires the use of MSCHAP-V2 during authentication)
#require-mppe-128
ms-dns 202.96.209.133
#require-mschap-v2 //屏蔽 CHAP-V2 认证
其它设置
设置IP 伪装转发
只有设置了IP 伪装转发,通过××× 连接上来的远程计算机才能互相ping 通,实现像局域网那样的共享。用下面的命令进行设置:
[root@as4u4 ~]# echo 1 > /proc/sys/net/ipv4/ip_forward
可以将这条命令放到文件/etc/rc.d/rc.local 里面,以实现每次开机时自动运行该命令
打开防火墙端口
将Linux 服务器的1723 端口和47 端口打开,并打开GRE 协议。
[root@as4u4 ~]# /sbin/iptables -A INPUT -p tcp --dport 1723 -j ACCEPT
[root@as4u4 ~]# /sbin/iptables -A INPUT -p tcp --dport 47 -j ACCEPT
[root@as4u4 ~]#/sbin/iptables -A INPUT -p gre -j ACCEPT
或者直接关闭防火墙服务
[root@as4u4 ~]#service iptables stop
如果要求外网机器通过*** 连接其它网段的机器,还要用iptable 做NAT 转发
启用服务
[root@as4u4 ~]# /etc/rc.d/init.d/pptpd start

[root@as4u4 ~]#service pptpd start
到这里Linux 服务器的设置就完成了,下面将利用Windows 客户端进行测试。
828e7ced8e8367dbb21cb15f.jpg
6ee9e3395dd5d6fc3b87ce44.jpg
9bc7ca03cfa83a87d53f7c53.jpg
893385deab6d3d57cdbf1a5d.jpg
eb23ddc43ab1afa68326ac5b.jpg
6eeb192eaae2775f4ec22640.jpg
fc357dfb7837476b024f5640.jpg