openconnect无法使用-g连接到Anyconnect VPN组


16

openconnect用来连接到VPN。以身份启动客户端sudo openconnect -v -u anaphory vpn-gw1.somewhere.net时,输入GROUP和Password后即可连接。

# 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
[…]

但是,当我在命令行上指定相同的组名时,连接将失败,并显示“ Invalid host entry”消息。

# 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

我是否需要对组名称进行任何魔术处理,或者如何找到使之起作用的方法?


您是否同时找到了解决方案?
亨里克

Answers:


15

尝试--authgroup代替-g

openconnect -v --authgroup CLUSTER-DLCE -u anaphory vpn-gw1.somewhere.net

问候


这对我
有用

@AndyS和@stambata:谢谢您的帮助!如果组名在单词之间包含空格,例如“ tunnel Company XYZ”之类的组名,该如何使用该命令?我也不能写authgroup=tunnel Company XYZauthgroup =“ tunnel Company XYZ”。你知道如何解决吗?
戴夫

@AndyS和@stambata:只需提供其他信息,组名称便会通过以下方式在用户提示中提供:GROUP: [tunnel Company XYZ|tunnel all]:-如何在openconnect-command中键入此名称?
戴夫

1

实际上,user2000606给出的未回答导致成功。

发送到ASA的HTTP消息有所不同,具体取决于您选择组的方式,VPN网关对此可能会很挑剔。

这是我的基本电话 openconnect

openconnect -v --printcookie --dump-http-traffic \
 --passwd-on-stdin \
 -u johnsmith \
 vpn.ssl.mydomain.tld 

发出提示后发出此命令并提供所需的VPN组将导致后续的HTTP聊天(我仅包含了XML文档中看似相关的部分):

[Certificate error, I tell openconnect to continue]
Me >> ASA:  POST / HTTP/1.1
            [...]<group-access>https://vpn.ssl.mydomain.tld</group-access>
ASA << ME:  HTTP/1.1 200 OK
Me >> ASA:  POST / HTTP/1.1
            [...]<group-access>https://vpn.ssl.mydomain.tld/</group-access><group-select>AnyConnect-MyGroup</group-select>
ASA << ME:  HTTP/1.1 200 OK
Me >> ASA:  POST / HTTP/1.1
            [...]<auth><username>johnsmith</username><password>secret</password></auth><group-select>AnyConnect-MyGroup</group-select>
ASA << ME:  HTTP/1.1 200 OK

注意group-select-groups,所有请求都是 POST / HTTP/1.1。通过提供--authgroup AnyConnect-MyGroup对的基本调用,可以达到相同的结果openconnect

当使用-g AnyConnect-MyGroup而不是 --authgroup AnyConnect-MyGroup发生以下情况时:

Me >> ASA:  POST /AnyConnect-MyGroup HTTP/1.1
            [...]<group-access>https://vpn.ssl.mydomain.tld/AnyConnect-MyGroup</group-access>
ASA << ME:  HTTP/1.1 200 OK
            [...] <error id="91" param1="" param2="">Invalid host entry. Please re-enter.</error>

请注意,这一次我们不告诉服务器,group-select而只是通过group-access和HTTP请求挤入我们的组名。将组名添加到网关地址时(即vpn.ssl.mydomain.tld/AnyConnect-MyGroup用作对的基本调用的最后一行),也会引发相同的否定结果openconnect

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.