需求:
平时在工作电脑上使用cisco systems vpn client客户端连接远程的服务器,但是现在需要本地内网centos服务器也要连接远程服务器
先在centos电脑上安装vpnc
sudo yum install yum-priorities
sudo yum install vpnc
IPSec gateway [hostname or ip address of vpn concentractor]
IPSec ID [group name]
IPSec secret [group password]
Xauth username [username]
配置文件
cp /etc/vpnc/default.conf /etc/vpnc.conf
连接vpn
/usr/sbin/vpnc --gateway vpn公网地址 --id xxx --username xxx > /dev/null 2>&1
远程服务器有超时不连接就断开的机制,所以要设置定时去访问一下远程服务器,此时需要将密码写到配置文件中,避免每次都手动输入
[root@localhost opt]# cat /etc/vpnc/default.conf
IPSec gateway vpn公网地址
IPSec ID xxx
IPSec secret xxx
# your username goes here:
Xauth username xxx
Xauth password xxx
断开vpn
vpnc-disconnect