layout: post
title: Linux连接juniper vpn
date: 2018-11-16
tags: [“Linux Ubuntu &->Mint 18.3”]
连接cisco的juniper vpn可参见archwiki 有N种方法,(排除openconnect,这种方式不太好用)以下为其中的一种方式
一、vpn所需文件
junipernc
ncLinuxApp.jar
- junipernc是一个脚本文件,可以在本页的附件下载也可以在网站上下载 (http://mad-scientist.net/junipernc)
- ncLinuxApp.jar包在vpn服务器上获取,注意需要用IE浏览器先连接该网站并登录,再粘贴该地址获取该jar包)
二、安装依赖包
基于ubuntu的发行版
sudo apt-get install libc6:i386 zlib1g:i386 libgtk2-perl libwww-perl
基于rhel的发行版
yum install -y perl-Gtk2 perl-libwww-perl
yum install glibc.i686 zlib.i686 #安装失败 使用 yum install(update) --setopt=protected_multilib=false glibc.i686 zlib.i686
junipernc是一个脚本文件,执行需要root权限来创建隧道
三、创建隧道
将两个文件放置对应的目录
cp junipernc /usr/sbin/
chmod 755 /usr/sbin/junipernc
mkdir -p ~/.juniper_networks/network_connect/
cp ncLinuxApp.jar ~/.juniper_networks/
解开jar包
cd ~/.juniper_networks
jar -xvf ncLinuxApp.jar
获取vpn网站的真是ip
dig vpn.xxxxx.com
xxx.xxx.xxx.xxx #vpn的ip地址,运行junipernc脚本时没有走dns,所以域名地址无效,没有详查原因
连接vpn
joker@joker-work ~ $ junipernc --nojava --nogui
Enter the Network Connect URL or server:? #vpn地址
Enter the VPN account username (joker)? #vpn账号
Enter the VPN service realm? vpn组名 #线上vpn分组,这个是捷航
Network Connect VPN (1.31)
Enter your PIN + SecurID Code ? #你vpn的密码
首次建立连接成功之后会在家目录下生成一个模板文件和一个证书文件
~/.vpn.default.cfg
~/.vpn.default.crt
注意事项
- 使用
juniper --nogui
无法在后台运行,需要保持终端始终打开才行,如果想要关闭终端可以考虑使用screen - 必须创建
~/.juniper_networks/network_connect/
目录,否则无法建立连接 - juniper network 不支持ipv6 需要调整内核参数如下
vim /etc/sysctl.d/jnc.conf
# jnc不支持ipv6
net.ipv6.conf.default.router_solicitations = 0
net.ipv6.conf.all.disable_ipv6 = 1
文档更新时间: 2022-06-10 10:57 作者:张尚