我正在使用openconnect连接到 VPN。当以 启动客户端时sudo openconnect -v -u anaphory vpn-gw1.somewhere.net,我可以在输入 GROUP 和密码后连接。
# openconnect -v -u anaphory vpn-gw1.somewhere.net
[…]
XML POST enabled
Please enter your username and password.
GROUP: [Anyconnect-VPN|CLUSTER-DLCE|Clientless]:CLUSTER-DLCE
POST https://vpn-gw1.somewhere.net
Got HTTP response: HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
[…]
Run Code Online (Sandbox Code Playgroud)
但是,当我在命令行上指定相同的组名时,连接失败并显示“无效主机条目”消息。
# openconnect -v -g CLUSTER-DLCE -u anaphory vpn-gw1.somewhere.net
[…]
XML POST enabled
Please enter your username and password.
Password:XML POST enabled
Invalid host entry. Please re-enter.
Failed to obtain WebVPN cookie
Run Code Online (Sandbox Code Playgroud)
我是否需要对组名做任何魔术,或者我如何找出如何使其工作?
我通过以下方式连接到脉冲 VPN
sudo openconnect --juniper {{myserver}}
Run Code Online (Sandbox Code Playgroud)
它已经工作了几个月。今天早上当我尝试进入时,在接受证书并输入用户名/密码后,它以
Connected to HTTPS on {{myserver}}
Got HTTP response: HTTP/1.1 400 Bad Request
Unexpected 400 result from server
Creating SSL connection failed
Run Code Online (Sandbox Code Playgroud)
我需要改变吗?解决方法?
我正在尝试openconnect通过使用以下内容的 Debian init 脚本启动start-stop-daemon:
DAEMON=/usr/sbin/openconnect
DAEMON_ARGS="<endpoint> --script /etc/vpnc/vpnc-script --user <user> --pid-file $PIDFILE --passwd-on-stdin"
PASSWORD=`cat /etc/openconnect/<endpoint>.passwd`
start-stop-daemon --start --pidfile "$PIDFILE" --exec "$DAEMON" -- $DAEMON_ARGS <<< ${PASSWORD}
Run Code Online (Sandbox Code Playgroud)
不幸的是,openconnect 在启动期间仍然提示输入密码,因为它似乎无法读取重定向到 stdin 的密码。
有任何想法吗?
每当我使用 Cisco AnyConnect Secure Mobility Client v. 3.0.4235(可能还有其他版本)连接到 VPN 服务器时,我就无法访问我的 LAN。我希望通过手动添加一些 AnyConnect 删除的路由来解决此问题。
以下是我的设置,连接前后的路线。我有一台带有两个物理网卡的机器:
NIC1互联网网关
Address 10.191.244.10
Mask 255.255.255.0
Gateway: 10.191.244.1
Run Code Online (Sandbox Code Playgroud)
网卡2
Address 172.16.97.1
Mask 255.255.0.0
Gateway: N/A
Run Code Online (Sandbox Code Playgroud)
连接到 NIC2 的设备
Address 192.16.97.2
Mask 255.255.0.0
Gateway: N/A
Run Code Online (Sandbox Code Playgroud)
编辑:请注意 VPN 连接和 LAN 连接不在同一个物理网卡/链路上,并且两个网卡没有连接到同一个网络(一个连接到 10.191.244.0/24,另一个连接到 172.16.97.0/ 20)。
连接到 VPN 之前的路由和 ARP 表
===========================================================================
Interface List
15...52 54 00 c3 42 45 ......Red Hat VirtIO Ethernet Adapter #2
14...52 54 00 f4 a4 80 ......Red Hat VirtIO Ethernet Adapter
1...........................Software Loopback …Run Code Online (Sandbox Code Playgroud) 我正在运行带有 NetworkManager 1.4 的 RedHat Enterprise Linux 7.3 服务器,该服务器需要使用 openconnect 7.06-1.el7 通过 VPN 定期访问客户端网络。我可以毫无问题地nmcli使用该--ask选项进行连接,但它顽固地拒绝让我自动提供密码。
我按照上一个问题的说明进行操作,但是无论是重新启动 NetworkManager、使用nmcli con reload还是重新启动整个系统,它都会忽略[vpn-secrets]配置文件中的部分。
[connection]
id=Client VPN Interface
uuid=9f0d7d19-8bdf-40e1-9fc8-abce32cda118
type=vpn
permissions=
secondaries=
[vpn]
authgroup=Comp
gateway=client.gateway.com
password-flags=0
service-type=org.freedesktop.NetworkManager.openconnect
user-name=myuser
[vpn-secrets]
password=mypass
[ipv4]
dns-search=
method=auto
[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto
Run Code Online (Sandbox Code Playgroud)
我收到的错误消息是:
A password is required to connect to 'Client VPN Interface'.
Warning: password for 'vpn.secrets.gateway' not given in 'passwd-file' and nmcli cannot ask without '--ask' option.
Error: …Run Code Online (Sandbox Code Playgroud) 我需要连接到 Linux 上的 Cisco VPN,首先我使用 KDE NetworkManager Plasma 小部件来完成此操作。效果很好,如果我从网络管理器小部件中选择 VPN,我就可以连接到 VPN。
\n\n但是,如果我尝试使用命令行,则无法正常工作(IP 和 URL 已更改以保护无辜者):
\n\n\xe2\x9e\x9c ~ sudo openconnect --proxy http://proxy.mycompany.com:8080 vpn.mycompany.com:443 \nPOST https://vpn.mycompany.com/\nAttempting to connect to proxy 172.17.122.135:8080\nRequesting HTTP proxy connection to vpn.mycompany.com:443\nUnexpected continuation line after CONNECT response: \'Via: 1.1 SPROXY2\'\nUnexpected continuation line after CONNECT response: \'X-WebMarshal-RequestID: 445D5E14-309A-4AA2-B7AF-07CAAD5BB21D\'\nSSL negotiation with vpn.mycompany.com\nServer certificate verify failed: signer not found\n\nCertificate from VPN server "vpn.mycompany.com" failed verification.\nReason: signer not found\nEnter \'yes\' to accept, \'no\' to abort; anything else to view: yes\nConnected …Run Code Online (Sandbox Code Playgroud) openconnect ×6
vpn ×4
anyconnect ×1
debian ×1
init.d ×1
proxy ×1
redhat ×1
routes ×1
ubuntu-14.04 ×1