- Newest
- Most votes
- Most comments
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.
Relevant content
asked 2 years ago
