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

vpnc 

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 your.vpn.gateway.com
IPSec ID your.vpn.group.id
IPSec secret your.vpn.ground.password
### Put your username here
Xauth username your.login.id
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 http://www.unix-ag.uni-kl.de/~massar/bin/cisco-decode 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

vpnc-disconnect

Comments

Popular Posts