博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Centos7下安装pptp客户端

Posted on 2017-07-11 16:04  luminary  阅读(1808)  评论(0)    收藏  举报

1.使用yum安装ppp和pptp

yum install ppp pptp

2.配置pptp

pptpsetup --create vpn连接名称(自定义) --server VPN服务器IP --username VPN用户名 --password VPN密码
执行完成以后会生成文件 /etc/ppp/peers/vpn连接名称(自定义)
编辑该文件:

# written by pptpsetup
pty "pptp VPN服务器IP --nolaunchpppd"
lock
#noauth
nobsdcomp
nodeflate
name VPN用户名
remotename vpn连接名称(自定义)
ipparam 服务器ip
require-mppe

3. 复制命令

cp /usr/share/doc/ppp-2.4.4/scripts/pon /usr/sbin/
cp /usr/share/doc/ppp-2.4.4/scripts/poff /usr/sbin/
chmod +x /usr/sbin/pon /usr/sbin/poff

4.拨vpn

pon vpn连接名称(自定义)

5.查看是否连接

ifconfig
————————————————————————————————————-
ppp0 Link encap:Point-to-Point Protocol
inet addr:192.168.2.224 P-t-P:192.168.2.200 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1396 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:80 (80.0 b) TX bytes:80 (80.0 b)
————————————————————————————————————-

6.断开连接

poff vpn连接名称(自定义)
至此,安装完成。

7.连接完毕要添加路由才能上网

route add default dev ppp0

 8.如果出现LCP: timeout sending Config-Requests的问题

# 在内核版本为3.18或者更高时,模式在开机时已经加载了nf_conntrack_pptp模块
# 如果低版本内核,开机没有加载该模块,需要手动加载
modprobe nf_conntrack_pptp