VPN to access multiple VPC [closed]
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.
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?
I have started with OpenVPN Access Server but I think I'm moving to Swan or OpenConnect due to initial costs that I don't want to have now.
I'm not very experienced with networking, so suggestions are very welcome.
Solution 1:
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?
To provide access to resources in a peered VPC over a client VPN we need to do:
- Create a VPC peering connection between the VPCs.
- Test the VPC peering connection. Confirm that instances in both VPCs can communicate as if they're in the same network.
- Create a Client VPN endpoint in the same Region as the target VPC.
- Associate the subnet that you previously identified with the Client VPN endpoint that you created in step 3.
- Add an authorization rule to give clients access to the target VPC. For Destination network to enable, enter the IPv4 CIDR range of the VPC.
- Add an endpoint route to direct traffic to the peered VPC. For Route destination, enter the IPv4 CIDR range of the peered VPC. For Target VPC Subnet ID, select the subnet that you associated with the Client VPN endpoint.
- Add an authorization rule to give clients access to the peered VPC. For Destination network, enter the IPv4 CIDR range of the peered VPC.
- Add a rule to the security groups for your resources in both VPCs. 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.