Sub topic 14
Centralized inspection and appliance mode
This chapter assumes you know how transit gateway route tables, association, and propagation work, and how VPC route entries point at a transit gateway.
Why route traffic through one inspection VPC
Many teams want every inter-VPC flow to pass a firewall or intrusion-detection appliance. Running an appliance in every VPC is costly. A common alternative is one inspection VPC that holds the appliances, with the transit gateway steering traffic through it.
The design uses two transit gateway route tables:
- Spoke route table. Spoke VPC attachments are associated with it. It holds a static
0.0.0.0/0route that targets the inspection VPC attachment, so all spoke traffic goes to the appliances first. - Inspection route table. The inspection VPC attachment is associated with it. Each spoke attachment propagates into it, so the transit gateway knows how to return traffic to each spoke.
The asymmetric routing problem
The inspection VPC has one subnet per Availability Zone (AZ), and each subnet usually has its own appliance. By default, the transit gateway sends traffic to the attachment network interface in the same AZ as the sender. The reply may come from a different AZ, so it can reach a different appliance than the request did.
A stateful firewall tracks connections. If it sees only half of a flow, it drops the packets.
What appliance mode does
Appliance mode is an option on a VPC attachment. When you enable it, the transit gateway picks one network interface in the inspection VPC for the lifetime of a flow, using a hash of the flow's source and destination. Traffic in both directions goes through that same interface, so one appliance sees the whole connection.
Enable it when you create the attachment, or change it later:
aws ec2 modify-transit-gateway-vpc-attachment \
--transit-gateway-attachment-id tgw-attach-0123456789abcdef0 \
--options ApplianceModeSupport=enableEnable it on the inspection VPC attachment only. Spoke attachments do not need it.
Gotchas
- Route tables inside the inspection VPC must also be symmetric. Send traffic returning from the appliance to the transit gateway, not to an internet gateway or NAT you did not intend.
- Without a
0.0.0.0/0route in the spoke VPC route tables pointing to the transit gateway, traffic never reaches the transit gateway at all. - Traffic between two spokes passes through the inspection VPC twice in the diagram's path (in and out). Plan appliance throughput for that.
- Appliances behind a Gateway Load Balancer scale and fail over more cleanly than hand-managed instances. Appliance mode still matters for the transit gateway hop.
Exercise
A stateful firewall in an inspection VPC drops some return traffic between two spoke VPCs. The inspection VPC has appliances in two AZs. What is the likely cause, and what setting fixes it?
Show answer
Requests and replies are taking different AZs, so each appliance sees only half of the connection. Enable appliance mode (ApplianceModeSupport=enable) on the inspection VPC attachment so the transit gateway keeps both directions of a flow on the same network interface.