HOWTO Cisco VPN Client en Ubuntu 8.04 – Hardy Heron
11 de mayo de 2008Al grano, que es para lo que escribo este howto, a quien realmente le interese le va a venir muy bien.
Descargamos el cliente y lo descomprimimos
wget -q http://www.noseque.net/wordpress/media/archivos/vpnclient-linux-x86_64-48010640-k9tar.gz
tar xzf vpnclient-linux-x86_64-48010640-k9tar.gz
Entramos al directorio que se ha creado, descargamos el parche y lo descomprimimos
cd vpnclient
wget -q http://www.noseque.net/wordpress/media/archivos/vpnclient-linux-2624-finaldifftar.gz
tar xzf vpnclient-linux-2624-finaldifftar.gz
Aplicamos el parche e instalamos
patch < vpnclient-linux-2.6.24-final.diff
sudo ./vpn_install
Respondemos a todo con Enter y ya sólo nos queda iniciar el servicio…
sudo /etc/init.d/vpnclient_init start
Y conectar al perfil que previamente hemos colocado en /etc/opt/cisco-vpnclient/Profiles/
sudo vpnclient connect perfil
Cisco Systems VPN Client Version 4.8.01 (0640)
Copyright (C) 1998-2007 Cisco Systems, Inc. All Rights Reserved.
Client Type(s): Linux
Running on: Linux 2.6.24-16-generic #1 SMP Thu Apr 10 13:23:42 UTC 2008 i686
Config file directory: /etc/opt/cisco-vpnclient
Initializing the VPN connection.
Initiating TCP to ##.###.17.85, port 10000
Contacting the gateway at ##.###.17.85
Authenticating user.
Negotiating security policies.
Securing communication channel.
Your VPN connection is secure.
VPN tunnel information.
Client address: ##.##.142.14
Server address: ##.###.17.85
Encryption: 168-bit 3-DES
Authentication: HMAC-SHA
IP Compression: None
NAT passthrough is active on port TCP 10000
Local LAN Access is disabled
Para que no me pida siempre usuario y contraseña he añadido a perfil.pcf las siguientes lineas:
Username=nombre@dominio.com
SaveUserPassword=1
UserPassword=mypassword
Actualización:
Me acabo de dar cuenta de que, al menos en la conexión que yo utilizo, todos los cambios hechos en el perfil se borran. Para solucionarlo he creado un lanzador a un pequeño script que me modifica el perfil, me inicia el servicio, en caso de que no lo estuviera ya, me conecta al perfil y me abre la web corporativa: todo con un solo click
author dice:
12/5/2008, 11:19
Hola, por el nombre del fichero que contiene el cliente da la impresión de que es para 64 bit, ¿no?
¿Valdrá para 32?
MrWolf dice:
12/5/2008, 14:22
Mi procesador es de 64 pero mi ubuntu de 32 osea que sí, debe valer ¿no? Yo creo que sí. Mierda! Tengo dudas.
author dice:
14/5/2008, 15:04
Utilizo el Ubuntu 8.04 de 32 bits en mi portatil. ¿Donde puedo bajar el cliente VPN 4.8.01?
La versión anterior vpnclient-linux-4.8.00.0490-k9.tar.gz y vpnclient-linux-2.6.24.diff no compila.
Un saludo,
Rob
MrWolf dice:
14/5/2008, 17:15
Pues el cliente 4.8.01 es precisamente el que yo he puesto: http://www.noseque.net/wordpress/media/archivos/vpnclient-linux-x86_64-48010640-k9tar.gz
Jammoyano dice:
16/6/2008, 21:56
Un bicicletero empedernido, ubuntuero y apóstata…. donde vamos a llegar…. Deja ya de copiarme hombre!!!!
Me encanta tu blog… Sigue así!
Agradecido dice:
27/7/2008, 22:35
Muchas gracias por tu post.
He podido configurar VPN y casi no me lo creo.
KaSaMa dice:
14/8/2008, 00:15
Amigo, quedo muy agradecido por el dato en este blog, consiso, al punto, practico.
Servicio de VPN para accesar a la red corporativa en la oficina con ambiente windows, instalado en HP Compaq nx6310 con O.S. Ubuntu 8.04, x86, 512 RAM.
Que mas te puedo decir de donde fue probado el servicio de VPN?.
Desde Guatemala,
Salu2.
KaSaMa dice:
15/8/2008, 00:41
Tengo un problema y me hace quedar ante la comunidad Guindogs, que estare haciendo mal o hay algo mas que deba saber?
Si pude hacer la coneccion, pero era ora de ir a casa y cuando llegue, Uks!! … sorpresa!, no pude levantar el servicio de VPN.
Segui al pie de la letra el instructivo magico.
Alguna observacion.
Cesar-Spain dice:
31/8/2008, 09:54
Hola a todos:
KVPNC ya da la posibilidad de integrar el cliente Cisco Original, así que no hace falta usar la línea de conectarse.
César
Cesar Delgado dice:
4/9/2008, 14:56
Instalacion automatica Cliente VPN:
======> ENLACE
http://ubuntuforums.org/showthread.php?p=5725544&posted=1#post5725544
======> SCRIPT
#!/bin/bash
#####################################
# INSTALL_VPN.SH
#####################################
# Script for installing the Cisco
# VPN Client in Ubuntu 8.04 – 64 bits
#
# It can be easily adapted for
# other distros and architectures
#####################################
# Author : Cesar Delgado Gonzalez
# Version: 1.0
# Date : 10-March-2007
#####################################
##################################
# ENVIRONMENT
#################################
# 0.- General Variables
#———————-
ERROR=1
OK=0
TRIES=1 # Attempts per Mirror
# 1.- Where to download
#———————-
WORK_DIR=$HOME
# Syntax: Program – Mirror 1 – Mirror 2 … Mirror N
PROGRAM=(vpnclient-linux-x86_64-4.8.01.0640-k9.tar.gz
http://projects.tuxx-home.at/ciscovpn/clients/linux/4.8.01/ \
http://www.longren.org/files/ \
PATCH=(vpnclient-linux-2.6.24-final.diff
http://projects.tuxx-home.at/ciscovpn/patches/ \
PATCH_2=(cisco_skbuff_offset.patch
http://tuxx-home.at/projects/cisco-vpnclient/ \
# 3.- Current Kernel Version
#—————————
KERNEL=`uname -r`
TYPE_KERNEL=`uname -r | awk ‘BEGIN {FS=”-”;}{print $3}’`
################################################################################
# MODULE MISCELLANEOUS ====> GENERAL FUNCTIONS
################################################################################
#———————————————————————–
# AYUDA
#———————————————————————–
# Muestra la ayuda por pantalla
#———————————————————————–
ayuda()
{
echo “installVPN.sh –> Install Cisco VPN Client in Ubuntu 8.04″
echo ” Best way to use it is through KVPNC, since it integrates it”
}
#———————————————————————–
# TRATA_ERRORES
#———————————————————————–
# Trata todos los posibles errores del script.
#
# Se considerar salida err ea a toda salida del script sin la creaci
# de una estructura de datos (por ejm.: opcion -h provoca salida errea).
#
# Variables de entrada:
# $1 = Tipo de Error
# $2 = Ruta a la que el usuario no tiene acceso (inexistencia o permisos)
# $3 = Directorio de Trabajo
#———————————————————————–
trataErrores()
{
ERROR=”1″
case $1 in
-ayuda) # Solicitud de ayuda
ayuda
exit $ERROR;;
-tryMirror)
echo “===========> Trying PACKAGE: $3 ”
echo ” from MIRROR : $2 ”
echo;;
-downloadSucceed)
echo
echo “*********************************************************************************”
echo ” Download succeed FOR $3 ”
echo ” FROM $2 ”
echo “*********************************************************************************”
echo “” ;;
-downloadFailed)
echo
echo “*********************************************************************************”
echo “ERROR: PACKAGE $3 not found in”
echo ” MIRROR $2″
echo “*********************************************************************************”
echo “” ;;
-noMirrors) # There is no mirrors for this package
echo
echo “*********************************************************************************”
echo “ERROR ==> Package $2 has no mirror list”
echo “*********************************************************************************”
exit $ERROR;;
-packageNotFound) # Package not found on any mirror
echo
echo “*********************************************************************************”
echo “ERROR ==> Package $2 not found on any mirror of the list”
echo “*********************************************************************************”
exit $ERROR;;
-requiredPack) # Failed installing required packages
echo “ERROR ==> Can’t install required packages: Linux source + Build Essentials”
exit $ERROR;;
-decompress)
echo ” ERROR ==> File / Directory Not Available => Unpack Failed, cleaning and exiting”
cleanEnvironment
exit $ERROR ;;
esac
}
################################################################################
# MODULE DOWNLOAD ====> FUNCTIONS FOR DOWNLOADING THE PACKAGES
################################################################################
#———————————————————————–
# DOWNLOAD PACKAGE
#———————————————————————–
# Try to download one package
# from several mirrors. If all of them
# fails, return 1
#
# $1 = Number of tries per mirror
# $2 = Package to download
# $3 … $N = List of mirrors
#———————————————————————–
downloadPackage () {
# 1.- Check that exist at least one Mirror on the input List
#———————————————————–
if [ $# = 2 ]; then
trataErrores -noMirrors $2
# 2.- Search for a the package on the mirrors list
#———————————————————–
else
POSITION=1
for MIRROR in $@; do
# 2.1.- Capture tries per mirror
if [ $POSITION = 1 ]; then
TRIES=$MIRROR
# 2.2.- Capture package name
elif [ $POSITION = 2 ]; then
PACKAGE=$MIRROR
# 2.3.- Try to get the package from current mirror
else
# Try the download
trataErrores -tryMirror $MIRROR $PACKAGE
`wget –tries=$TRIES $MIRROR$PACKAGE`
# Check if succeed
if [ $? = $OK ]; then
trataErrores -downloadSucceed $MIRROR$PACKAGE $PACKAGE
break;
fi
# Report the fail
trataErrores -downloadFailed $MIRROR$PACKAGE $PACKAGE
fi
# 2.4.- Incrementing position
POSITION=`expr $POSITION + 1`
done
fi
# 4.- Package not found of the list of mirrors
#———————————————————–
if [ $POSITION = $# ] && [ $? != $OK ]; then
trataErrores -packageNotFound $PACKAGE
fi
}
#———————————————————————–
# GET PACKAGES
#———————————————————————–
# Downloading the packages
# from the current mirror
#———————————————————————–
getPackages() {
echo “================================================================================”
echo ” DOWNLOADING CISCO VPN CLIENT ”
echo “================================================================================”
echo
downloadPackage $TRIES ${PROGRAM[*]}
echo “================================================================================”
echo ” DOWNLOADING UBUNTU PATCHES FOR KERNEL = ${KERNEL} ”
echo “================================================================================”
echo
downloadPackage $TRIES ${PATCH[*]}
downloadPackage $TRIES ${PATCH_2[*]}
}
#———————————————————————–
# INSTALL REQUIRED PACKAGES
#———————————————————————–
# Procedure that install required
#———————————————————————–
installDependencies() {
echo “==============================================================================================”
echo ” INSTALLING REQUIRED UBUNTU PACKAGES: linux kernel + build essentials + unpacking packages ”
echo “==============================================================================================”
echo ” –> Command: ”
echo ” sudo apt-get install linux-${TYPE_KERNEL} linux-headers-${KERNEL} build-essential gcc gzip bzip zip unzip rar unrar ”
sudo apt-get install linux-${TYPE_KERNEL} linux-headers-${KERNEL} build-essential gcc gzip bzip2 zip unzip rar unrar
# Error Treatment
if [ ! "$?" -eq "$OK" ] ; then
trataErrores -requiredPack
fi
}
################################################################################
# MODULE INSTALL ====> FUNCTIONS FOR COMPILING AND INSTALLING PROGRAM
################################################################################
#———————————————————————–
# UNPACK PACKAGES
#———————————————————————–
# Uncompress packages. Check file extension and uncompress
# properly
#———————————————————————–
unpackPackages() {
#———————-
# ENVIRONMENT
#———————-
local OUT=$OK
#———————-
# ACTIONS
#———————-
# 0.- Tracing
#———————
echo “================================================================================”
echo ” UNPACK PACKAGE: $1 ”
echo “================================================================================”
echo
# 1.- Deflating File
#————————————————————
echo “…………………………… FILE DECOMPRESSION ………………………… ”
echo “File Extension: \${1##*.}=${1##*.}”
local EXTENSION=${1##*.}
echo “File Name: \${1%.*}=${1%.*}”
FILENAME=${1%.*}
case “$EXTENSION” in
gz) echo ” ===> Decompress gz: gunzip -d $1″
gunzip -d “$1″ ; OUT=”$?” ;;
bz) echo ” ===> Decompress bz: bzip2 -d $1″
bzip2 -d “$1″ ; OUT=”$?” ;;
zip) echo ” ===> Decompress .zip: unzip $1″
unzip “$1″ ; OUT=”$?” ;;
rar) echo ” ===> Decompress .rar: unrar $1″
unrar “$1″ ; OUT=”$?” ;;
*) FILENAME=”$1″ ;;
esac
# 2.- Unpacking File
#————————————————————
if [ "$OUT" -eq "$OK" ]; then
TAR=${FILENAME##*.}
if [ -n $TAR ] ; then # ================> There is an extension to check
if [ "$TAR" == "tar" ] ; then # ====> Extension = .tar
echo “………………………… UNPACK TAR FILE ………………………… ”
# 2.1.- Tar Base Detection
echo ” —> TAR base path detection: tar -tf “”$FILENAME”" | awk ‘BEGIN {FS=”"/”"} {print $1}’ | uniq”
TAR_BASE=`tar -tf “$FILENAME” | awk ‘BEGIN {FS=”/”} {print $1}’ | uniq`
echo ” TAR Base = $TAR_BASE”
# 2.2.- Unpacking Tar File
echo ” –> Unpack .tar: tar-xvf $FILENAME”
tar xvf “$FILENAME”
# 2.3.- Returning Output path to File
local RUTA=`dirname $FILENAME`
FILENAME=”${RUTA}/${TAR_BASE}”
OUT=”$?”
fi
fi
else
trataErrores -decompress
fi
# 3.- Error Treatment
#————————————————————
echo “…………………………….. RESULTING FILE …………………………….. ”
echo ” Filename = $FILENAME ”
if [ -e $FILENAME ] && [ "$?" -eq "$OK" ] ; then
echo ” File / Directory Available => Unpack OK”
else
trataErrores -decompress
fi
}
#———————————————————————–
# APPLY PATCHES
#———————————————————————–
# Apply all Ubuntu specific patches
#———————————————————————–
applyPatches() {
#———————-
# ACTIONS
#———————-
echo “================================================================================”
echo ” APPLY PATCHES AND ADJUSTMENTS ”
echo “================================================================================”
echo “cd “”${PROGRAM[0]}”"”
cd “${PROGRAM[0]}”
# 1.- Adjusting MakeFile
#———————
echo ” ……………………. ADJUSTING MAKEFILE ………………………… ”
echo ” ========> > Replace CFLAGS to EXTRA_CFLAGS”
echo “sudo sed -i ‘s/CFLAGS/EXTRA_CFLAGS/g’ “”${PROGRAM[0]}/Makefile”"”
sudo sed -i ‘s/CFLAGS/EXTRA_CFLAGS/g’ “${PROGRAM[0]}/Makefile”
echo “sudo sed -i ‘s/EXTRA_EXTRA_CFLAGS/EXTRA_CFLAGS/g’ “”${PROGRAM[0]}/Makefile”"”
sudo sed -i ‘s/EXTRA_EXTRA_CFLAGS/EXTRA_CFLAGS/g’ “${PROGRAM[0]}/Makefile”
echo
echo ” Resulting MakeFile”
cat ${PROGRAM[0]}/Makefile
# 2.- Applying Patches
#———————
echo ” ……………………. APPLYING PATCHES ………………………… ”
echo “……… sudo patch < “”${PATCH[0]}”"”
sudo patch < “${PATCH[0]}”
echo “……… sudo patch < “”${PATCH_2[0]}”"”
sudo patch Installing VPN Client”
echo “……… sudo “”${PROGRAM[0]}/vpn_install”"”
sudo “${PROGRAM[0]}/vpn_install”
if [ "$?" -eq "$OK" ] ; then
echo ” =======> Starting Cisco VPN Client”
echo “……… sudo /etc/init.d/vpnclient_init start”
sudo /etc/init.d/vpnclient_init start
else
trataErrores -installProgram
fi
}
#———————————————————————–
# CLEAN ENVIRONMENT
#———————————————————————–
# Remove everything used
#———————————————————————–
cleanEnvironment() {
echo “================================================================================”
echo ” CLEAN ENVIRONMENT ”
echo “================================================================================”
echo “……… rm -R ${PROGRAM[0]}*”
rm -fR ${PROGRAM[0]}*
echo “……… rm ${PATCH[0]}*”
rm -f ${PATCH[0]}*
echo “……… rm ${PATCH_2[0]}*”
rm -f ${PATCH_2[0]}*
}
#———————————————————————–
# INSTALL PROGRAM
#———————————————————————–
# “Public” procedure of module
#———————————————————————–
installProgram() {
# 1.- Unpack files
#——————-
unpackPackages “${WORK_DIR}/${PROGRAM[0]}”
PROGRAM[0]=”$FILENAME”
unpackPackages “${WORK_DIR}/${PATCH[0]}”
PATCH[0]=”$FILENAME”
unpackPackages “${WORK_DIR}/${PATCH_2[0]}”
PATCH_2[0]=”$FILENAME”
# 2- Apply Ubuntu Specific modifications
#——————-
applyPatches
# 3.- Compile Program
#——————-
compileProgram
# 4.- Clean Environment
#——————-
cleanEnvironment
}
################################################################################
# MAIN
################################################################################
cd $WORK_DIR
installDependencies
getPackages
installProgram
exit “$OK”
#——————————————————————————
# END INSTALL VPN
#——————————————————————————
Toni dice:
18/9/2008, 17:12
La instalación ha ido de lujo. Gracias por la claridad del post!
ingiltere vizesi dice:
23/11/2008, 22:25
¿Por qué este Web site no tienen otra ayuda de las idiomas
Carlos Mena R. dice:
24/5/2009, 17:26
Excelente aporte, me fue de maravilla siguiendo los pasos.
Grax.
Amin dice:
12/2/2010, 08:48
Buenas, estoy intentando conectar a través de cisco vpn con un ubuntu 8.04 LTS Server, pero se me queda en:
Cisco Systems VPN Client Version 4.8.01 (0640)
Copyright (C) 1998-2007 Cisco Systems, Inc. All Rights Reserved.
Client Type(s): Linux
Running on: Linux 2.6.24-24-server #1 SMP Tue Jul 7 20:21:17 UTC 2009 i686
Config file directory: /etc/opt/cisco-vpnclient
Enter Certificate password:
Initializing the VPN connection.
..y de ahi no pasa.
No se si es problema del ubuntu al abrir los certificados porque he intentado listarlos con:
cisco_cert_mgr -R -op list
Cisco Systems VPN Client Version 4.8.01 (0640)
Copyright (C) 1998-2007 Cisco Systems, Inc. All Rights Reserved.
Client Type(s): Linux
Running on: Linux 2.6.24-24-server #1 SMP Tue Jul 7 20:21:17 UTC 2009 i686
..pero tampoco pasa de ahi.
Alguien sabe si puede faltar alguna libreria o algo? No es tema de permisos (están Certificates y Profiles a 777)
Muchisimas Gracias.
Pablo Andres Diaz A. dice:
29/7/2010, 02:47
Cordial saludo compadres,
He instalado el cisco vpn client sin problemas en un ubuntu 9.10. Aunque si tengo un problema y es que el sistema me aisla de Internet cada que estoy usando el cliente cisco VPN.
He probado escribir el archivo de configuración pero no ha valido, sigo sin tener la conexión a Internet mientras estoy usando la conexion con el cliente.
Existe manera de que pueda hacer algo para poder tener conexión a la VPN y a Internet al mismo tiempo?
Saludos chavales.