ubuntu 16.04 中的 VPN PPTP 不工作?

ubuntu 16.04 中的 VPN PPTP 不工作?

我填写了以下详细信息答案。但是当我尝试连接时,我得到:

VPN Connection Failed '...because the VPN service stopped'

屏幕右上角的错误信息: 在此处输入图片描述

跑步

tail -f /var/log/syslog

给了我这个:

Mar  9 21:34:20 me NetworkManager[6063]: ** Message: pppd started with pid 8330
Mar  9 21:34:20 me NetworkManager[6063]: <info>  [1489091660.9205] vpn-connection[0x1e067e0,54552dfa-6db2-4050-8b47-fd108b79f201,"VPN connection 1",0]: VPN plugin: state changed: starting (3)
Mar  9 21:34:20 me pppd[8330]: Plugin /usr/lib/pppd/2.4.7/nm-pptp-pppd-plugin.so loaded.
Mar  9 21:34:20 me NetworkManager[6063]: Plugin /usr/lib/pppd/2.4.7/nm-pptp-pppd-plugin.so loaded.
Mar  9 21:34:20 me NetworkManager[6063]: ** Message: nm-pptp-ppp-plugin: (plugin_init): initializing
Mar  9 21:34:20 me pppd[8330]: pppd 2.4.7 started by root, uid 0
Mar  9 21:34:20 me NetworkManager[6063]: ** Message: nm-pptp-ppp-plugin: (nm_phasechange): status 3 / phase 'serial connection'
Mar  9 21:34:20 me pppd[8330]: Using interface ppp0
Mar  9 21:34:20 me NetworkManager[6063]: Using interface ppp0
Mar  9 21:34:20 me NetworkManager[6063]: Connect: ppp0 <--> /dev/pts/19
Mar  9 21:34:20 me NetworkManager[6063]: ** Message: nm-pptp-ppp-plugin: (nm_phasechange): status 5 / phase 'establish'
Mar  9 21:34:20 me NetworkManager[6063]: nm_device_get_device_type: assertion 'NM_IS_DEVICE (self)' failed
Mar  9 21:34:20 me pppd[8330]: Connect: ppp0 <--> /dev/pts/19
Mar  9 21:34:20 me NetworkManager[6063]: <info>  [1489091660.9369] manager: (ppp0): new Generic device (/org/freedesktop/NetworkManager/Devices/6)
Mar  9 21:34:20 me pptp[8335]: nm-pptp-service-8312 log[main:pptp.c:350]: The synchronous pptp option is NOT activated
Mar  9 21:34:20 me NetworkManager[6063]: <info>  [1489091660.9505] devices added (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
Mar  9 21:34:20 me NetworkManager[6063]: <info>  [1489091660.9506] device added (path: /sys/devices/virtual/net/ppp0, iface: ppp0): no ifupdown configuration found.
Mar  9 21:34:20 me pptp[8347]: nm-pptp-service-8312 log[ctrlp_rep:pptp_ctrl.c:259]: Sent control packet type is 1 'Start-Control-Connection-Request'
Mar  9 21:34:20 me pptp[8347]: nm-pptp-service-8312 log[ctrlp_disp:pptp_ctrl.c:781]: Received Start Control Connection Reply
Mar  9 21:34:20 me pptp[8347]: nm-pptp-service-8312 log[ctrlp_disp:pptp_ctrl.c:815]: Client connection established.
Mar  9 21:34:21 me pptp[8347]: nm-pptp-service-8312 log[ctrlp_rep:pptp_ctrl.c:259]: Sent control packet type is 7 'Outgoing-Call-Request'
Mar  9 21:34:21 me pptp[8347]: nm-pptp-service-8312 log[ctrlp_disp:pptp_ctrl.c:900]: Received Outgoing Call Reply.
Mar  9 21:34:21 me pptp[8347]: nm-pptp-service-8312 log[ctrlp_disp:pptp_ctrl.c:939]: Outgoing call established (call ID 34527, peer's call ID 32815).
Mar  9 21:34:51 me pppd[8330]: LCP: timeout sending Config-Requests
Mar  9 21:34:51 me NetworkManager[6063]: LCP: timeout sending Config-Requests
Mar  9 21:34:51 me NetworkManager[6063]: ** Message: nm-pptp-ppp-plugin: (nm_phasechange): status 11 / phase 'disconnect'
Mar  9 21:34:51 me NetworkManager[6063]: Connection terminated.
Mar  9 21:34:51 me pppd[8330]: Connection terminated.
Mar  9 21:34:51 me NetworkManager[6063]: ** Message: Terminated ppp daemon with PID 8330.
Mar  9 21:34:51 me NetworkManager[6063]: <warn>  [1489091691.9659] vpn-connection[0x1e067e0,54552dfa-6db2-4050-8b47-fd108b79f201,"VPN connection 1",0]: VPN plugin: failed: connect-failed (1)
Mar  9 21:34:51 me NetworkManager[6063]: <info>  [1489091691.9661] vpn-connection[0x1e067e0,54552dfa-6db2-4050-8b47-fd108b79f201,"VPN connection 1",0]: VPN plugin: state changed: stopping (5)
Mar  9 21:34:51 me NetworkManager[6063]: <error> [1489091691.9681] platform-linux: do-change-link[13]: failure changing link: failure 19 (No such device)
Mar  9 21:34:51 me NetworkManager[6063]: <warn>  [1489091691.9682] device (ppp0): failed to disable userspace IPv6LL address handling
Mar  9 21:34:51 me NetworkManager[6063]: <info>  [1489091691.9693] vpn-connection[0x1e067e0,54552dfa-6db2-4050-8b47-fd108b79f201,"VPN connection 1",0]: VPN plugin: state changed: stopped (6)
Mar  9 21:34:51 me NetworkManager[6063]: <info>  [1489091691.9710] vpn-connection[0x1e067e0,54552dfa-6db2-4050-8b47-fd108b79f201,"VPN connection 1",0]: VPN plugin: state change reason: unknown (0)
Mar  9 21:34:51 me NetworkManager[6063]: <info>  [1489091691.9719] vpn-connection[0x1e067e0,54552dfa-6db2-4050-8b47-fd108b79f201,"VPN connection 1",0]: VPN service disappeared
Mar  9 21:34:51 me NetworkManager[6063]: <info>  [1489091691.9727] devices removed (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
Mar  9 21:34:51 me NetworkManager[6063]: ** Message: nm-pptp-ppp-plugin: (nm_phasechange): status 1 / phase 'dead'
Mar  9 21:34:51 me NetworkManager[6063]: Terminating on signal 15
Mar  9 21:34:51 me NetworkManager[6063]: Child process /usr/sbin/pptp 217.145.41.15 --nolaunchpppd --loglevel 0 --logstring nm-pptp-service-8312 (pid 8333) terminated with signal 15
Mar  9 21:34:51 me NetworkManager[6063]: Modem hangup
Mar  9 21:34:51 me NetworkManager[6063]: ** Message: nm-pptp-ppp-plugin: (nm_exit_notify): cleaning up
Mar  9 21:34:51 me pptp[8335]: nm-pptp-service-8312 warn[decaps_hdlc:pptp_gre.c:220]: short read (-1): Input/output error
Mar  9 21:34:51 me pptp[8335]: nm-pptp-service-8312 warn[decaps_hdlc:pptp_gre.c:232]: pppd may have shutdown, see pppd log
Mar  9 21:34:51 me pppd[8330]: Terminating on signal 15
Mar  9 21:34:51 me pppd[8330]: Child process /usr/sbin/pptp 217.145.41.15 --nolaunchpppd --loglevel 0 --logstring nm-pptp-service-8312 (pid 8333) terminated with signal 15
Mar  9 21:34:51 me pppd[8330]: Modem hangup
Mar  9 21:34:51 me pptp[8347]: nm-pptp-service-8312 log[callmgr_main:pptp_callmgr.c:245]: Closing connection (unhandled)
Mar  9 21:34:51 me pptp[8347]: nm-pptp-service-8312 log[ctrlp_rep:pptp_ctrl.c:259]: Sent control packet type is 12 'Call-Clear-Request'
Mar  9 21:34:51 me pptp[8347]: nm-pptp-service-8312 log[call_callback:pptp_callmgr.c:84]: Closing connection (call state)
Mar  9 21:34:51 me pppd[8330]: Exit.

在此处输入图片描述

答案1

您可以使用以下步骤从终端配置 pptp VPN 服务器和客户端:

VPN 服务器设置:

安装并更新VPN服务器和客户端包:

$ sudo apt-get install pptpd ppp pptp-linux

必须为服务器配置四个文件:

  • /etc/pptpd.conf
  • /etc/ppp/pptpd 选项
  • /etc/ppp/选项
  • /etc/聊天秘密)

/etc/pptpd.conf:

选项 /etc/ppp/pptpd-options
日志记录
本地IP 192.168.23.20
远程IP 192.168.23.30-39

/etc/ppp/pptpd-选项:

名称 pptpd
拒绝
拒绝
拒绝mschap
需要 mschap-v​​2
需要-mppe-128
代理ARP
无默认路由
诺布斯德科姆
noipx ## 你不需要 IPX
mtu 1490 ## 可能有助于您的 Linux 客户端断开连接
mru 1490 ## 可能有助于您的 Linux 客户端断开连接

/etc/ppp/选项:

lock

/etc/ppp/chap-secrets:

# 使用 CHAP 进行身份验证的秘密
# 客户端服务器秘密 IP 地址

[用户名] pptpd [用户密码] *

([用户名] 和 [用户密码] 是不带括号的条目。)

现在使用以下命令重新启动服务器:

$ sudo service pptpd restart

VPN 客户端设置:

涉及四个配置文件:

  • /etc/ppp/peers/myvpn
  • /etc/ppp/options.pptp
  • /etc/ppp/chap-秘密
  • /etc/ppp/ip-up.local

在 /etc/ppp/peers/myvpn 中:

# 将括号参数替换为 VPN 服务器和 VPN 用户的主机名
远程名称 myvpn
链接名称 myvpn
ipparam myvpn
pty“pptp [vpn 服务器] --nolaunchpppd”
name [用户名]
使用peerdns
需要-mppe
拒绝 EAP
沒有授權

# 采用 pptp-linux 包中的默认值
文件 /etc/ppp/options.pptp

/etc/ppp/options.pptp:


沒有授權
拒绝
拒绝 EAP
拒绝
拒绝mschap
诺布斯德科姆
节点放气

/etc/ppp/chap-secrets:

# 使用 CHAP 进行身份验证的秘密
# 客户端服务器秘密 IP 地址
用户名 myvpn 密码 *

/etc/ppp/ip-up.local:

/bin/sh #!/bin/sh 复制代码
网络 =`echo $IPREMOTE | awk -F\。'{print $1"."$2"."$3".0/24"}'`
路线添加-net $ network $ IFNAME

将 VPN 客户端连接到:

$ sudo pon myvpn

使用以下命令结束 VPN 连接:

$ sudo poff myvpn

答案2

修改自@LDJames 解决方案

Ubuntu 16.04

VPN 客户端设置:

涉及四个配置文件:

  • /etc/ppp/peers/myvpn
  • /etc/ppp/options.pptp
  • /etc/ppp/chap-秘密
  • /etc/ppp/ip-up.local

在 /etc/ppp/peers/myvpn 中:

# 将括号参数替换为 VPN 服务器和 VPN 用户的主机名
远程名称 myvpn
链接名称 myvpn
ipparam myvpn
pty “pptp 1.2.3.4 --nolaunchpppd --loglevel 0”
节点放气
名称 登录名
使用peerdns
需要-mppe
沒有授權
需要-mppe-128
  1. 改变1.2.3.4到您的 VPN 主机 IP 地址。和
  2. 改变登录名到您的登录名

/etc/ppp/options.pptp:


沒有授權
拒绝
拒绝 EAP
拒绝
拒绝mschap
诺布斯德科姆
节点放气
名称 登录名
需要-mppe-128
ipparam myvpn
  1. 改变登录名到您的登录名

/etc/ppp/chap-secrets:

# 使用 CHAP 进行身份验证的秘密
# 客户端服务器秘密 IP 地址
登录名 myvpn 登录密码 *
  1. 改变登录名到您的登录名
  2. 改变登录密码您的登录密码

/etc/ppp/ip-up.local:

/bin/sh #!/bin/sh 复制代码
网络 =`echo $IPREMOTE | awk -F\。'{print $1"."$2"."$3".0/24"}'`
路线添加-net $ network $ IFNAME

使用以下命令启动 VPN 客户端:

$ sudo pon vicomvpn dump logfd 2 nodetach
pppd options in effect:
nodetach        # (from command line)
logfd 2     # (from command line)
linkname myvpn      # (from /etc/ppp/peers/myvpn)
dump        # (from command line)
noauth      # (from /etc/ppp/peers/vicomvpn)
name LoginName      # (from /etc/ppp/peers/myvpn)
remotename myvpn        # (from /etc/ppp/peers/myvpn)
        # (from /etc/ppp/peers/myvpn)
pty pptp 1.2.3.4 --nolaunchpppd --loglevel 0        # (from /etc/ppp/peers/myvpn)
crtscts     # (from /etc/ppp/options)
        # (from /etc/ppp/options)
asyncmap 0      # (from /etc/ppp/options)
lcp-echo-failure 4      # (from /etc/ppp/options)
lcp-echo-interval 30        # (from /etc/ppp/options)
hide-password       # (from /etc/ppp/options)
ipparam myvpn       # (from /etc/ppp/peers/myvpn)
usepeerdns      # (from /etc/ppp/peers/myvpn)
nodeflate       # (from /etc/ppp/peers/myvpn)
require-mppe        # (from /etc/ppp/peers/myvpn)
require-mppe-128        # (from /etc/ppp/peers/myvpn)
noipx       # (from /etc/ppp/options)
Using interface ppp0
Connect: ppp0 <--> /dev/pts/22
CHAP authentication succeeded
MPPE 128-bit stateless compression enabled
local  IP address 192.168.1.142
remote IP address 192.168.1.1
primary   DNS address 19.168.1.1

使用以下命令结束 VPN 连接:

$ sudo poff myvpn

参考 :MS-CHAP[v2] 身份验证,使用 pptpclient 设置 Microsoft VPN 客户端

相关内容