Skip to content

Instantly share code, notes, and snippets.

@fschabmeyer
Created January 20, 2016 22:31
Show Gist options
  • Save fschabmeyer/22b759994cf852df7e9b to your computer and use it in GitHub Desktop.
Save fschabmeyer/22b759994cf852df7e9b to your computer and use it in GitHub Desktop.
Installation and Configuration of Shrewsoft IKE without GUI under Debian

Installation and Configuration of Shrewsoft IKE without GUI under Debian

Thanks to André P. for his article so I was able to make this guide: https://www.debinux.de/2014/01/ubuntu-server-cli-shrew-soft-vpn-client/

It is a bit tricky to use IKE without the GUI under Debian. I found a solution, how you can do this:

Installation:

    aptitude install ike

Configuration:

  • Create the Folder ~/.ike/sites
  • Take your Shrewsoft VPN Configuration File (.vpn) and put it into ~/.ike/sites and remove the file extension (for example rename test.vpn to test)
  • To test the configuration, use the following command:
    ikec -r <name of the configuration file> -u <user> -p <password> -a
  • Now it is possible to use the tunnel

Optional: Installing as a Service

  • Install Screen
    aptitude install screen
  • Create INIT-Script
    vim /etc/init.d/ikec

You have to replace the following fields with your values: SESSIONNAME, SITENAME, VPNUSER und VPNPASS

 #!/bin/bash
 ### BEGIN INIT INFO
 # Provides: ikec
 # Required-Start: $network $syslog
 # Required-Stop: $network $syslog
 # Default-Start: 2 3 4 5
 # Default-Stop: 0 1 6
 # Description: Start ikec
 ### END INIT INFO

SESSIONNAME=ikecsession
SITENAME=remotevpn.cfg
VPNUSER=Username
VPNPASS=Password

case "$1" in
start)
echo "Open ikec Connection..."
screen -S $SESSIONNAME -d -m ikec -r $SITENAME -u $VPNUSER -p $VPNPASS -a
;;

stop)
echo "Closing ikec Connection..."
su $RUNAS -c "screen -S $SESSIONNAME -X quit"
;;

*)
echo "Fehlerhafter Aufruf"
echo "Syntax: $0 {start|stop}"
exit 1
;;

esac
  • Change rights and install the script
sudo chmod 700 /etc/init.d/ikec && sudo update-rc.d ikec defaults && sudo /etc/init.d/ikec start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment