Cisco Linux Anyconnect remembers old VPN name

A quick one today.

For some reason, the Cisco Anyconnect Client (for Linux) has a habit of remembering an old VPN connection name with no obvious way of removing it. Each time you load the VPN client you will see the old VPN client connection name. You then have to overwrite it manually with the name or IP of your destination VPN server.

If you are running a Debian based Linux distribution you will find VPN client profiles in /opt/cisco/anyconnect/profile

You may find the offending profile there and can delete it or rename it. Alternatively, you can create the following XML script call Profile.xml (case sensitive) that will enable you to choose from a list of servers:

<AnyConnectProfile xmlns="http://schemas.xmlsoap.org/encoding/"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://schemas.xmlsoap.org/encoding/AnyConnectProfile.xsd">
   <ServerList>
      <HostEntry>
         <HostName>Example VPN1</HostName>    
         <HostAddress>vpn.example1.com/connect</HostAddress>
      </HostEntry>
   </ServerList>
   <ServerList>
      <HostEntry>
         <HostName>Example VPN2</HostName>
         <HostAddress>vpn.example2.com/connect</HostAddress>
      </HostEntry>
   </ServerList>
</AnyConnectProfile>

If you have ASDM and permissions you can also edit profiles from there: See this link