简体   繁体   English

如何通过 GCP-AWS 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.具有 2 个 vpc 的 GCP:A 和 B。A 是 10.0.0.0/16,B 是 10.1.0.0/16。 A has peering with B, so A can access B but B can't access A. A 与 B 对等,所以 A 可以访问 B,但 B 不能访问 A。

  • AWS with a vpc C.带有 vpc C 的 AWS。

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? 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 ?

VPC peerings are not transitive . VPC 对等互连是不可传递的。 From GCP docs :来自 GCP文档

Only directly peered networks can communicate.只有直接对等的网络才能进行通信。 Transitive peering is not supported .不支持传递对等互连

Same goes for VPN connection in AWS : AWS中的 VPN 连接也是如此:

VPN will only route traffic to the VPC it is connected to and VPC peer connections are not 'transitive' . VPN 只会将流量路由到它所连接的 VPC ,并且VPC 对等连接不是“可传递的”

So if you have VPN between C and A, only these can communicate.因此,如果您在 C 和 A 之间有 VPN,则只有这些可以通信。 There is no transitive connection from C to B. Would need to have second VPN from C to B.从 C 到 B 没有传递连接。需要从 C 到 B 的第二个 VPN。

You can reach B through the VPN by using custom routes exchange.您可以使用自定义路由交换通过 VPN 到达 B。 See here这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM