How to set up a VPN in ubuntu 11.04

You can use the vpnc client in Ubuntu to connect to your company network from your home.Following is a guide how you can do it.V must say that V are thankful to this for the guide provided and hope ours one will be also be a station for a person looking for a such a guide but could not locate above.

One reason for going for such an alternative is that some companies might not like to reveal their group password and provide you only with a .pcf fie .
But those files needs to be converted in to .conf file if to be used with VPNC , because we call it as
'vpnc connect nameofthe.conf file'

So following describes you the procedure for developing your own  front end for connecting to the VPN.
You can have a nice gui designed in whatever the language you prefer.I must say that credit of this article goes to Sampath,Rukshan and Prabodha as well.

Our application was developed in Ubuntu 11.04 and the GUI s were built using Python and Python-imaging-tk.
It receives the username and RSA token from the GUI and append it to the relavant .conf file and call vpnc with that file.The relavant .conf file was decided by a drop down list box from which the user can select his user group(which VPN group he want to connect to)

Now comes the tricky part.It was to convert the given pcf files to .conf files.


  • You can download the pcf2vpnc converter program by following below link.

         http://svn.unix-ag.uni-kl.de/vpnc/trunk/pcf2vpnc

  • Give it execute permission and place it in /usr/local/bin so it is recognised in the cmd line by following
                chmod +x pcf2vpnc
                mv pcf2vpnc /usr/local/bin
  • Also we need a password decrypt program.you can download a cisco decrypt program from below.

  • Grab the dependencies required by above script and compile the scipt into a binary.Place that in our path as well.
  • Following would do the work.
          sudo aptitude install libgcrypt-dev libgpg-error-dev
gcc -Wall -o cisco-decrypt cisco-decrypt.c $(libgcrypt-config --libs --cflags)
          sudo mv cisco-decrypt /usr/local/bin
  • Next is to call the pcf2vpnc program giving the relavant .pcf file as an argument which would call the ciso-decrypt binary and would create a .conf file.
  • After placing that .conf file in /etc/vpnc we can call vpnc program with that .conf file.
        pcf2vpnc clint.pcf > client.conf
sudo cp client.conf /etc/vpnc
sudo vpnc client


Happy coding to you all :)