pre-install
libgcrypt-dev or libgcrypt-devel
yum install -y libgcrypt-dev libgcrypt-devel vpnc
安装
- if need crypt, modified the Makefile file, following the Error
- make
- make install
Error
built without openssl
vpnc was built without openssl: Can't do hybrid or cert mode
vim Makefile
#uncomment
# OPENSSL_GPL_VIOLATION = -DOPENSSL_GPL_VIOLATION
# OPENSSLLIBS = -lcrypto
配置
转换官方pcf配置文件为vpnc配置文件
pcf2vpnc company.pcf vpnc.conf
vpnc配置文件示例
IPSec ID Mygroup
IPSec secret ourpassword
IPSec gateway <XX.XX.XX.XX>
IKE Authmode psk
## To add your username and password,
## use the following lines:
# Xauth username <your username>
# Xauth password <your password>
启动
- 备份默认配置文件
default.conf
,并将自己生成的改为该名 vpnc
启动即可- 或者
vpnc company
,注意这里不要加配哦知文件的后缀名 - vpnc会在后台启动,可以ifconfig查看相关IP
- vpnc-disconnect关闭vpnc
常见问题
- 连接成功后,部分内网网段无法访问
解决方法 添加路由规则
参考网页
http://home.roadrunner.com/~computertaijutsu/vpnc.html
http://www.unix-ag.uni-kl.de/~massar/vpnc/