简体   繁体   English

VPN访问多个VPC

[英]VPN to access multiple VPC

I have VPC A and VPC B in my cloud provider, I have a VPC peering between them, so hosts in one can access the other.我的云提供商中有 VPC A 和 VPC B,它们之间有一个 VPC 对等,因此一个主机可以访问另一个。

I have created a VPN in VPC A which gives me access to it, but I would like to be able to access VPC B as well, without having to setup another VPN, is there a way for me to do that?我在 VPC A 中创建了一个 VPN,让我可以访问它,但我也希望能够访问 VPC B,而无需设置另一个 VPN,有没有办法做到这一点?

I have started with OpenVPN Access Server but I think I'm moving to Swan or OpenConmect due to initial costs that I don't want to have now.我已经开始使用 OpenVPN Access Server,但由于我现在不想拥有的初始成本,我想我正在转向 Swan 或 OpenConmect。

I'm not very experienced with networking, so suggestions are very welcome.我对网络不是很有经验,所以非常欢迎提出建议。

You can do that and we have this explained in the following page: How can I access resources in a peered VPC over Client VPN?您可以这样做,我们在下一页对此进行了解释: 如何通过客户端 VPN 访问对等 VPC 中的资源?

To provide access to resources in a peered VPC over a client VPN we need to do:要通过客户端 VPN 提供对对等 VPC 中资源的访问,我们需要执行以下操作:

  1. Create a VPC peering connection between the VPCs . 在 VPC 之间创建 VPC 对等连接
  2. Test the VPC peering connection.测试 VPC 对等连接。 Confirm that instances in both VPCs can communicate as if they're in the same network.确认两个 VPC 中的实例可以像在同一个网络中一样进行通信。
  3. Create a Client VPN endpoint in the same Region as the target VPC.在与目标 VPC 相同的区域中创建客户端 VPN 终端节点
  4. Associate the subnet that you previously identified with the Client VPN endpoint that you created in step 3.将您之前标识的子网与您在步骤 3 中创建的客户端 VPN 终端节点相关联。
  5. Add an authorization rule to give clients access to the target VPC. 添加授权规则以授予客户端访问目标 VPC 的权限。 For Destination network to enable, enter the IPv4 CIDR range of the VPC.对于要启用的目标网络,输入 VPC 的 IPv4 CIDR 范围。
  6. Add an endpoint route to direct traffic to the peered VPC. 添加终端节点路由以将流量定向到对等 VPC。 For Route destination, enter the IPv4 CIDR range of the peered VPC.对于路由目标,输入对等 VPC 的 IPv4 CIDR 范围。 For Target VPC Subnet ID, select the subnet that you associated with the Client VPN endpoint.对于目标 VPC 子网 ID,select 是您与客户端 VPN 终端节点关联的子网。
  7. Add an authorization rule to give clients access to the peered VPC. 添加授权规则以授予客户端访问对等 VPC 的权限。 For Destination network, enter the IPv4 CIDR range of the peered VPC.对于目标网络,输入对等 VPC 的 IPv4 CIDR 范围。
  8. Add a rule to the security groups for your resources in both VPCs.将规则添加到两个 VPC 中您的资源的安全组。 Use this rule to allow traffic from the security group that was applied to the subnet association in step 4. Then, confirm that the network access control lists (ACLs) in both VPCs allow traffic between the target VPC and the peered VPC.使用此规则允许来自在步骤 4 中应用于子网关联的安全组的流量。然后,确认两个 VPC 中的网络访问控制列表 (ACL) 允许目标 VPC 和对等 VPC 之间的流量。

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

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