我正在尝试连接到工作 VPN,但每次尝试连接时都会失败。VPN 已在网络管理器 UI 中配置,并且连接也从那里开始。我检查了系统日志并看到以下内容:
Jan 28 08:29:09 cwlt NetworkManager[751]: <info> Starting VPN service 'pptp'...
Jan 28 08:29:09 cwlt NetworkManager[751]: <info> VPN service 'pptp' started (org.freedesktop.NetworkManager.pptp), PID 6383
Jan 28 08:29:09 cwlt NetworkManager[751]: <info> VPN service 'pptp' appeared; activating connections
Jan 28 08:29:09 cwlt NetworkManager[751]: <info> VPN plugin state changed: starting (3)
Jan 28 08:29:09 cwlt NetworkManager[751]: <info> VPN connection 'VPN' (Connect) reply received.
Jan 28 08:29:09 cwlt pppd[6387]: Plugin /usr/lib/pppd/2.4.5/nm-pptp-pppd-plugin.so loaded.
Jan 28 08:29:09 cwlt pppd[6387]: pppd 2.4.5 started by root, uid 0
Jan 28 08:29:09 cwlt pppd[6387]: using channel 10
Jan 28 08:29:09 cwlt pppd[6387]: Using interface ppp0
Jan 28 08:29:09 cwlt pppd[6387]: Connect: ppp0 <--> /dev/pts/4
Jan 28 08:29:09 cwlt NetworkManager[751]: SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
Jan 28 08:29:09 cwlt NetworkManager[751]: SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/ppp0, iface: ppp0): no ifupdown configuration found.
Jan 28 08:29:09 cwlt NetworkManager[751]: <warn> /sys/devices/virtual/net/ppp0: couldn't determine device driver; ignoring...
Jan 28 08:29:09 cwlt pptp[6391]: nm-pptp-service-6383 log[main:pptp.c:314]: The synchronous pptp option is NOT activated
Jan 28 08:29:09 cwlt whoopsie[1138]: online
Jan 28 08:29:09 cwlt pptp[6405]: nm-pptp-service-6383 log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 1 'Start-Control-Connection-Request'
Jan 28 08:29:09 cwlt pptp[6405]: nm-pptp-service-6383 log[ctrlp_disp:pptp_ctrl.c:739]: Received Start Control Connection Reply
Jan 28 08:29:09 cwlt pptp[6405]: nm-pptp-service-6383 log[ctrlp_disp:pptp_ctrl.c:773]: Client connection established.
Jan 28 08:29:10 cwlt pptp[6405]: nm-pptp-service-6383 log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 7 'Outgoing-Call-Request'
Jan 28 08:29:10 cwlt whoopsie[1138]: online
Jan 28 08:29:10 cwlt pptp[6405]: nm-pptp-service-6383 log[ctrlp_disp:pptp_ctrl.c:858]: Received Outgoing Call Reply.
Jan 28 08:29:10 cwlt pptp[6405]: nm-pptp-service-6383 log[ctrlp_disp:pptp_ctrl.c:897]: Outgoing call established (call ID 0, peer's call ID 42341).
Jan 28 08:29:49 cwlt NetworkManager[751]: <warn> VPN connection 'Fluency Labs VPN' (IP Config Get) timeout exceeded.
Jan 28 08:29:49 cwlt NetworkManager[751]: <info> Policy set 'VM529841-5G' (eth1) as default for IPv4 routing and DNS.
Jan 28 08:29:49 cwlt pppd[6387]: Terminating on signal 15
Jan 28 08:29:49 cwlt pppd[6387]: Connection terminated.
Jan 28 08:29:49 cwlt avahi-daemon[709]: Withdrawing workstation service for ppp0.
Jan 28 08:29:49 cwlt NetworkManager[751]: SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
Jan 28 08:29:49 cwlt pppd[6387]: Child process /usr/sbin/pptp xxx.xxx.xxx.xxx --nolaunchpppd --loglevel 0 --logstring nm-pptp-service-6383 (pid 6389) terminated with signal 15
Jan 28 08:29:49 cwlt pppd[6387]: Exit.
Jan 28 08:29:49 cwlt pptp[6391]: nm-pptp-service-6383 warn[decaps_hdlc:pptp_gre.c:204]: short read (-1): Input/output error
Jan 28 08:29:49 cwlt pptp[6391]: nm-pptp-service-6383 warn[decaps_hdlc:pptp_gre.c:216]: pppd may have shutdown, see pppd log
Jan 28 08:29:49 cwlt pptp[6405]: nm-pptp-service-6383 log[callmgr_main:pptp_callmgr.c:234]: Closing connection (unhandled)
Jan 28 08:29:49 cwlt pptp[6405]: nm-pptp-service-6383 log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 12 'Call-Clear-Request'
Jan 28 08:29:49 cwlt pptp[6405]: nm-pptp-service-6383 log[call_callback:pptp_callmgr.c:79]: Closing connection (call state)
Jan 28 08:29:54 cwlt NetworkManager[751]: <info> VPN service 'pptp' disappeared
我故意隐藏了这里的 IP 地址,所以不用担心。我真的不知道这里出了什么问题,所以如果有人能给我指出正确的方向就太好了。
答案1
回答你的问题标题与你的具体问题有点不同。我将首先回答问题标题:如何调试 vpn 连接问题?
- 首先,您需要通过传递调试选项在调试模式下运行 pppd。
sudo grep debug /etc/rsyslog.d/*
输出可能是这样的:
/etc/rsyslog.d/50-default.conf:#*.=debug;\
/etc/rsyslog.d/50-default.conf:# news.none;mail.none -/var/log/debug
/etc/rsyslog.d/50-default.conf:# *.=debug;*.=info;\
/etc/rsyslog.d/50-default.conf: *.=debug;*.=info;\
所以/var/log/调试是您的调试文件。
- 使用调试选项启动 pppd
sudo pppd debug call /path/to/yourvpn.vpn
- 查看调试日志
尾部-f / var /日志/调试
答案2
现在让我来回答您的具体问题。
因为您的日志中似乎有一些警告。我将尝试逐一调查它们。
- 你有这样一句话:
NetworkManager[751]: 策略集“VM529841-5G”(eth1)为 IPv4 路由和 DNS 的默认设置。
我认为 VPN 应该使用隧道接口而不是以太网 1。因此请尝试在网络连接 -> VPN -> 编辑 -> Ipv4 设置选项卡 -> 路由中取消勾选“仅将此连接用于其网络上的资源”。
- 另一行写道:
VPN 连接“Fluency Labs VPN”(IP 配置获取)超时
从 /etc/nsswitch.conf 主机行中删除 wins 条目
- 另一行写道:
/sys/devices/virtual/net/ppp0:无法确定设备驱动程序;忽略...
下列的这个问题看起来 libgcrypt11=1.5.0-3ubuntu2.2 中一定有一个错误。回滚到 libgcrypt11=1.5.0-3ubuntu2.1 后一切又恢复正常了...
sudo apt-get 安装 libgcrypt11=1.5.0-3ubuntu2.1
我希望这能拯救你