Skip to content

Can VPC B Access On-Prem Network via VPC A with Direct Connect and Transit Gateway

0

Hello, I have the following AWS network setup and would like to confirm if it’s possible to enable VPC B (Customer VPC) to access my on-premises network via VPC A, which is connected to on-prem via a Direct Connect connection through a Transit Gateway.

Here are the key details of the architecture: 1.VPC A has a Direct Connect connection to my on-premises data center via a Transit Gateway. 2.VPC B is peered with VPC A (VPC peering connection between VPC A and VPC B). 3.I want to route traffic from resources in VPC B to my on-prem network, using VPC A as the intermediary through the existing Transit Gateway and Direct Connect connection.

Is it possible to route traffic from VPC B to my on-premises network through VPC A, leveraging the existing Direct Connect link and Transit Gateway? Any insights or resources you can provide would be greatly appreciated. Thanks in advance!

1 Answer
2
Accepted Answer

The VPC peering connection you have cannot be used to route any packets to destinations outside the peered VPC. That would be called transitive routing, and that's only possible through the transit gateway you already have.

If you want traffic from VPC B to pass through a firewall in VPC A to reach on-premises, you'll need to associate with the VPC attachment of VPC B a transit gateway route table that specifies the next hop towards your on-premises networks as the VPC attachment for VPC A. This will cause packets destined from VPC B towards on-premises to be delivered to VPC A. Inside VPC A, you'll need to ensure that the VPC route table (no longer the TGW route table) for the subnets where the TGW attachments reside is set to route arriving packets to the right interface on your firewall appliance.

The firewall appliance needs a second network interface (ENI) in a different subnet. That subnet must have a VPC route table that specifies the TGW attachent as the next hop towards on-premises CIDRs. This will cause packets processed by the firewall to be sent back to the TGW.

The TGW VPC attachment for VPC A must be associated with a different TGW route table. This second route table should specify the DXGW attachment towards on-premises as the next hop towards the on-premises CIDRs. This setup ensures that when packets headed for on-premises arrive from VPC A after the firewall has processed them, they'll get sent towards the DXGW and not looping back to the firewall. A TGW route table matching this description you're probably already using for VPC A.

The VPC peering connection cannot be used for any of this traffic between VPCs A and B. It can be used for other IP addresses in the VPCs, but not for the on-premises IPs.

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

EXPERT

reviewed 2 years ago

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.