vpngoogle-cloud-vpn

Region Conflict VPN in GCP?


I've beem having a problem in GCP.

I have two vpns, each one with two tunnels.

VPN 1 is in region us-east. VPN 2 is in region us-central.

The problem: When i try to connect to my DB using a vm instance that is created in us-central, i can only connect through the VPN 2. When i use the VPN 1 with this VM, i can not connect to my DB.

The same happens when my VM is us-east, i can only connect to my DB via VPN 1.

Is this a problem that happens? Or just coincidence?

EDIT:

I think i found out the problem. The vpn 1 and vpn 2 is configured with different sub networks.

VPN 1: 10.142.0.0/20

VPN 2: 10.128.0.0/20

All VMs with in us-central are 10.128.0.0/20 All VMs in us-east are 10.142.0.0/20

See the picture


Solution

  • It looks to me like you have to closely examine your routing and firewall rules. Though at the first sight I don't see anything else in the routing table you might as well be missing something.

    I'm guessing that 10.0.0.0/8 network is the one where your DB is (outside GCP). You might try adding the route to it to the VPN1 (both tunnels) and see if it helps.

    I also assume that all your VM's are in the default VPC so they can "talk" to each other and all of them can ping both VPN gateways (as described in the documentation). Check if your VPN routing options are in order.

    If after adding/changing the routes it still won't work try to trace the actual route and post the results.