我有 64 位 Ubuntu 10.10,安装了网络管理器 vpnc,配置了连接,但我一直收到此信息:
NetworkManager[1217]: <info> Starting VPN service 'org.freedesktop.NetworkManager.vpnc'...
NetworkManager[1217]: <info> VPN service 'org.freedesktop.NetworkManager.vpnc' started (org.freedesktop.NetworkManager.vpnc), PID 4420
NetworkManager[1217]: <info> VPN service 'org.freedesktop.NetworkManager.vpnc' appeared, activating connections
NetworkManager[1217]: <info> VPN plugin state changed: 1
NetworkManager[1217]: <info> VPN plugin state changed: 3
NetworkManager[1217]: <info> VPN connection 'CSI' (Connect) reply received.
modem-manager: (net/tun0): could not get port's parent device
NetworkManager[1217]: SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/tun0, iface: tun0)
NetworkManager[1217]: SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/tun0, iface: tun0): no ifupdown configuration found.
kernel: [ 2281.723506] tun0: Disabled Privacy Extensions
avahi-daemon[1109]: Withdrawing workstation service for tun0.
NetworkManager[1217]: SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/tun0, iface: tun0)
NetworkManager[1217]: <warn> VPN plugin failed: 1
NetworkManager[1217]: <info> VPN plugin state changed: 6
NetworkManager[1217]: <info> VPN plugin state change reason: 0
NetworkManager[1217]: <warn> error disconnecting VPN: Could not process the request because no VPN connection was active.
NetworkManager[1217]: <info> Policy set 'Auto eth0' (eth0) as default for IPv4 routing and DNS.
NetworkManager[1217]: <info> Starting VPN service 'org.freedesktop.NetworkManager.vpnc'...
NetworkManager[1217]: <info> VPN service 'org.freedesktop.NetworkManager.vpnc' started (org.freedesktop.NetworkManager.vpnc), PID 4547
NetworkManager[1217]: <info> VPN service 'org.freedesktop.NetworkManager.vpnc' appeared, activating connections
NetworkManager[1217]: <info> VPN plugin state changed: 1
NetworkManager[1217]: <info> VPN plugin state changed: 3
我在 Launchpad 上看到了几个错误,它们可能是同一件事,还是我做错了什么?
答案1
安装虚拟专用网络 包裹:
sudo apt-get install vpnc
创建连接脚本,将下面的内容复制到名为 vpn-connect 的文件中,并将其放在某处路径上:
#!/bin/sh sudo vpnc --local-port 0 --enable-1des /etc/vpnc/vpn.conf
复制 Windows Cisco VPN 客户端使用的 .pcf 文件并将其用作步骤 4 的基础。
现在需要在 /etc/vpnc 目录中创建 vpn.conf 文件。该文件的内容如下:
IPSec ID <your ipsec id> IPSec gateway <your gateway address> IPSec secret <your ipsec secret> Xauth username <your username> Xauth password <your password> IKE Authmode psk
<your username>
这<your password>
是显而易见的。
现在您已拥有连接所需的一切,因此请运行脚本:
vpn-connect
几秒钟后,它会返回以下消息:
VPNC started in background
并给你一个进程id。
您现在应该已连接到 VPN。
答案2
我发现在我的例子中,插件失败是因为 vpnc 对加密方法不满意
peer selected (single) DES as "encryption" method.
This algorithm is considered too weak today
If your vpn concentrator admin still insists on using DES
use the "--enable-1des" option.
只有通过跟踪 vpnc 进程才能发现该消息。
为了--enable-1des
向 vpnc 命令行添加选项,我执行了以下步骤:
sudo -s
mv /usr/sbin/vpnc /usr/sbin/vpnc.real
cat <<EOF > /usr/sbin/vpnc
#!/bin/sh
exec /usr/sbin/vpnc.real --enable-1des $*
EOF
chmod +x /usr/sbin/vpnc
基本上,我用提供必要参数的包装脚本替换了 vpnc 二进制文件。
现在NetworkManager VPNC插件可以正确连接。