centos pptp VPN客户端配置


1.安装
yum install pptp pptp-setup
2.配置并启动
pptpsetup --create vpn名称 --server ip地址--username vpn账号 --password vpn密码 --encrypt --start
若出现一下错误:
FATAL: Module ppp_mppe not found.
/usr/sbin/pptpsetup: couldn't find MPPE support in kernel.
加载模块
modprobe ppp_mppe
若出现一下错误:
LCP terminated by peer (MPPE required but peer refused)  
vim /etc/ppp/peers/vpn名称   (这个文件就是创建的对应的PPTP VPN客户端的配置文件)
文件尾部,加上以下内容  
require-mppe-128
若出现一下错误:
LCP terminated by peer
注意安装的时候有这个参数 --encrypt
3.连接vpn
pppd call vpn名称
连接和关闭脚本:
cp /usr/share/doc/ppp-2.4.5/scripts/pon /usr/sbin/
cp /usr/share/doc/ppp-2.4.5/scripts/poff /usr/sbin/
chmod +x /usr/sbin/pon
chmod +x /usr/sbin/poff
4.配置路由:
默认请求都不走vpn
route add -net 0.0.0.0 dev ppp0  #全部请求走vpn
route add -net 192.168.111.0/24 dev ppp0  #部分请求走vpn

密码文件:
/etc/ppp/chap-secrets
日志文件:
/var/log/message