linux 下如何配置 pptp 客户端

一、安装 

1. 安装 pptp、ppp 和 pptp-setup 

yum install -y pptp pptp-setup ppp

二、配置

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

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

pptpsetup --create _name --server _host --username username --password passwd --encrypt --start

_name:自己命名的名称

_host:服务器地址

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/_name: unrecognized option 'pppd'
Apr 21 16:20:41 localhost pppd[5496]: In file /etc/ppp/peers/_name: unrecognized option 'pon

4. 处理

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

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

(2)重新连接

/usr/sbin/pon _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)

 

你可能感兴趣的:(linux)