Friday, January 25, 2008

Connecting to Junipper SSL VPN from Ubuntu 7.10 (Gutsy)


HOW TO : Connect to Junipper SSL VPN from Ubuntu (
sriraman.moments@gmail.com)

OS : Ubuntu 7.10 64 bit standard installation
Audience : Linux Intermediate

Introduction

Usually we connect Junipper SSL VPN through the web browser client. When it is comming to Linux, it is very hard to get and configure the correct Java Applet plug in and Junipper Client dependencies. There is another way we can connect to Juniper SSL VPN through command line.

I am able to configure the former(connecting through browser applet client) in Suse 10.2 and later (command line) Ubuntu 7.10. Here I am trying to describe, How we can connect to VPN from command line in Ubuntu.

NOTE : If you are experiencing permission issue while running an .sh scripts (showing errors like "you don't have enough permissions to execute this file") just run the below command to grant permission to the script

sudo chmod 777 .sh

also sometimes "sudo" key word infront of your command will help you out. (sudo = Super user do)


STEP - 1 ) Download and unzip the files at below location to any folder where you have all permissions (your home folder will be a safe location)

Updated download link(5 May 2007):
http://rapidshare.com/files/229381446/Junipper_SSL_VPN_Client.zip

Once you extracted the contents, you will get a folder structure like below.

/home/sriraman/...../VPN/
/install
/connect

STEP - 2 ) open a terminal and change your directory to the VPN/install folder.

NOTE: You can get a terminal in Ubuntu through menu "Applications -> Accessories -> Terminal".

Here is how I does this in my box.

sriraman$ cd /home/sriraman/VPN/install
sriraman$ ls

STEP - 3) Now we need to install few dependencies which are required for our Junipper VPN client. Execute the following command in terminal one by one or you can run the script file install-Juniper-VPN-client.sh, but it is recommended to run each command one by one, so that we can find exactly what went wrong if you are not that much lucky :)

sudo apt-get install update

sudo apt-get install ia32-libs

sudo dpkg --force-architecture -i ./libstdc++2.10-glibc2.2_2.95.4-24_i386.deb

sudo ln -s /usr/lib32/libssl.so.0.9.8 /usr/lib32/libssl.so.0


NOTE: (don't forget to include "sudo" before every command unless you are the root user)

That's is all Hooo...

STEP - 4 ) we need to obtain SSL certificate to connect to VPN (this is an one time task).Now go to "connect" folder in the "VPN" folder. Right now we are in the install folder. Here is how i get into my connect folder

cd ../connect

In the connect folder execute the below command

sudo ./getx509certificate.sh vpn.myvpn.com cer1.der


STEP - 5 ) Now we are all set, to connect to VPN.


STEP - 6 ) run the following command from the terminal (make sure you are in "connect" folder)


sudo ./connect-vpn.sh

This will ask you few questions

VPN site : your vpn site (ex : vpn.mysite.com)
user name : user name to connect to VPN
password : password to connect to VPN

That is it, you are in, don't close the terminal, keep it open all the time. Closing the terminal or a Ctrl + c can disconnect the VPN.

When ever you want to connect to VPN, just get into the VPN/connect folder from a terminal and execute ./connect-vpn.sh .

STEP - 7 ) what if you want to disconnect from VPN in a neat way?

in terminal go to VPN/connect folder and execute the below script

./disconnect-vpn.sh


FEW TIPS
=======

*) Connecting to VPN may take 10 to 20 seconds

*) you can check the VPN is connect or not by issuing the following command in terminal

ifconfig | grep tun

if this return a line of information, you are connected to VPN.

*) If you don't want to enter user name and password all the time, you can simply edit connect-vpn.sh script and remove the first 6 lines and replace $VPN,$un and $pw with respective information.

*) For any assistance just drop a mail to sriraman@coolmindsinc.com

*) Drop me a mail with subject "Updates on JVPN connect", if you want an alert on any updates to this document.

I would like to see in future

* An unattended installation script
* A GUI for all these
* An Option to start this as service on System start up.

Few use full links

http://david.dw-perspective.org.uk/Juniper-Networks-SSL-VPN-Client-On-Linux.html

http://roner70.blogspot.com/2007/08/howto-juniper-ssl-vpn-in-ubuntu.html

http://www.continuousthinking.com/2006/9/6/kubuntu-dapper-juniper-ssl-vpn

http://forums.gentoo.org/viewtopic-t-494883-highlight-juniper.html

http://roner70.blogspot.com/2007/10/howto-juniper-ssl-vpn-in-ubuntu-710.html


The End