Create VPN in GCP

Given that we have a GCP account, now let’s start creating VPN in GCP.

Create Project

create-project

Create VM in Compute Engine

create-vm
vm-specification

Because VPN doesn’t require too much hardware, the machine should just use the very basic one. So as to make it cheaper.

Create ShadowSocksR Server

1
2
# run this command
curl -O https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-all.sh | sudo bash

Then you should have parameters for configuring the shadow socks R.
Eventually you will get:

1
2
3
4
5
6
7
8
9
10
11
12
Congratulations, ShadowsocksR server install completed!
Your Server IP : xx.xxx.xxx.xx
Your Server Port : 12180
Your Password : PASSWORD
Your Protocol : auth_chain_a
Your obfs : plain
Your Encryption Method: aes-256-cfb

Your QR Code: (For ShadowsocksR Windows, Android clients only)
ssr://MzUuMjI5LjMxLjE0OjEyMTgwOmF1dGhfY2hhaWabcTphZXMtMjU2LWNmYjpwbGFpbjpVblZuWVd4emMzSXJNWE0vP29iZnNwYXJhbT0=
Your QR Code has been saved as a PNG file path:
/home/gcp/shadowsocks_r_qr.png

Create firewall rule

firewall-rule

To allow traffic to shadow socks server, we should open the firewall for the server port.
Here, you should have the port comes from shadow socks configuration to TCP protocol.

allowall

Test

Then import the server configuration by copying the ssr URL, you should be able to use that now!


Create VPN in GCP
https://rug.al/2019/2019-06-2-create-vpn-in-gcp/
Author
Rugal Bernstein
Posted on
June 2, 2019
Licensed under