1.若是檢查結果沒有這些支持的話,是不能安裝pptp的。執行指令:vim
#modprobe ppp-compress-18 && echo okide
#cat /dev/net/tunui
若是這條指令顯示結果爲下面的文本,則代表經過:加密
cat: /dev/net/tun: File descriptor in bad stateurl
2.檢查PPP是否支持MPPE debug
用如下命令檢查PPP是否支持MPPE: server
#strings '/usr/sbin/pppd' |grep -i mppe | wc --lines dns
若是以上命令輸出爲「0」則表示不支持;輸出爲「30」或更大的數字就表示支持,MPPE(Microsoft Point to Point Encryption,微軟點對點加密)。ip
若是支持路由
modprobe ppp_mppe
3.安裝軟件包
yum install ppp pptp pptpd pptp-setup
pptpd 在epel源裏,先配置epel源
vim /etc/yum.repos.d/epel.repo
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=0
[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=0
4.配置文件
vim /etc/pptpd.conf
option /etc/ppp/options.pptpd
logwtmp
localip 10.8.0.1
remoteip 10.8.0.10-100
vim /etc/ppp/options.pptpd
name pptpd
refuse-pap
refuse-chap
refuse-mschap
require-mschap-v2
require-mppe-128
proxyarp
lock
nobsdcomp
novj
novjccomp
nologfd
ms-dns 8.8.8.8
ms-dns 8.8.4.4
vim /etc/ppp/chap-secrets
kick9 pptpd kick9game *
5.路由配置
vim /etc/sysctl.conf
net.ipv4.ip_forward = 1
sysctl -p
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
若是是內網配置的服務,須要在公網路由上開啓端口轉發到本機到1723端口。
6.啓動服務
/etc/init.d/pptpd start
7.客戶端連接
pptpsetup --create *** --server 54.191.71.135 --username kick9 --password kick9game --encrypt --start
客戶端也須要配置路由
route add default dev ppp0
或者
route add -n 0.0.0.0 dev ppp0
到此,pptpd服務配置完畢。