Search code examples
amazon-web-servicesgoogle-cloud-platformamazon-vpcgoogle-vpcgoogle-cloud-vpn

How to access a network though peering in GCP-AWS vpn?


I have the following topology:

  • GCP with 2 vpcs: A and B. A is 10.0.0.0/16 and B is 10.1.0.0/16. A has peering with B, so A can access B but B can't access A.

  • AWS with a vpc C.

I want to make a VPN between GCP and AWS, so that from C I can access A and B. But When I created the VPN tunnel between C and A, C could only access A. How C could access B through VPN in this case?


Solution

  • VPC peerings are not transitive. From GCP docs:

    Only directly peered networks can communicate. Transitive peering is not supported.

    Same goes for VPN connection in AWS:

    VPN will only route traffic to the VPC it is connected to and VPC peer connections are not ‘transitive’.

    So if you have VPN between C and A, only these can communicate. There is no transitive connection from C to B. Would need to have second VPN from C to B.