In this project, it will be established a site-to-site VPN connection between two VPCs in two different Regions, and later on, a point-to-site VPN connection.
After creating two separate GCP Projects, I created one VPC with one subnet in each Project.
Also one virtual machine in each VPC with just an internal static IP.
Created Cloud Router and VPN Gateway with static routes in each VPC and configured one VPN tunnel.
Configured the routing tables in booth VPCs and check the connectivity between the two VMs.
In the VPC-2 I added another subnet and created also another VM in that subnet.
In order to establish connectivity to this VM from VPC-1, a route to this subnet need to be added to the routing table in VPC-1.
Point-to-site VPN connection.
In order to connect VPN Client to the VPCs and communicate with private IP with other VMs, I installed and configured a OpenVPN Server on the vm-1 machine and also assigned a Public IP to this vm. The GCP firewall is configured to allow this connections.
The VPN server is up and running. I created a VPN user and downloaded and installed the VPN client to the local machine with the user’s profile.
Configured a tunnel network 172.27.224.0 subnet mask 255.255.248.0 and from the local machine check if the connection works.