I am using openconnect
to connect to a VPN. When starting the client as sudo openconnect -v -u anaphory vpn-gw1.somewhere.net
, I am able to connect after entering the GROUP and 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
[…]
However, when I specify that same group name on the command line, the connection fails with an “Invalid host entry” message.
# 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
Do I need to do any magic to the group name, or how do I find out how to make this work?
Try
--authgroup
instead of-g
Regards
As a matter of fact, the not answer given by user2000606 leads to success.
The HTTP messages sent to the ASA differ, depending on how you select a group and VPN gateways can be picky about it.
This is my basic call to
openconnect
Issuing this command and providing my desired VPN group after being prompted results in the followin HTTP chat (I only included the seemingly relevant parts of the XML documents):
Notice the
group-select
-groups and that all requests arePOST / HTTP/1.1
. The same result is achieved by providing--authgroup AnyConnect-MyGroup
with the basic call toopenconnect
.When using
-g AnyConnect-MyGroup
instead of--authgroup AnyConnect-MyGroup
the following happens:Notice that this time we don't tell the server
group-select
but simply squeeze in our group name withgroup-access
and the HTTP request. The same negative result is provoked when adding the group name to the gateway address, i.e. usingvpn.ssl.mydomain.tld/AnyConnect-MyGroup
as the last line of the basic call toopenconnect
.