Interview Prep/Networking/Addressing, CIDR & Routing

Traffic must flow through a virtual firewall instance in the middle of a VPC. How do you route it?

IntermediateScenarioAddressing, CIDR & Routing
Answer

Situation read → You need to steer traffic by route table to an instance ENI and let it forward packets that are not addressed to it.

What I'd do →

  1. Add a route in the app subnet route table: destination 10.0.2.0/24 target the firewall ENI
  2. Disable the source/destination check: aws ec2 modify-instance-attribute --instance-id i-0abc --no-source-dest-check
  3. Enable forwarding in the instance: sysctl -w net.ipv4.ip_forward=1
  4. Add the matching return route so traffic is symmetric

Why → By default AWS drops packets whose source or destination is not the instance; routers and NAT boxes must opt out.

Interview tip → For production prefer Gateway Load Balancer, which scales and health-checks appliances, over a single ENI route.

All Networking questions Roadmap: Networking for DevOps

More on Addressing, CIDR & Routing