GCP – Install a VPN server (for client access) on Google Compute Engine

** This needs to be updated. Stay tuned…

REQUIREMENTS:

  • You know how to spin up a Compute Engine instance
  • You are familiar with linux
  • You have no time to read lengthy how-tos – this build took me 15 minutes

USE CASE:

  • I like taking advantage of free wifi (sbux, friends, etc) but want to keep my traffic encrypted.
  • I prefer to use the native mac vpn client

HOW TO BUILD THE VPN SERVER:

I found an amazing article from 2014 – and it still worked with a few updates using StrongSwan.

Thank you! –> https://greenido.wordpress.com/2014/08/10/install-a-vpn-server-on-google-compute-engine/

1)   In Compute Engine, create an instance – use small, Debian GNU/Linux 8 (jessie), and allow HTTP/HTTPS traffic

2)  Create a new Firewall rule

3)  Ssh to your new instance and “sudo su” to run as root

4)  Download install script from https://gist.github.com/Stella-C/45389e7cf391a9e52089bfb5088bf34a#file-gcp-deb8-vpn-install-sh

5)  Fix permissions of script –> $chmod +x gcp-deb8-vpn-install.sh

6)  Update script by updating the values for:
IPSEC_PSK
VPN_USER
VPN_PASSWORD
PRIVATE_IP
PUBLIC_IP
IP_RANGE
INTERNAL_NET

7)  Run the script –> $./gcp-deb8-vpn-install.sh

8)  Logs can be viewed by –> $tail -f /var/log/auth.log
–> $tail -f /var/log/syslog.log 

HOW TO SET UP YOUR MAC OS:

1)  Create a new network –> VPN – L2TP over IPSec

2)  Add PUBLIC_IP and VPN_USER info:

3)  In Authentication Settings, add VPN_PASSWORD and IPSEC_PSK and hit OK

4)  In Advanced Settings, check send all traffic over VPN