Tuesday, September 27, 2011

Cisco VPN Client - Auto-connect & remember password

My ISP disconnects the DSL line every 8 hours (+new public IP) and thus my company VPN connection is disconnected as well. As this is very annoying I configured my VPN Client (Windows, 5.0.07.0410) to automatically connect and to remember my password.

To enable auto-connect (Automatic VPN Initiation) edit the file vpnclient.ini (for my case this file is located in folder "C:\Program Files\Cisco Systems\VPN Client") and add the following lines:

...
AutoInitiationEnable=1
AutoInitiationRetryInterval=15
AutoInitiationRetryIntervalType=1
AutoInitiationList=aconn
EnableLog=0
[aconn]
ConnectionEntry=MyCompany
Connect=1
...


The param "AutoInitiationRetryInterval" is used to set the reconnect interval (in minutes or seconds) depending on "AutoInitiationRetryIntervalType" where 0=minutes and 1=seconds.
I created a new ini section named "aconn" for my connection entry "MyCompany" (points to a connection profile named "MyCompany.pcf"), here you simply replace "MyCompany" with the name of your connection entry (fyi, you can add multiple ini sections comma separated to param "AutoInitiationList").

Regarding remembering the password the admin can override your settings in the remote profile (which happend in my case), so I had to do a little trick here. Exit the VPN client and open the respective local profile file (for my case the profile files are located in folder "C:\Program Files\Cisco Systems\VPN Client\Profiles") and add the following lines:

...
SaveUserPassword=1
UserPassword=mySecret
enc_UserPassword=

...

Set param "UserPassword" to your actual password, safe the file and make the profile file READ ONLY, because whenever you connect successfully the remote profile settings will override some of your local settings!
NOTE: Please do not forget to remove the read only flag whenever you want to edit the profile.

Now the VPN client should now automatically (re)connect. I know that this mini HowTo is not the sorcerer's stone, but I hope it saves you from waste of time for googling around and trial&error.

br
≠ logic

References:
http://www.cisco.com/en/US/docs/security/vpn_client/cisco_vpn_client/vpn_client46/administration/guide/vcAch4.html

No comments: