How to Connect to Cisco AnyConnect VPN in Ubuntu

Last updated: November 1, 2014

Connect to Cisco Anyconnect VPN

Many businesses and universities use Cisco AnyConnect as their VPN solution. Although there is a native Linux client offered by Cisco, it is not very well supported, and in some cases the user does not have access to the client. Fortunately, there is a simple solution to this problem – thanks to OpenConnect.

OpenConnect is a client for Cisco’s AnyConnect VPN. It is free software, and is released under the GNU LGPL v2.1 . Getting connected to an AnyConnect VPN is easy with OpenConnect and the TUN/TAP kernel module that is built into the Linux kernel.

1. First run command below to active th TUN module:

sudo /sbin/modprobe tun

2. Install OpenConnect:

sudo apt-get install openconnect

3. Connect to VPN, run:

sudo openconnect yourvpn.example.com

It prompts you to type in username and password. Once these are authenticated, the VPN connection is established.

Keep the terminal window open while the VPN session is active. Network resources such as shared folders, NAS drives, servers, and workstations should now be available. To close the VPN session, press Ctrl+Z in the terminal window. Abruptly killing the terminal window without properly closing out of the VPN session can lead to issues when attempting to reconnect in the future. These issues can typically be resolved by restarting the machine.

For OpenConnect manual, run command man openconnect.

via: Full Circle Magazine, author: Lev, Lazinskiy

Twitter

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to let me know if the tutorial is outdated! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via ubuntuhandbook1@gmail.com Buy me a coffee: https://ko-fi.com/ubuntuhandbook1

4 responses to How to Connect to Cisco AnyConnect VPN in Ubuntu

  1. it works.. thank youuu

  2. Thanks Jim. Worked for me on Ubuntu 16.04. You saved my time.

  3. If I have a file like .pem or .p12
    How can I connect
    Thank you !

  4. Thank you. It creates connection with vpn, however my browser doesn’t know it and i can’ t connect to provided website. Could you help with that? What i should do after vpn connection is established in terminal(i keep it open and alive)?