How to install Cisco VPN on Ubuntu Live CD (10.04)
Whenever there is a problem with my Windows OS. I use Linux live CD (usually Ubuntu) to continue my work until the problem is resolved.
Recently I faced a similar problem when my hard disk crashed. I was able to complete most of my work with the help of Ubuntu live CD. But I was facing some problems while connecting to my office VPN. I use Cisco VPN to connect to office network. But Cisco VPN was not pre-installed in the version of Ubuntu that i used (10.04).
It took sometime but finally I was able to install it & connect to my office network. Here are the steps which I followed.
I used Ubuntu 10.04 Live CD (32 bit).
1. Download cisco vpn client for linux from “projects.tuxx-home.at” with following command
wget http://projects.tuxx-home.at/ciscovpn/clients/linux/4.8.02/vpnclient-linux-x86_64-4.8.02.0030-k9.tar.gz
2. Extract the package.
tar xzf vpnclient-linux-x86_64-4.8.02.0030-k9.tar.gz
3. Goto the vpnclient directory
cd vpnclient
3. Download patch
wget http://lamnk.com/download/vpnclient-linux-2.6.31-final.diff
4. Patch the cisco VPN client
sudo apt-get install patch patch < ./vpnclient-linux-2.6.31-final.diff
5. Build the vpn client
sudo sed -i 's/const\ struct\ net_device_ops\ \*netdev_ops;/struct\ net_device_ops\ \*netdev_ops;/' `find /usr/src -name netdevice.h`
6. Finally install the Cisco VPN client.
sudo ./vpn_install
7. Now we need to initialize the VPN client. (it does not actually connects the client, it just initializes it)
sudo /etc/init.d/vpnclient_init start
8. Copy your VPN profile (YourProfile.pcf) to vpn profile folder ( /etc/opt/cisco-vpnclient/profile)
sudo cp YourProfile.pcf /etc/opt/cisco-vpnclient/profile
9. Finally connect the VPN client using “YourProfile”
sudo vpnclient connect YourProfile
Provide usernname & password as asked and you are done.
Note:
To run a command as administrator (user “root”), use “sudo “.
See “man sudo_root” for details.
If you use Live CD then you have to repeat this procedure every time you restart your machine.
Below is the log from my PC for reference
*********************************************************************
ubuntu@ubuntu:~$ wget http://projects.tuxx-home.at/ciscovpn/clients/linux/4.8.02/vpnclient-linux-x86_64-4.8.02.0030-k9.tar.gz
–2010-08-26 08:46:40– http://projects.tuxx-home.at/ciscovpn/clients/linux/4.8.02/vpnclient-linux-x86_64-4.8.02.0030-k9.tar.gz
Resolving projects.tuxx-home.at… 88.198.57.56
Connecting to projects.tuxx-home.at|88.198.57.56|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 2050813 (2.0M) [application/x-gzip]
Saving to: `vpnclient-linux-x86_64-4.8.02.0030-k9.tar.gz’
100%[======================================>] 2,050,813 43.9K/s in 46s
2010-08-26 08:47:28 (43.5 KB/s) – `vpnclient-linux-x86_64-4.8.02.0030-k9.tar.gz’ saved [2050813/2050813]
ubuntu@ubuntu:~$ tar xzf vpnclient-linux-x86_64-4.8.02.0030-k9.tar.gz
ubuntu@ubuntu:~$
ubuntu@ubuntu:~$ cd vpnclient
ubuntu@ubuntu:~/vpnclient$ sudo ./vpn_install
Cisco Systems VPN Client Version 4.8.02 (0030) Linux Installer
Copyright (C) 1998-2006 Cisco Systems, Inc. All Rights Reserved.
By installing this product you agree that you have read the
license.txt file (The VPN Client license) and will comply with
its terms.
Directory where binaries will be installed [/usr/local/bin]
Automatically start the VPN service at boot time [yes]
In order to build the VPN kernel module, you must have the
kernel headers for the version of the kernel you are running.
Directory containing linux kernel source code [/lib/modules/2.6.32-24-generic/build]
* Binaries will be installed in “/usr/local/bin”.
* Modules will be installed in “/lib/modules/2.6.32-24-generic/CiscoVPN”.
* The VPN service will be started AUTOMATICALLY at boot time.
* Kernel source from “/lib/modules/2.6.32-24-generic/build” will be used to build the module.
Is the above correct [y]
Making module
make -C /lib/modules/2.6.32-24-generic/build SUBDIRS=/home/ubuntu/vpnclient modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.32-24-generic’
CC [M] /home/ubuntu/vpnclient/linuxcniapi.o
CC [M] /home/ubuntu/vpnclient/frag.o
CC [M] /home/ubuntu/vpnclient/IPSecDrvOS_linux.o
CC [M] /home/ubuntu/vpnclient/interceptor.o
/home/ubuntu/vpnclient/interceptor.c: In function interceptor_init:
/home/ubuntu/vpnclient/interceptor.c:132: error: struct net_device has no member named hard_start_xmit
/home/ubuntu/vpnclient/interceptor.c:133: error: struct net_device has no member named get_stats
/home/ubuntu/vpnclient/interceptor.c:134: error: struct net_device has no member named do_ioctl
/home/ubuntu/vpnclient/interceptor.c: In function add_netdev:
/home/ubuntu/vpnclient/interceptor.c:271: error: struct net_device has no member named hard_start_xmit
/home/ubuntu/vpnclient/interceptor.c:272: error: struct net_device has no member named hard_start_xmit
/home/ubuntu/vpnclient/interceptor.c: In function remove_netdev:
/home/ubuntu/vpnclient/interceptor.c:294: error: struct net_device has no member named hard_start_xmit
make[2]: *** [/home/ubuntu/vpnclient/interceptor.o] Error 1
make[1]: *** [_module_/home/ubuntu/vpnclient] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-24-generic’
make: *** [default] Error 2
Failed to make module “cisco_ipsec.ko”.
ubuntu@ubuntu:~/vpnclient$ wget http://lamnk.com/download/vpnclient-linux-2.6.31-final.diff
–2010-08-26 08:50:50– http://lamnk.com/download/vpnclient-linux-2.6.31-final.diff
Resolving lamnk.com… 67.220.216.34
Connecting to lamnk.com|67.220.216.34|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 1912 (1.9K) [application/octet-stream]
Saving to: `vpnclient-linux-2.6.31-final.diff’
100%[======================================>] 1,912 –.-K/s in 0.005s
2010-08-26 08:50:50 (398 KB/s) – `vpnclient-linux-2.6.31-final.diff’ saved [1912/1912]
ubuntu@ubuntu:~/vpnclient$ patch < ./vpnclient-linux-2.6.31-final.diff
The program ‘patch’ is currently not installed. You can install it by typing:
sudo apt-get install patch
ubuntu@ubuntu:~/vpnclient$ sudo apt-get install patch
Reading package lists… Done
Building dependency tree
Reading state information… Done
Suggested packages:
diffutils-doc
The following NEW packages will be installed:
patch
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/123kB of archives.
After this operation, 254kB of additional disk space will be used.
Selecting previously deselected package patch.
(Reading database … 128779 files and directories currently installed.)
Unpacking patch (from …/patch_2.6-2ubuntu1_i386.deb) …
Processing triggers for man-db …
Setting up patch (2.6-2ubuntu1) …
ubuntu@ubuntu:~/vpnclient$ patch < ./vpnclient-linux-2.6.31-final.diff
patching file interceptor.c
ubuntu@ubuntu:~/vpnclient$ sudo sed -i ‘s/const\ struct\ net_device_ops\ \*netdev_ops;/struct\ net_device_ops\ \*netdev_ops;/’ `find /usr/src -name netdevice.h`
ubuntu@ubuntu:~/vpnclient$ sudo ./vpn_install
Cisco Systems VPN Client Version 4.8.02 (0030) Linux Installer
Copyright (C) 1998-2006 Cisco Systems, Inc. All Rights Reserved.
By installing this product you agree that you have read the
license.txt file (The VPN Client license) and will comply with
its terms.
Directory where binaries will be installed [/usr/local/bin]
Automatically start the VPN service at boot time [yes]
In order to build the VPN kernel module, you must have the
kernel headers for the version of the kernel you are running.
Directory containing linux kernel source code [/lib/modules/2.6.32-24-generic/build]
* Binaries will be installed in “/usr/local/bin”.
* Modules will be installed in “/lib/modules/2.6.32-24-generic/CiscoVPN”.
* The VPN service will be started AUTOMATICALLY at boot time.
* Kernel source from “/lib/modules/2.6.32-24-generic/build” will be used to build the module.
Is the above correct [y]
Making module
make -C /lib/modules/2.6.32-24-generic/build SUBDIRS=/home/ubuntu/vpnclient modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.32-24-generic’
CC [M] /home/ubuntu/vpnclient/linuxcniapi.o
CC [M] /home/ubuntu/vpnclient/frag.o
CC [M] /home/ubuntu/vpnclient/interceptor.o
/home/ubuntu/vpnclient/interceptor.c: In function interceptor_init:
/home/ubuntu/vpnclient/interceptor.c:140: warning: assignment discards qualifiers from pointer target type
CC [M] /home/ubuntu/vpnclient/linuxkernelapi.o
LD [M] /home/ubuntu/vpnclient/cisco_ipsec.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: could not find /home/ubuntu/vpnclient/.libdriver.so.cmd for /home/ubuntu/vpnclient/libdriver.so
CC /home/ubuntu/vpnclient/cisco_ipsec.mod.o
LD [M] /home/ubuntu/vpnclient/cisco_ipsec.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-24-generic’
Create module directory “/lib/modules/2.6.32-24-generic/CiscoVPN”.
Copying module to directory “/lib/modules/2.6.32-24-generic/CiscoVPN”.
Already have group ‘bin’
Creating start/stop script “/etc/init.d/vpnclient_init”.
/etc/init.d/vpnclient_init
Enabling start/stop script for run level 3,4 and 5.
Creating global config /etc/opt/cisco-vpnclient
Installing license.txt (VPN Client license) in “/opt/cisco-vpnclient/”:
/opt/cisco-vpnclient/license.txt
Installing bundled user profiles in “/etc/opt/cisco-vpnclient/Profiles/”:
* New Profiles : sample
Copying binaries to directory “/opt/cisco-vpnclient/bin”.
Adding symlinks to “/usr/local/bin”.
/opt/cisco-vpnclient/bin/vpnclient
/opt/cisco-vpnclient/bin/cisco_cert_mgr
/opt/cisco-vpnclient/bin/ipseclog
Copying setuid binaries to directory “/opt/cisco-vpnclient/bin”.
/opt/cisco-vpnclient/bin/cvpnd
Copying libraries to directory “/opt/cisco-vpnclient/lib”.
/opt/cisco-vpnclient/lib/libvpnapi.so
Copying header files to directory “/opt/cisco-vpnclient/include”.
/opt/cisco-vpnclient/include/vpnapi.h
Setting permissions.
/opt/cisco-vpnclient/bin/cvpnd (setuid root)
/opt/cisco-vpnclient (group bin readable)
/etc/opt/cisco-vpnclient (group bin readable)
/etc/opt/cisco-vpnclient/Profiles (group bin readable)
/etc/opt/cisco-vpnclient/Certificates (group bin readable)
* You may wish to change these permissions to restrict access to root.
* You must run “/etc/init.d/vpnclient_init start” before using the client.
* This script will be run AUTOMATICALLY every time you reboot your computer.
ubuntu@ubuntu:~/vpnclient$ sudo /etc/init.d/vpnclient_init start
Starting /opt/cisco-vpnclient/bin/vpnclient: Done
ubuntu@ubuntu:~/vpnclient$ sudo vpnclient connect YourProfile
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.32-24-generic #39-Ubuntu SMP Wed Jul 28 06:07:29 UTC 2010 i686
Config file directory: /etc/opt/cisco-vpnclient
*********************************************************
