Wednesday, August 3, 2011

How to install Cisco VPN on Ubuntu

On Ubuntu, you don't need to install the Cisco VPN Client: NetworkManager includes support for Cisco IPSec VPNs. This 3 steps article will walk you through a successful installation and configuration of your VPN client.

If you encounter any issues, or need more details, make good use of the comments form at the end.

Step 0: Authentication details

First of all, make sure you have your authentication details at hand!

Step 1: Install vpnc

Ubuntu ships by default with the plugin for the Point-to-Point Tunneling Protocol (PPTP), but we need the plugin for the Cisco Compatible VPN (vpnc), that provides easy access to Cisco Concentrator based VPNs.

To install the vpnc plugin, open your terminal and run:

sudo apt-get install network-manager-vpnc

Is your Ubuntu version 10.10 or older?

Installing the Cisco VPN client on a kernel older than 2.6.38+, will result in compilation errors: the cisco_ipsec module crashes and the system is only of limited use.

The working solution is to:

  1. download the vpnc client source,
  2. apply this patch for the vpnc client,
  3. and follow the next steps for setting up your VPN.

Step 2: Setting up your VPN

Find Network Connections in your Dash, and in the VPN tab select Import to choose your .pcf file, or Add if you want to manually enter your authentication details from Step 0.
Adding a new Cisco VPN connection on Ubuntu

Step 3: Use Only as Needed

In the configurations, make sure to go to the IPv4 Settings tab, click on Routes and activate the option to use the VPN connection only for resources on its network,
unless you want all your traffic to be significantly slowed down.
Only use the VPN connection for resources on its network

You might want to reboot your machine, and you're good to go. Give it a try!

14 comments:

  1. This is a great tutorial. Well written and well documented. I've just stumbled on it at Dzone. I have an Ubuntu sandbox at home that I am playing with. I'll try installing Cisco VPN on it using your instructions!

    ReplyDelete
  2. I'll try this tomorrow, thanks!

    ReplyDelete
  3. This it just now and it works! I did get the following error at first: The VPN Connection 'Test VPN' failed because there were no valid VPN secrets.

    I solved this by restarting the network-manager:
    sudo /etc/init.d/network-manager restart

    ReplyDelete
  4. Excellent. It works without problems.
    Thanks.

    ReplyDelete
  5. Thank you. I can connect now but I can't open any internal websites (it redirects me to guide.opendns.com) and I can't access the Windons network. Any ideas of what I should look at would be much appreciated

    ReplyDelete
  6. Wow...Thank you sooo much!!! Spent hours trying to get this working and these 3 simple steps did it for me! Ubuntu 11.04 (with Unity) 32 bit

    p.s: this is my 2nd day using Ubuntu and I needed this VPN client for work :) If I can get it to work, so can you!

    ReplyDelete
  7. Thanks for this guide.

    I am getting a popup asking me to "You need to authenticate to access the Virtual Private Network 'name of my work vpn'"

    What exactly is it asking for?

    ReplyDelete
  8. @Juan, could you give more details for the settings you use?

    ReplyDelete
  9. Hey, I am having an issue with this on 11.04...I installed VPNC and inputed all my companies Cisco VPN info and the VPN seems to connect but I cannot ping any internal IPs, remote desktop to my PC, or access internal websites...Any ideas? :(

    ReplyDelete
  10. yes, thanks a muito tempo estava procurando isto... Obrigado e abraços

    ReplyDelete
  11. great great and great, at home :

    merveilleux simple et clair ;-)

    A+

    ReplyDelete
  12. thanks Marius Butuc for your guide.

    Thats work well.

    i have problem sama as jzuijlek : The VPN Connection 'Test VPN' failed because there were no valid VPN secrets.

    then i restart my ubuntu an try to connect.

    ReplyDelete
  13. If my kernel is 2.6.38-8-generic will I need the patch?

    ReplyDelete