Skip to content

Instantly share code, notes, and snippets.

@JosefJezek
Created July 2, 2014 11:00
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save JosefJezek/dc251a71cab6336f55bd to your computer and use it in GitHub Desktop.
Save JosefJezek/dc251a71cab6336f55bd to your computer and use it in GitHub Desktop.
Cisco AnyConnect VPN Profile

Cisco AnyConnect VPN Profile

Router IOS

webvpn import svc profile profile-example usbflash0:example.xml
webvpn context ctx-example
policy group vpn-group-example
svc profile profile-example

Local on PC

/opt/cisco/anyconnect/profile/Profile.xml

<AnyConnectProfile xmlns="http://schemas.xmlsoap.org/encoding/">
  <ClientInitialization>
    <WindowsLogonEnforcement>SingleLocalLogon</WindowsLogonEnforcement>
    <WindowsVPNEstablishment>AllowRemoteUsers</WindowsVPNEstablishment>
  </ClientInitialization>
  <ServerList>
    <HostEntry>
      <HostName>VPN 1</HostName>
      <HostAddress>vpn1.example.com</HostAddress>
    </HostEntry>

    <HostEntry>
      <HostName>VPN 2</HostName>
      <HostAddress>vpn2.example.com</HostAddress>
    </HostEntry>
  </ServerList>
</AnyConnectProfile>

Schema

/opt/cisco/anyconnect/profile/AnyConnectProfile.xsd

Local AnyConnect Profiles

  • XML and profile files are stored locally to the users machine. The location varies based on OS.

Windows XP

%ALLUSERSPROFILE%\Application Data\Cisco\ Cisco AnyConnect Secure Mobility Client\Profile

Windows Vista, 7

%ProgramData%\Cisco\Cisco AnyConnect Secure Mobility Client\Profile

Linux, Mac OS X

/opt/cisco/anyconnect/profile

@whitecat
Copy link

How do you add usernames if you want for each HostEntry?

@CELIKEM
Copy link

CELIKEM commented Feb 21, 2016

Is it possible to setup autoconnect for ios device, I mean if selected app started anyconnect vpn should be connect automatically ?

@vivagonna
Copy link

Very useful, thanks!

@Hanoos
Copy link

Hanoos commented Nov 29, 2022

How do you add usernames if you want for each HostEntry?
add within HostEntry section
<User>username</User>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment