A route table has 10.0.0.0/16 -> local and 10.0.1.0/24 -> vpn-gw. Where does a packet to 10.0.1.5 go?
BeginnerScenarioAddressing, CIDR & Routing
Answer
Situation read → Two routes match the destination and the router must pick one.
What I'd do →
- Apply longest prefix match: /24 is more specific than /16
- Packet goes to the VPN gateway, not local
- AWS now accepts routes more specific than the local route (for example to steer a subnet range to a firewall ENI), so check
aws ec2 describe-route-tablesfor what is really configured - On Linux test with
ip route get 10.0.1.5
Why → Routers always prefer the most specific matching prefix before looking at metrics or administrative distance.
Interview tip → Say you read the effective route table rather than assuming, because more-specific-than-local routes are legal in AWS today.
More on Addressing, CIDR & Routing
You own 10.0.0.0/16 for a new VPC and need separate /24 subnets for dev, QA and prod across two AZs. How do you carve it up?BeginnerA host is configured as 192.168.1.130/25. What network does it belong to and what is the broadcast address?BeginnerHow many usable IPs does an AWS subnet of /28 have?BeginnerA newly built server can ping everything in its subnet but nothing outside. What is the first thing you check?BeginnerYou are picking a private range for a new company network. Which RFC 1918 range do you choose and why?BeginnerA server has two NICs and traffic to 10.20.0.0/16 is leaving through the wrong one. How do you see and fix the route?Beginner