Linux 虚拟机实例作为两个不同子网之间的网关

Linux VM instance as a Gateway between two different subnets

我们需要在 2 个站点之间创建 VPN 隧道。一个是我客户的本地站点,它使用 cisco VPN 网关,另一个站点在 Google 云中,由我们的团队管理。

我们的 VPC 网络中有 2 个子网 192.168.1.0/24(此范围需要通过 VPN 隧道到达)和 192.168.10.0/24

VPN隧道需要连接以下IP范围:

客户端:10.10.0.0/24

我们的端点:192.168.1.0/24(网络服务器运行)

但是我的客户也使用我们的内部网络范围 192.168.1.0/24。所以我们尝试了 NAT,但不幸的是 GCP Cloud NAT 功能无法与 GCP Cloud VPN 一起使用。

考虑到我已经在我的测试环境中使用新的网络范围 (172.10.10.X/24) 测试了这种情况。

我遵循的步骤: 创建了一个 Linux VM 实例作为网关,它有两个网络接口(一个接口(eth0)在 172.10.10.X/24 范围内,另一个接口(eth1)在 192.168.1.0/24 中)

在以下 IP 范围之间创建了 VPN 隧道:

客户端:10.10.0.0/24

我们的终点:172.10.10.X/24

我可以 ping 到 172.10.10。X/24 范围从 10.10.0.0/24 但不能从 10.10.0.0/24 ping 到 192.168.1.0/24

希望我在这里遗漏了什么,需要添加路由,有人可以指导我几步吗?

谢谢

正如@John Hanley 在评论中提到的,不支持重叠网络。
只能在specific scenarios:

设置静态路由

Narrower than on-premises IP range (longer subnet mask)

Google Cloud lets you create a custom static route with the 10.2.0.0/16 destination and next hop Cloud VPN tunnel; however, traffic to IP addresses in 10.2.99.0/24 remains inside your VPC network.

最好的方法是重新定位其中一个网络。