Here are the steps I needed to take to install vpnc on Cygwin to allow it to work in Windows.
Requirements:
Steps for Installation
- Install Cygwin with the packages:
- Base (everything)
- Devel: make
- Devel: gcc
- Perl: perl
- Libs: libgcrypt
- Source also
- Libs: libgpg-errors
- Libs: libiconv
- Libs: libiconv2
- Editors: vim
- Install OpenVPN. During the install just have “TAP-Win32 Virtual Ethernet Adapter” and “Add Shortcuts to Start Menu” checked.
- Start the Cygwin shell by executing the "Cygwin" icon on your desktop
- copy the vpnc source gzipped tarball to /var/tmp
- Copy libgcrypt source to /var/tmp
- cp /usr/lib/src/libgcrypt-[version].tar.bz2 /var/tmp
- cd /var/tmp
- "Unzip" libgcrypt source file
- bunzip2 libgcrypt-[version].tar.bz2
- Untar libgcrypt source file
- tar -xvf libgcrypt-[version].tar
- cd libgcrpyt-[version]
- Compile libgcrypt
- make
- cd /var/tmp
- "Unzip" vpnc source file
- gunzip vpnc-[version].tar.gz
- Untar vpnc source file
- tar -xvf vpnc-[version].tar
- cd vpnc-[version]
- Edit Makefile file
- vi Makefile
- Add bulletted line after "LDFLAGS += $(shell libgcrypt-config --libs) $(OPENSSLLIBS)"
- LDFLAGS += -L/var/tmp/libgcrypt-[version]/src/.libs
- Compile vpnc
- make
- Install vpnc
- make install
- First you will need to rename the TAP connection you created when you installed OpenVPN to not contain any spaces:
- Open "Network Connections"
- Rename your TAP Virtual Adapter from "Local Connection #" to "my-tap"
- When you try to use vpnc it will want port 500 open by default. This port is used by the IPSEC service in windows (if the service is started). You can either
- Use a different port by configuring "Local Port" in the vpnc config file which we will look at in step 2
- This may be required to work with your concentrator depending
- Stop the IPSEC service (if its running) to make port 500 available
- This may be required to work with your concentrator depending
- You will need to setup your config file for vpn now. This file is located at /etc/vpnc/default.conf You can setup the following variables
- vi /etc/vpnc/default.conf
- Required:
- IPSec gateway [gateway-ip]
- IPSec ID [group-id]
- Xauth username [username]
- Optional:
- Xauth password [password]
- IPSec secret [group-psk]
- Local Port [portNumber]
- NAT Traversal Mode [mode]
- Interface name [intName]
- Interface mode [mode]
- My settings are:
- IPSec gateway [notTelling]
- IPSec ID [notTelling]
- Xauth username [notTelling]
- Xauth password [notTelling]
- IPSec secret [notTelling]
- NAT Traversal Mode cisco-udp
- Interface name my-tap
- Interface mode tap
- /usr/local/sbin/vpnc --no-detach
As stated in the beginning, the nice thing about vpnc is you can have "vpn traffic" have a seperate gateway from "normal traffic". All you should need to do is add a specific route/gateway to use from your normal traffic. Do this after creating the vpnc connection.
- route add [networkip] mask [networknetmask] [gatewayip] metric 1
- Example:
- route add 50.0.0.0 mask 255.0.0.0 50.0.0.1 metric 1