Setup Linux to VPN into work (using VPNC)

VPNC is an OSS alternative to the proprietary Cisco VPN client software. Cisco puts you through a nightmare of a registration process just to get their software. VPNC is a free, lightweight alternative that is just as good. To use this method, you must already have a valid VPN login. Here is how you install it on either CentOS or Fedora Core 3:

1) Install two missing libraries: libgpg-error-devel and libgcrypt-devel
yum install libgpg-error-devel
yum install libgcrypt-devel

2) Add /usr/lib and /usr/include to the /etc/ file. This file is a list of extra directories that the dynamic linker uses to search for shared libraries.

3) Run ldconfig

4) Create a file called /etc/vpnc.conf and enter this data into it:
IPSec gateway
IPSec secret
Xauth username

5) Download the latest version of the software (in tarball form) here:

6) Untar it into its own directory.

7) Change to the vpnc-0.3.3 directory, and run the “make” command to create the binaries. A few lines will scroll by showing you the build process with gcc.

8) Copy two binaries to a common location in your system’s PATH:
cp vpnc vpnc-disconnect /usr/local/sbin

9) Create the directories /etc/vpnc and /var/run/vpnc
mkdir -p /etc/vpnc
mkdir -p /var/run/vpnc

10) Copy the vpnc-script file to /etc/vpnc
cp vpnc-script /etc/vpnc

Start the VPN client like this:
$ vpnc
Enter password for [email protected]:
VPNC started in background (pid: 5454)…

Stop the VPN client like this:
$ vpnc-disconnect
Terminating vpnc daemon (pid: 5454)