Sunday, January 29, 2012

Linux - VPN with vpnc

If you want to set up a VPN client that connect to a CISCO vpn server. The following may help you.

As I had tested, vpnc is compatible to connect to a CISCO vpn server. This is guide is assumed that the Linux machine is a CentOS text based linux client.

Installing vpnc

1. You need RPMForge repository. See Add RPMForge for CentOS for guide
2. After adding RPMForge. Type

yum install vpnc

3. After successful installation, test your install with


and you should see the application request for the following

Enter IPSec gateway address: 

4. Ctrl-X to terminate the program. You have successfully installed vpnc

Configuration and Usage

1. Go to vpnc folder

cd /etc/vpnc

2. You should see 2 files

vpnc.conf - sample configuration file
vpnc-script - a script that vpnc required to run

3. Set execution permission to vpnc-script

chmod +x vpnc-script

4. Set up a configuration file. The configuration file is best to store at /etc/vpnc 
Below is a sample configuration content named my-vpnc.conf

### This is the gateway configuration
IPSec gateway
IPSec secret your.vpn.ground.password
### Put your username here
Xauth username
Xauth password your.login.password

I believe those fields are self explanatory. For those information, you can obtain from your cisco pcf file.

For VPN group password, it is encoded in enc_GroupPwd field. If you "forget" your group password, you can use to "recover" it.

4. After your configuration, type

vpnc my-vpnc.conf

my-vpnc.conf is set up at step 3, and by default, vpnc locate the configuration file at /etc/vpnc

5. If you connect successfully, you should see your VPN banner

Connect Banner:

"VPN Banner"

VPNC started in background (pid: 18400)...

Also, you can try to ping your vpn network as testing.

6. To Disconnect, type


1 comment:

  1. Thanks for sharing your info. I really appreciate your efforts and I will be waiting for your further write ups thanks once again.
    html5 audio player


PuTTY - Keeping session alive

If you have some VPN tunnels that timeout based on activity, you could try the following setting if you are using PuTTY 1) Open PuTTY and...