当前位置: > Linux服务器 > VPN >

Linux Cisco VPN的配置方法

时间:2015-08-08 20:34来源:linux.it.net.cn 作者:IT

一、安装openconnect

openconnect是Cisco的AnyConnectSSL VPN的Linux客户端。而NetworkManager-openconnect则是把openconnect的命令行工具,集成到了NetworkManager的图形界面上,它的使用与Window差不多。

$ sudo yum install openconnect   (在Fedora上,会顺带安装:vpnc-script.noarch,这个包会被openconnect用到)

$ sudo yum install NetworkManager-openconnect

如果 yum 无安装包安装步骤:

下载

openconnect-7.06.tar.gz

解压

tar -zxvf openconnect-7.06.tar.gz

安装

cd openconnect-7.06

./configure --with-vpnc-script=<vpnc-script放置路径> --without-openssl-version-check

注意:安装编译需要vpnc-script脚本,脚本地址http://git.infradead.org/users/dwmw2/vpnc-scripts.git/blob_plain/HEAD:/vpnc-script   将里面的内容复制出来,在服务器上创建vpnc-script.sh脚本,并将复制出来的内容粘贴,并赋予vpnc-script.sh可执行权限,chmod +x vpnc-script.sh

make && make install

查看是否安装好

ifconfig   看是否有 tun0
测试VPN,本机上ping tun0上的地址

 

二、在命令行下使用openconnect

sudo openconnect --script /etc/vpnc/vpnc-script https://your-vpn-server.com

Attempting to connect to 121.0.29.22:443
SSL negotiation with vpn.taobao.org
Server certificate verify failed: signer not found
Certificate from VPN server "your-vpn-server.com" failed verification.
Reason: signer not found
Enter 'yes' to accept, 'no' to abort; anything else to view: yes
Connected to HTTPS on your-vpn-server.com
GET https://your-vpn-server.com/
Got HTTP response: HTTP/1.0 302 Object Moved
SSL negotiation with your-vpn-server.com
Server certificate verify failed: signer not found
Connected to HTTPS on your-vpn-server.com
GET https://your-vpn-server.com/+webvpn+/index.html
Please enter your username and password.
Username: your-name
PASSCODE: ********
POST https://your-vpn-server.com/+webvpn+/index.html
Got CONNECT response: HTTP/1.1 200 OK
CSTP connected. DPD 30, Keepalive 20
Connected tun0 as 10.1.25.155, using SSL

三、在NetworkManager上使用openconnect

第一步:创建新的VPN,选择VPN类型为:

第二步:填写VPN服务器,并点Save:

第三步:选择VPN,输入用户名、密码。



(责任编辑:IT)
------分隔线----------------------------