[root@localhost~]#cat/proc/version
Linuxversion2.6.32-358.el6.x86_64([email protected])(gccversion4.4.720120313(RedHat4.4.7-3)(GCC))#1SMPFriFeb2200:31:26UTC2013
[root@localhost~]#uname-a
Linuxlocalhost.localdomain2.6.32-358.el6.x86_64#1SMPFriFeb2200:31:26UTC2013x86_64x86_64x86_64GNU/Linux
[root@localhost~]#modprobeppp-compress-18&&echook
Ok
[root@localhost~]#cat/dev/net/tun
cat:/dev/net/tun:Filedescriptorinbadstate
[root@localhost~]#strings'/usr/sbin/pppd'|grep-imppe|wc-l
42
該版本已經全部默認安裝了了
[root@localhost~]#yuminstall-yperlpppiptables
Loadedplugins:fastestmirror,refresh-packagekit,security
Loadingmirrorspeedsfromcachedhostfile
*base:mirrors.yun-idc.com
*c6-media:
*extras:mirrors.btte.net
*updates:mirrors.btte.net
file:///media/CentOS/repodata/repomd.xml:[Errno14]Couldnotopen/readfile:///media/CentOS/repodata/repomd.xml
Tryingothermirror.
file:///media/cdrecorder/repodata/repomd.xml:[Errno14]Couldnotopen/readfile:///media/cdrecorder/repodata/repomd.xml
Tryingothermirror.
file:///media/cdrom/repodata/repomd.xml:[Errno14]Couldnotopen/readfile:///media/cdrom/repodata/repomd.xml
Tryingothermirror.
SettingupInstallProcess
Package4:perl-5.10.1-131.el6_4.x86_64alreadyinstalledandlatestversion
Packageppp-2.4.5-5.el6.x86_64alreadyinstalledandlatestversion
Packageiptables-1.4.7-9.el6.x86_64alreadyinstalledandlatestversion
Nothingtodo
[root@localhost~]#wgethttp://acelnmp.googlecode.com/files/pptpd-1.3.4-1.rhel5.1.x86_64.rpm
--2013-09-2610:55:16--http://acelnmp.googlecode.com/files/pptpd-1.3.4-1.rhel5.1.x86_64.rpm
Resolvingacelnmp.googlecode.com...74.125.128.82,2404:6800:4005:c00::52
Connectingtoacelnmp.googlecode.com|74.125.128.82|:80...connected.
HTTPrequestsent,awaitingresponse...200OK
Length:83597(82K)[application/x-rpm]
Savingto:“pptpd-1.3.4-1.rhel5.1.x86_64.rpm”
100%[======================================>]83,597233K/sin0.4s
2013-09-2610:55:17(233KB/s)-“pptpd-1.3.4-1.rhel5.1.x86_64.rpm”saved[83597/83597]
[root@localhost~]#rpm-ivhpptpd-1.3.4-1.rhel5.1.x86_64.rpm
warning:pptpd-1.3.4-1.rhel5.1.x86_64.rpm:HeaderV3DSA/SHA1Signature,keyID862acc42:NOKEY
error:Faileddependencies:
ppp=2.4.4isneededbypptpd-1.3.4-1.rhel5.1.x86_64
[root@localhostDesktop]#rpm-ivhpptpd-1.3.4-2.el6.x86_64.rpm
warning:pptpd-1.3.4-2.el6.x86_64.rpm:HeaderV3DSA/SHA1Signature,keyID862acc42:NOKEY
Preparing...###########################################[100%]
1:pptpd###########################################[100%]
[root@localhostDesktop]#mv/etc/ppp/options.pptpd/etc/ppp/options.pptpd.bak
[root@localhostDesktop]#vim/etc/ppp/options.pptpd
輸入下面的內容
namepptpd
refuse-pap
refuse-chap
refuse-mschap
require-mschap-v2
require-mppe-128
proxyarp
lock
nobsdcomp
novj
novjccomp
nologfd
idle2592000
ms-dns8.8.8.8
ms-dns8.8.4.4
[root@localhostDesktop]#mv/etc/ppp/chap-secrets/etc/ppp/chap-secrets.bak
[root@localhostDesktop]#vim/etc/ppp/chap-secrets
#SecretsforauthenticationusingCHAP
#clientserversecretIPaddressesa
zhangpptpdzhang*
[root@localhostDesktop]#mv/etc/pptpd.conf/etc/pptpd.conf.bak
[root@localhostDesktop]#vim/etc/pptpd.conf
輸入以下的內容
option/etc/ppp/options.pptpd
logwtmp
localip192.168.10.1
remoteip192.168.10.11-30//表示***客戶端獲得ip的範圍
[root@localhostDesktop]#vim/etc/sysctl.conf
[root@localhostDesktop]#/sbin/sysctl-p
net.ipv4.ip_forward=1
net.ipv4.conf.default.rp_filter=1
net.ipv4.conf.default.accept_source_route=0
kernel.sysrq=0
kernel.core_uses_pid=1
net.ipv4.tcp_syncookies=1
error:"net.bridge.bridge-nf-call-ip6tables"isanunknownkey
error:"net.bridge.bridge-nf-call-iptables"isanunknownkey
error:"net.bridge.bridge-nf-call-arptables"isanunknownkey
kernel.msgmnb=65536
kernel.msgmax=65536
kernel.shmmax=68719476736
kernel.shmall=4294967296
[root@localhostDesktop]#/sbin/serviceiptables
[root@localhostDesktop]#iptables-tnat-APOSTROUTING-s192.168.10.0/24-oetho-jACCEPTstart
[root@localhostDesktop]#iptables-tnat-APOSTROUTING-oeth0-s192.168.10.0/24-jSNAT--to-source192.168.42.160
[root@localhostDesktop]#/sbin/servicepptpdrestart
Shuttingdownpptpd:[FAILED]
Startingpptpd:[OK]
Warning:apptpdrestartdoesnotterminateexisting
connections,sonewconnectionsmaybeassignedthesameIP
addressandcauseunexpectedresults.Userestart-killto
destroyexistingconnectionsduringarestart.
[root@localhostDesktop]#chkconfigpptpdon//開機啓動pptp***服務
[root@localhostDesktop]#chkconfigiptableson//開機啓動iptables
這樣在windows的客戶端,這裏以windows7爲例