我使用 ubuntu 14.04,今天当我连接到我的 pptp vpn 时,它失败了;我不知道该怎么办。
我看到以下消息/var/log/syslog
:
Apr 14 12:20:29 Lenovo-G470-ubuntu NetworkManager[888]: <info> VPN service 'pptp' disappeared
Apr 14 12:20:45 Lenovo-G470-ubuntu NetworkManager[888]: <info> Starting VPN service 'pptp'...
Apr 14 12:20:45 Lenovo-G470-ubuntu NetworkManager[888]: <info> VPN service 'pptp' started (org.freedesktop.NetworkManager.pptp), PID 5149
Apr 14 12:20:45 Lenovo-G470-ubuntu NetworkManager[888]: <info> VPN service 'pptp' appeared; activating connections
Apr 14 12:20:45 Lenovo-G470-ubuntu NetworkManager[888]: <info> VPN plugin state changed: init (1)
Apr 14 12:20:45 Lenovo-G470-ubuntu NetworkManager[888]: <info> VPN plugin state changed: starting (3)
Apr 14 12:20:45 Lenovo-G470-ubuntu NetworkManager[888]: <info> VPN connection 'VPN 连接 2' (Connect) reply received.
Apr 14 12:20:45 Lenovo-G470-ubuntu pppd[5153]: Plugin /usr/lib/pppd/2.4.5/nm-pptp-pppd-plugin.so loaded.
Apr 14 12:20:45 Lenovo-G470-ubuntu pppd[5153]: pppd 2.4.5 started by root, uid 0
Apr 14 12:20:45 Lenovo-G470-ubuntu pppd[5153]: Using interface ppp0
Apr 14 12:20:45 Lenovo-G470-ubuntu pppd[5153]: Connect: ppp0 <--> /dev/pts/15
Apr 14 12:20:45 Lenovo-G470-ubuntu NetworkManager[888]: SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
Apr 14 12:20:45 Lenovo-G470-ubuntu NetworkManager[888]: SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/ppp0, iface: ppp0): no ifupdown configuration found.
Apr 14 12:20:45 Lenovo-G470-ubuntu NetworkManager[888]: <warn> /sys/devices/virtual/net/ppp0: couldn't determine device driver; ignoring...
Apr 14 12:20:45 Lenovo-G470-ubuntu pptp[5159]: nm-pptp-service-5149 log[main:pptp.c:314]: The synchronous pptp option is NOT activated
Apr 14 12:20:45 Lenovo-G470-ubuntu pptp[5171]: nm-pptp-service-5149 log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 1 'Start-Control-Connection-Request'
Apr 14 12:20:45 Lenovo-G470-ubuntu pptp[5171]: nm-pptp-service-5149 log[ctrlp_disp:pptp_ctrl.c:739]: Received Start Control Connection Reply
Apr 14 12:20:45 Lenovo-G470-ubuntu pptp[5171]: nm-pptp-service-5149 log[ctrlp_disp:pptp_ctrl.c:773]: Client connection established.
Apr 14 12:20:46 Lenovo-G470-ubuntu pptp[5171]: nm-pptp-service-5149 log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 7 'Outgoing-Call-Request'
Apr 14 12:20:46 Lenovo-G470-ubuntu pptp[5171]: nm-pptp-service-5149 log[ctrlp_disp:pptp_ctrl.c:858]: Received Outgoing Call Reply.
Apr 14 12:20:46 Lenovo-G470-ubuntu pptp[5171]: nm-pptp-service-5149 log[ctrlp_disp:pptp_ctrl.c:897]: Outgoing call established (call ID 0, peer's call ID 53504).
Apr 14 12:20:49 Lenovo-G470-ubuntu kernel: [ 5657.862831] [UFW BLOCK] IN=eth0 OUT= MAC=dc:0e:a1:e2:13:94:28:2c:b2:fc:fd:73:08:00 SRC=199.101.117.111 DST=192.168.2.120 LEN=46 TOS=0x00 PREC=0x00 TTL=47 ID=13330 PROTO=47
Apr 14 12:20:49 Lenovo-G470-ubuntu kernel: [ 5657.862881] [UFW BLOCK] IN=eth0 OUT= MAC=dc:0e:a1:e2:13:94:28:2c:b2:fc:fd:73:08:00 SRC=199.101.117.111 DST=192.168.2.120 LEN=42 TOS=0x00 PREC=0x00 TTL=47 ID=13331 PROTO=47
Apr 14 12:20:49 Lenovo-G470-ubuntu kernel: [ 5657.963781] [UFW BLOCK] IN=eth0 OUT= MAC=dc:0e:a1:e2:13:94:28:2c:b2:fc:fd:73:08:00 SRC=199.101.117.111 DST=192.168.2.120 LEN=59 TOS=0x00 PREC=0x00 TTL=47 ID=13332 PROTO=47
Apr 14 12:21:10 Lenovo-G470-ubuntu kernel: [ 5678.873164] [UFW BLOCK] IN=eth0 OUT= MAC=dc:0e:a1:e2:13:94:28:2c:b2:fc:fd:73:08:00 SRC=199.101.117.111 DST=192.168.2.120 LEN=46 TOS=0x00 PREC=0x00 TTL=47 ID=13345 PROTO=47
Apr 14 12:21:16 Lenovo-G470-ubuntu pppd[5153]: LCP: timeout sending Config-Requests
Apr 14 12:21:16 Lenovo-G470-ubuntu pppd[5153]: Connection terminated.
Apr 14 12:21:16 Lenovo-G470-ubuntu NetworkManager[888]: <warn> VPN plugin failed: 1
Apr 14 12:21:16 Lenovo-G470-ubuntu NetworkManager[888]: SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
Apr 14 12:21:16 Lenovo-G470-ubuntu pptp[5159]: nm-pptp-service-5149 warn[decaps_hdlc:pptp_gre.c:204]: short read (-1): Input/output error
Apr 14 12:21:16 Lenovo-G470-ubuntu pptp[5159]: nm-pptp-service-5149 warn[decaps_hdlc:pptp_gre.c:216]: pppd may have shutdown, see pppd log
Apr 14 12:21:16 Lenovo-G470-ubuntu pppd[5153]: Modem hangup
Apr 14 12:21:16 Lenovo-G470-ubuntu pptp[5171]: nm-pptp-service-5149 log[callmgr_main:pptp_callmgr.c:234]: Closing connection (unhandled)
Apr 14 12:21:16 Lenovo-G470-ubuntu pptp[5171]: nm-pptp-service-5149 log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 12 'Call-Clear-Request'
Apr 14 12:21:16 Lenovo-G470-ubuntu pptp[5171]: nm-pptp-service-5149 log[call_callback:pptp_callmgr.c:79]: Closing connection (call state)
Apr 14 12:21:16 Lenovo-G470-ubuntu pppd[5153]: Exit.
Apr 14 12:21:16 Lenovo-G470-ubuntu NetworkManager[888]: <warn> VPN plugin failed: 1
Apr 14 12:21:16 Lenovo-G470-ubuntu NetworkManager[888]: <warn> VPN plugin failed: 1
Apr 14 12:21:16 Lenovo-G470-ubuntu NetworkManager[888]: <info> VPN plugin state changed: stopped (6)
Apr 14 12:21:16 Lenovo-G470-ubuntu NetworkManager[888]: <info> VPN plugin state change reason: 0
Apr 14 12:21:16 Lenovo-G470-ubuntu NetworkManager[888]: <info> Policy set '自动以太网' (eth0) as default for IPv4 routing and DNS.
Apr 14 12:21:16 Lenovo-G470-ubuntu NetworkManager[888]: <warn> error disconnecting VPN: Could not process the request because no VPN connection was active.
Apr 14 12:21:18 Lenovo-G470-ubuntu kernel: [ 5686.892463] [UFW BLOCK] IN=eth0 OUT= MAC=01:00:5e:00:00:fb:68:5b:35:81:3d:a1:08:00 SRC=192.168.1.22 DST=224.0.0.251 LEN=32 TOS=0x00 PREC=0x00 TTL=1 ID=4346 PROTO=2
Apr 14 12:21:19 Lenovo-G470-ubuntu kernel: [ 5687.821489] [UFW BLOCK] IN=eth0 OUT= MAC=01:00:5e:00:00:fb:68:5b:35:7b:6c:04:08:00 SRC=192.168.2.139 DST=224.0.0.251 LEN=32 TOS=0x00 PREC=0x00 TTL=1 ID=28029 PROTO=2
在谷歌上搜索后,我安装了 network-manager-pptp 和 network-manager-vpnc。
它在 android 和 win8.1 上工作正常,但在 ubuntu 上就失败了。
以下是我的一些 vpn 配置:(我无法上传图片)
1.我填写了 VPN 网关、用户名、密码
2.在高级配置中,我检查了 MPPE 并删除了 PAP、CHAP、EAP
有人能帮助我吗?
或者需要更多详细信息?
编辑一个
这样做之后sudo ufw allow proto udp from 199.101.117.111 port 47 to 192.168.2.120 port 47
似乎不起作用。以下是更新的信息:
Apr 14 15:11:34 Lenovo-G470-ubuntu NetworkManager[866]: <info> Starting VPN service 'pptp'...
Apr 14 15:11:34 Lenovo-G470-ubuntu NetworkManager[866]: <info> VPN service 'pptp' started (org.freedesktop.NetworkManager.pptp), PID 4423
Apr 14 15:11:34 Lenovo-G470-ubuntu NetworkManager[866]: <info> VPN service 'pptp' appeared; activating connections
Apr 14 15:11:34 Lenovo-G470-ubuntu NetworkManager[866]: <info> VPN plugin state changed: starting (3)
Apr 14 15:11:34 Lenovo-G470-ubuntu NetworkManager[866]: <info> VPN connection 'VPN 连接 2' (Connect) reply received.
Apr 14 15:11:34 Lenovo-G470-ubuntu pppd[4427]: Plugin /usr/lib/pppd/2.4.5/nm-pptp-pppd-plugin.so loaded.
Apr 14 15:11:34 Lenovo-G470-ubuntu pppd[4427]: pppd 2.4.5 started by root, uid 0
Apr 14 15:11:34 Lenovo-G470-ubuntu pppd[4427]: Using interface ppp0
Apr 14 15:11:34 Lenovo-G470-ubuntu pppd[4427]: Connect: ppp0 <--> /dev/pts/0
Apr 14 15:11:34 Lenovo-G470-ubuntu pptp[4431]: nm-pptp-service-4423 log[main:pptp.c:314]: The synchronous pptp option is NOT activated
Apr 14 15:11:34 Lenovo-G470-ubuntu NetworkManager[866]: SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
Apr 14 15:11:34 Lenovo-G470-ubuntu NetworkManager[866]: SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/ppp0, iface: ppp0): no ifupdown configuration found.
Apr 14 15:11:34 Lenovo-G470-ubuntu NetworkManager[866]: <warn> /sys/devices/virtual/net/ppp0: couldn't determine device driver; ignoring...
Apr 14 15:11:34 Lenovo-G470-ubuntu pptp[4445]: nm-pptp-service-4423 log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 1 'Start-Control-Connection-Request'
Apr 14 15:11:34 Lenovo-G470-ubuntu pptp[4445]: nm-pptp-service-4423 log[ctrlp_disp:pptp_ctrl.c:739]: Received Start Control Connection Reply
Apr 14 15:11:34 Lenovo-G470-ubuntu pptp[4445]: nm-pptp-service-4423 log[ctrlp_disp:pptp_ctrl.c:773]: Client connection established.
Apr 14 15:11:35 Lenovo-G470-ubuntu pptp[4445]: nm-pptp-service-4423 log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 7 'Outgoing-Call-Request'
Apr 14 15:11:35 Lenovo-G470-ubuntu pptp[4445]: nm-pptp-service-4423 log[ctrlp_disp:pptp_ctrl.c:858]: Received Outgoing Call Reply.
Apr 14 15:11:35 Lenovo-G470-ubuntu pptp[4445]: nm-pptp-service-4423 log[ctrlp_disp:pptp_ctrl.c:897]: Outgoing call established (call ID 0, peer's call ID 55680).
Apr 14 15:11:35 Lenovo-G470-ubuntu kernel: [ 1229.669311] [UFW BLOCK] IN=eth0 OUT= MAC=dc:0e:a1:e2:13:94:28:2c:b2:fc:fd:73:08:00 SRC=199.101.117.111 DST=192.168.2.120 LEN=59 TOS=0x00 PREC=0x00 TTL=47 ID=38683 PROTO=47
Apr 14 15:11:37 Lenovo-G470-ubuntu kernel: [ 1231.530488] [UFW BLOCK] IN=eth0 OUT= MAC=dc:0e:a1:e2:13:94:28:2c:b2:fc:fd:73:08:00 SRC=199.101.117.111 DST=192.168.2.120 LEN=46 TOS=0x00 PREC=0x00 TTL=47 ID=38684 PROTO=47
Apr 14 15:11:51 Lenovo-G470-ubuntu dbus[781]: [system] Activating service name='org.freedesktop.hostname1' (using servicehelper)
Apr 14 15:11:51 Lenovo-G470-ubuntu dbus[781]: [system] Successfully activated service 'org.freedesktop.hostname1'
Apr 14 15:11:51 Lenovo-G470-ubuntu kernel: [ 1246.012237] systemd-hostnamed[4456]: Warning: nss-myhostname is not installed. Changing the local hostname might make it unresolveable. Please install nss-myhostname!
Apr 14 15:11:54 Lenovo-G470-ubuntu ntfs-3g[4466]: Version 2013.1.13AR.1 external FUSE 29
Apr 14 15:11:54 Lenovo-G470-ubuntu ntfs-3g[4466]: Mounted /dev/sdb8 (Read-Write, label "", NTFS 3.1)
Apr 14 15:11:54 Lenovo-G470-ubuntu ntfs-3g[4466]: Cmdline options: rw,nosuid,nodev,uhelper=udisks2,uid=1000,gid=1000,dmask=0077,fmask=0177
Apr 14 15:11:54 Lenovo-G470-ubuntu ntfs-3g[4466]: Mount options: rw,nosuid,nodev,uhelper=udisks2,allow_other,nonempty,relatime,default_permissions,fsname=/dev/sdb8,blkdev,blksize=4096
Apr 14 15:11:54 Lenovo-G470-ubuntu ntfs-3g[4466]: Global ownership and permissions enforced, configuration type 7
Apr 14 15:11:54 Lenovo-G470-ubuntu udisksd[2762]: Mounted /dev/sdb8 at /media/zerolu/00085E86000034F91 on behalf of uid 1000
Apr 14 15:11:56 Lenovo-G470-ubuntu ntfs-3g[4472]: Version 2013.1.13AR.1 external FUSE 29
Apr 14 15:11:56 Lenovo-G470-ubuntu ntfs-3g[4472]: Mounted /dev/sdb7 (Read-Write, label "", NTFS 3.1)
Apr 14 15:11:56 Lenovo-G470-ubuntu ntfs-3g[4472]: Cmdline options: rw,nosuid,nodev,uhelper=udisks2,uid=1000,gid=1000,dmask=0077,fmask=0177
Apr 14 15:11:56 Lenovo-G470-ubuntu ntfs-3g[4472]: Mount options: rw,nosuid,nodev,uhelper=udisks2,allow_other,nonempty,relatime,default_permissions,fsname=/dev/sdb7,blkdev,blksize=4096
Apr 14 15:11:56 Lenovo-G470-ubuntu ntfs-3g[4472]: Global ownership and permissions enforced, configuration type 7
Apr 14 15:11:56 Lenovo-G470-ubuntu udisksd[2762]: Mounted /dev/sdb7 at /media/zerolu/000538A60008D56E1 on behalf of uid 1000
Apr 14 15:11:56 Lenovo-G470-ubuntu kernel: [ 1250.597804] [UFW BLOCK] IN=eth0 OUT= MAC=dc:0e:a1:e2:13:94:28:2c:b2:fc:fd:73:08:00 SRC=199.101.117.111 DST=192.168.2.120 LEN=46 TOS=0x00 PREC=0x00 TTL=47 ID=38697 PROTO=47
Apr 14 15:11:58 Lenovo-G470-ubuntu ntfs-3g[4477]: Version 2013.1.13AR.1 external FUSE 29
Apr 14 15:11:58 Lenovo-G470-ubuntu ntfs-3g[4477]: Mounted /dev/sdb9 (Read-Write, label "", NTFS 3.1)
Apr 14 15:11:58 Lenovo-G470-ubuntu ntfs-3g[4477]: Cmdline options: rw,nosuid,nodev,uhelper=udisks2,uid=1000,gid=1000,dmask=0077,fmask=0177
Apr 14 15:11:58 Lenovo-G470-ubuntu ntfs-3g[4477]: Mount options: rw,nosuid,nodev,uhelper=udisks2,allow_other,nonempty,relatime,default_permissions,fsname=/dev/sdb9,blkdev,blksize=4096
Apr 14 15:11:58 Lenovo-G470-ubuntu ntfs-3g[4477]: Global ownership and permissions enforced, configuration type 7
Apr 14 15:11:58 Lenovo-G470-ubuntu udisksd[2762]: Mounted /dev/sdb9 at /media/zerolu/0000A4090008A876 on behalf of uid 1000
Apr 14 15:12:05 Lenovo-G470-ubuntu pppd[4427]: LCP: timeout sending Config-Requests
Apr 14 15:12:05 Lenovo-G470-ubuntu pppd[4427]: Connection terminated.
Apr 14 15:12:05 Lenovo-G470-ubuntu NetworkManager[866]: <warn> VPN plugin failed: 1
Apr 14 15:12:05 Lenovo-G470-ubuntu NetworkManager[866]: SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
Apr 14 15:12:05 Lenovo-G470-ubuntu pppd[4427]: Modem hangup
Apr 14 15:12:05 Lenovo-G470-ubuntu pptp[4431]: nm-pptp-service-4423 warn[decaps_hdlc:pptp_gre.c:204]: short read (-1): Input/output error
Apr 14 15:12:05 Lenovo-G470-ubuntu pptp[4431]: nm-pptp-service-4423 warn[decaps_hdlc:pptp_gre.c:216]: pppd may have shutdown, see pppd log
Apr 14 15:12:05 Lenovo-G470-ubuntu pptp[4445]: nm-pptp-service-4423 log[callmgr_main:pptp_callmgr.c:234]: Closing connection (unhandled)
Apr 14 15:12:05 Lenovo-G470-ubuntu pptp[4445]: nm-pptp-service-4423 log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 12 'Call-Clear-Request'
Apr 14 15:12:05 Lenovo-G470-ubuntu pptp[4445]: nm-pptp-service-4423 log[call_callback:pptp_callmgr.c:79]: Closing connection (call state)
Apr 14 15:12:05 Lenovo-G470-ubuntu NetworkManager[866]: <warn> VPN plugin failed: 1
Apr 14 15:12:05 Lenovo-G470-ubuntu pppd[4427]: Exit.
Apr 14 15:12:05 Lenovo-G470-ubuntu NetworkManager[866]: <warn> VPN plugin failed: 1
Apr 14 15:12:05 Lenovo-G470-ubuntu NetworkManager[866]: <info> VPN plugin state changed: stopped (6)
Apr 14 15:12:05 Lenovo-G470-ubuntu NetworkManager[866]: <info> VPN plugin state change reason: 0
Apr 14 15:12:05 Lenovo-G470-ubuntu NetworkManager[866]: <info> Policy set '自动以太网' (eth0) as default for IPv4 routing and DNS.
Apr 14 15:12:05 Lenovo-G470-ubuntu NetworkManager[866]: <warn> error disconnecting VPN: Could not process the request because no VPN connection was active.
Apr 14 15:12:10 Lenovo-G470-ubuntu NetworkManager[866]: <info> VPN service 'pptp' disappeared
编辑二
我已经通过恢复系统解决了这个问题并且它起作用了。
答案1
根据输出允许从 vpn 服务器到您的电脑的流量port 47
。
PPTP
用户gre (Generic Routing Encapsulation)
协议。此协议使用 vpn 服务器并将udp
数据包发送到 上的您的 PC port 47
。没有此协议,pptp
连接是不可能的。
sudo ufw allow proto udp from 199.101.117.111 port 47 to 192.168.2.120 port 47
这是第一步,根据结果和配置,vpn server
我们可以讨论mppe
,,...... chap
pap
编辑一
因为我的第一个答案没有可行的解决方案,所以尝试允许来自 vpn 服务器的所有流量
sudo ufw allow vpn_server_address
如果仍然无法连接,也许是出了问题nm-pptp-pppd-plugin
。
尝试使用此脚本
创建具有某个名称的文件并输入
nano name_of_script
脚本
#!/bin/bash
function routeadd {
route add -host xxx.xxx.xxx.xxx dev ppp0
route add -net xxx.xxx.xxx.xxx/xx dev ppp0
}
function makepptp {
echo pty \"pptp xxx.xxx.xxx.xxx --nolaunchpppd\" >> /etc/ppp/peers/vpn;
echo remotename PPTP >> /etc/ppp/peers/vpn;
echo require-mppe-128 >> /etc/ppp/peers/vpn;
echo file /etc/ppp/options.pptp >> /etc/ppp/peers/vpn;
echo ipparam vpn >> /etc/ppp/peers/vpn;
pppd call vpn &
}
if [ -a /etc/ppp/chap-secrets ];
then
rm /etc/ppp/chap-secrets
echo $1 PPTP $2 '*' >> /etc/ppp/chap-secrets;
else
echo $1 PPTP $2 '*' >> /etc/ppp/chap-secrets;
fi
if [ -e /etc/ppp/peers/vpn ];
then
rm /etc/ppp/peers/vpn;
echo name $1 >> /etc/ppp/peers/vpn;
makepptp;
sleep 8;
routeadd;
else
echo name $1 >> /etc/ppp/peers/vpn;
makepptp;
sleep 8;
routeadd;
fi
在脚本中更改主机 IP 并添加您希望通过 VPN 连接的网络或/和主机
用法:
sudo /path_to_script/name_of_script username password
笔记:设置脚本的执行权限