linux 下如何配置 pptp 客户端

一、安装 

1. 安装 pptp、ppp 和 pptp-setup 

yum install -y pptp pptp-setup ppp

二、配置

1. 配置 pptp 登录信息并登录

(1)配置后会在 /etc/ppp/peers 生成 一个 名字为 vpn_name 的文件

pptpsetup --create vpn_name --server vpn_host --username username --password passwd --encrypt --start

vpn_name:自己命名的vpn名称

vpn_host:vpn服务器地址

username:用户名

password:密码

2. 启动会出现报错

Using interface ppp0
Connect: ppp0 <--> /dev/pts/2
EAP: unknown authentication type 26; Naking
EAP: peer reports authentication failure
Connection terminated.

3. 查看 message 信息

Apr 21 16:19:15 localhost pppd[5480]: pppd 2.4.5 started by root, uid 0
Apr 21 16:19:15 localhost pppd[5480]: Using interface ppp0
Apr 21 16:19:15 localhost pppd[5480]: Connect: ppp0 <--> /dev/pts/2
Apr 21 16:19:15 localhost pptp[5481]: anon log[main:pptp.c:314]: The synchronous pptp option is NOT activated
Apr 21 16:19:15 localhost pptp[5489]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 1 'Start-Control-Connection-Request'
Apr 21 16:19:15 localhost pptp[5489]: anon log[ctrlp_disp:pptp_ctrl.c:739]: Received Start Control Connection Reply
Apr 21 16:19:15 localhost pptp[5489]: anon log[ctrlp_disp:pptp_ctrl.c:773]: Client connection established.
Apr 21 16:19:16 localhost pptp[5489]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 7 'Outgoing-Call-Request'
Apr 21 16:19:16 localhost pptp[5489]: anon log[ctrlp_disp:pptp_ctrl.c:858]: Received Outgoing Call Reply.
Apr 21 16:19:16 localhost pptp[5489]: anon log[ctrlp_disp:pptp_ctrl.c:897]: Outgoing call established (call ID 0, peer's call ID 64556).
Apr 21 16:19:16 localhost pptp[5489]: anon log[ctrlp_disp:pptp_ctrl.c:950]: PPTP_SET_LINK_INFO received from peer_callid 49462
Apr 21 16:19:16 localhost pptp[5489]: anon log[ctrlp_disp:pptp_ctrl.c:953]:   send_accm is 00000000, recv_accm is FFFFFFFF
Apr 21 16:19:16 localhost pptp[5489]: anon warn[ctrlp_disp:pptp_ctrl.c:956]: Non-zero Async Control Character Maps are not supported!
Apr 21 16:19:16 localhost pppd[5480]: EAP: unknown authentication type 26; Naking
Apr 21 16:19:16 localhost pppd[5480]: EAP: peer reports authentication failure
Apr 21 16:19:16 localhost pptp[5489]: anon log[ctrlp_disp:pptp_ctrl.c:950]: PPTP_SET_LINK_INFO received from peer_callid 49462
Apr 21 16:19:16 localhost pptp[5489]: anon log[ctrlp_disp:pptp_ctrl.c:953]:   send_accm is FFFFFFFF, recv_accm is FFFFFFFF
Apr 21 16:19:16 localhost pptp[5489]: anon warn[ctrlp_disp:pptp_ctrl.c:956]: Non-zero Async Control Character Maps are not supported!
Apr 21 16:19:16 localhost pppd[5480]: Connection terminated.
Apr 21 16:19:16 localhost pptp[5489]: anon log[ctrlp_disp:pptp_ctrl.c:912]: Received Call Clear Request.
Apr 21 16:19:16 localhost pptp[5481]: anon warn[decaps_hdlc:pptp_gre.c:204]: short read (-1): Input/output error
Apr 21 16:19:16 localhost pptp[5481]: anon warn[decaps_hdlc:pptp_gre.c:216]: pppd may have shutdown, see pppd log
Apr 21 16:19:16 localhost pppd[5480]: Exit.
Apr 21 16:19:16 localhost pptp[5489]: anon log[callmgr_main:pptp_callmgr.c:234]: Closing connection (unhandled)
Apr 21 16:19:16 localhost pptp[5489]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 12 'Call-Clear-Request'
Apr 21 16:19:16 localhost pptp[5489]: anon log[call_callback:pptp_callmgr.c:79]: Closing connection (call state)
Apr 21 16:20:33 localhost pppd[5494]: In file /etc/ppp/peers/vpn_name: unrecognized option 'pppd'
Apr 21 16:20:41 localhost pppd[5496]: In file /etc/ppp/peers/vpn_name: unrecognized option 'pon

4. 处理

(1)修改 /etc/ppp/options 文件(注意:不是 options.pptp 文件),在 lock 后加如下内容:

refuse-pap
refuse-eap
refuse-chap
refuse-mschap
require-mppe 

(2)重新连接vpn

/usr/sbin/pon vpn_name

5. 拨号信息

(1). 连接成功后系统会生成一个 ppp0 网卡,使用 ifconfig 或 ip addr 查看

ppp0      Link encap:Point-to-Point Protocol  
          inet addr:176.168.201.8  P-t-P:176.168.201.2  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1396  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:324 (324.0 b)  TX bytes:450 (450.0 b)

 

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

啊 这

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值