Skip to content

Using NAT and one AWS S2S VPN to access remote resources from several VPCs and other remote locations

0

I do have a distributed network setup involving several business partners (details below) where I'd like to utilize an AWS VPC as central routing point. Can you give me an idea with which components I could achieve such kind of setup? I'm quite sure I'd need a NAT Gateway within my 192.168.2.0/24 network but I do not understand how I combine NAT Gateway and a Virtual Private Gateway within this network and how I'd route traffic from other VPCs, Client VPN Connection and other On-Prem networks being connected via other S2S VPN connections using NAT and established S2S VPN to 192.168.1.0/24

Partner Network (On-Prem) - can't change this: 192.168.1.0/24 Target Host within Partner Network: 192.168.1.100 S2S VPN Connection from AWS to Partner Network - accepting traffic from source network 192.168.2.0/24 (can't change this) AWS S2S connection between an VPC with CIDR 192.168.2.0/24 and Partner Network is up an running using a Virtual Private Gateway within my 192.168.2.0/24 VPC, can ping 192.168.1.100 from EC2 instance launched within 192.168.2.0/24

Private VPC with some EC2 services needing access to 192.168.1.100 - 10.1.0.0/24 Our On-Prem network - should be connected to AWS using S2S VPN as well - 10.2.0.0/24 Mobile Workers - should be connected to AWS using Client VPN - Network 10.5.0.0/24

Can you give me an hint which components to use and this kind of setup is achievable with AWS out of the box components at all?

asked 2 years ago234 views

1 Answer
0

Yes, this kind of setup is achievable using AWS components. To create a central routing point for your distributed network, you can use AWS Transit Gateway along with other AWS networking services. Here's an overview of how you can set up this architecture:

  1. Central VPC (192.168.2.0/24):
  • Set up a Transit Gateway in this VPC
  • Create a NAT Gateway for outbound internet traffic
  • Keep the existing Virtual Private Gateway for the S2S VPN connection to the Partner Network
  1. For other VPCs and networks:
  • Connect the Private VPC (10.1.0.0/24) to the Transit Gateway
  • Set up a new S2S VPN connection from your On-Prem network (10.2.0.0/24) to the Transit Gateway
  • Configure AWS Client VPN (10.5.0.0/24) and associate it with the Transit Gateway
  1. Routing:
  • Configure Transit Gateway route tables to direct traffic between all connected networks
  • Update VPC route tables to send traffic destined for other networks to the Transit Gateway
  • Configure the NAT Gateway in the Central VPC to handle outbound internet traffic for all connected networks
  1. Security:
  • Use Network ACLs and Security Groups to control traffic flow between networks
  • Implement AWS Network Firewall for additional security if needed

This setup allows you to centralize routing through the Transit Gateway in your 192.168.2.0/24 VPC. The Transit Gateway can route traffic between all connected networks, including the Partner Network (via the existing S2S VPN), other VPCs, your on-premises network, and Client VPN users. The NAT Gateway in the central VPC can be used for internet-bound traffic from all connected networks.

Remember to configure appropriate route tables in the Transit Gateway, VPCs, and on-premises networks to ensure proper traffic flow. Also, make sure to set up necessary security groups and network ACLs to control access between different networks.

This architecture provides a scalable and flexible solution for your distributed network setup, allowing for easy expansion and management of multiple network connections.
Sources
Connect your VPC to remote networks using AWS Virtual Private Network - Amazon Virtual Private Cloud
AWS Site-to-Site VPN single and multiple VPN connection examples - AWS Site-to-Site VPN
Using NAT Gateways with multiple-Amazon VPCs at scale | Networking & Content Delivery
AWS Client VPN connection and traffic flow handling simplified | AWS re:Post

answered 2 years ago

  • But this setup is only NATing Internet Traffic and not the VPN Traffic to 192.168.1.0/24, right? So if I'm doing a ping from 10.1.0.0 to 192.168.1.0 the 10.1.0.X IP will appear as source IP of my ping on the 192.168.1.0/24 side of my VPN connection and won't be accepted as only traffic from 192.168.2.0/24 is allowed.

  • Is it your requirement to hide the origin of all the connections towards 192.168.1.0/24 behind 192.168.2.0/24? Technically, the solution that'd be transparent to all parties would be to route the native IP ranges between all the participants and use the transit gateway's route tables, possibly network ACLs, and on-premises firewall rules, rather than VPN security associations, to control who can talk to whom. Both approaches are possible but different in their implementation, so this would be best to clarify first.

  • Thanks for your reply, Leo. Yes, I need to hide the origin towards 192.268.1.0/24 behind 192.168.2.0/24. Those two networks are given by my business partner, he's only accepting traffic from 192.168.2.0/24 and I'd not even know if there is an IP range overlap between his networks and my networks.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.