翻译前:这是我找了好久的文章,在最新版的Fedora的桌面环境中,是可以直接在network里面配置的。命令行环境下不清楚。当然,更不清楚CentOS下该使用什么(虽然Fedora是使用的REHL的内核,不过程序版本比较激进。)所以,就找了这么一篇。当然如果知道原理,我更愿意自己用py来实现~
原文地址:https://linuxconfig.org/establishing-cisco-vpn-client-connection-on-rhel-7-using-vpnc
打不开的建议使用海外加速器(你懂的。)
译文:
在RedHat 7 Linux 上链接 Cisco VPN 最简单的办法就是使用vpnc客户端——开源的用以替代Cisco VPN客户端。(当然Cisco 自家的VPN客户端在Linux也是有的。如果你懂英文,可以直接去看斯坦福大学的那篇文章:地址点我)。来,让我们在RHEL7 上安装VPNC吧!VPNC包是在EPEL源中的(Extra Packages for Enterprise Linux 7 EPEL源相信玩CentOS的应该都知道。)
subscription-manager repos --enable=rhel-7-server-optional-rpms
(恩这条是RHEL的命令CentOS有些不同,毕竟不是亲生儿子)
yum install epel-release
如果你没有一个RedHat的订阅的话,请按照这边的指引走:怎么在没有订阅的情况下启用EPEL源(这篇不是主角,就不翻译了,反正国内用RHEL的都会买,不用的都用CentOS,都不用订阅。下面预计都一样了。)
# yum install vpnc
现在,你已经安装了vpnc,已经可以建立一个CISCO的vpn 链接了。
[root@rhel7 ~]# vpnc Enter IPSec gateway address: vpn.hostname.example Enter IPSec ID for vpn.hostname.example: VPNClient Enter IPSec secret for VPNClient@vpn.hostname.example: Enter username for vpn.hostname.example: username Enter password for username@vpn.hostname.example: Connect Banner: | You are now connected to the VPN System. Unauthorized usage is not permitted. | VPNC started in background (pid: 3707)...
上面会新建一个VPN 隧道网络接口如下
tun0: flags=4305<up,pointopoint,running,noarp,multicast> mtu 1412 inet 141.17.140.55 netmask 255.255.255.255 destination 131.217.240.35 unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
或者,你可以一个通过新建一个VPNC的配置文件,来建立一个Cisco VPN 认证。
[root@rhel7 ~]# cat /etc/vpnc/default.conf IPSec gateway vpn.hostname.example IPSec ID GROUPNAME IPSec secret GROUPPASS Xauth username username Xauth password my-password
VPNC会检查是否存在一个默认的配置文件,如果没有然后新建一个Cisco VPN 连接。请知晓,密码可以被省略,将会在你运行的vpnc的时候被询问。
# vpnc Connect Banner: | You are now connected to the VPN System. Unauthorized usage is not permitted. VPNC started in background (pid: 3777)...
你能够建立多个VPN配置文件(config file)如果你想建立多个连接的话。你可以使用vpnc 命令跟上配置文件名来连接你的Cisco VPN,如下:
[root@rhel7 vpnc]# cp default.conf cisco-vpn.conf [root@rhel7 vpnc]# vpnc cisco-vpn
如果想断开连接的话,使用以下命令
[root@rhel7 ~]# vpnc-disconnect Terminating vpnc daemon (pid: 3777)
未经允许不得转载:RffanLAB|Rffan实验室 » [翻译]在RHEL7 上使用vpnc 连接Cisco VPN