Amazon VPC Operations: Subnets, Route Tables, Security Groups, NACLs, NAT, Endpoints and Day-to-Day Management

AWS SysOps Associate 60 min min read Updated: Nov 17, 2026 Intermediate
Amazon VPC Operations: Subnets, Route Tables, Security Groups, NACLs, NAT, Endpoints and Day-to-Day Management
Intermediate Topic 1 of 4

VPC Building Blocks

ComponentWhat it does
VPCIsolated virtual network in one Region with a primary IPv4 CIDR (/16 to /28), optional secondary CIDRs and IPv6
SubnetRange inside one AZ. Public subnet = route to an Internet Gateway. Private subnet = no direct internet route
Route tableRules deciding where traffic goes. Each subnet has exactly one (main table by default). Longest prefix match wins
Internet Gateway (IGW)Two-way internet access for public IPs. Highly available, free
NAT gatewayLets private subnets reach the internet outbound only. Lives in a public subnet, needs an Elastic IP, scales to 100 Gbps, AZ-scoped (one per AZ)
Egress-only IGWOutbound-only for IPv6
Security groupStateful firewall at the ENI. Allow rules only
Network ACLStateless firewall at the subnet. Allow and deny rules, numbered, ephemeral ports needed on return
VPC endpointPrivate access to AWS services without internet
DHCP options, DNSenableDnsSupport, enableDnsHostnames
  • AWS reserves 5 IPs per subnet (network, router, DNS, future, broadcast)
  • Plan non-overlapping CIDRs for all VPCs and on-premises networks you will connect. Overlap blocks peering and Transit Gateway routing
  • Reserve space for growth. Use /20 or larger subnets for EKS (pods use VPC IPs)

Typical Three-Tier Layout

text VPC 10.0.0.0/16 ├─ Public subnets 10.0.0.0/24 (AZ-a), 10.0.1.0/24 (AZ-b) → ALB, NAT gateways route 0.0.0.0/0 → IGW ├─ Private app 10.0.10.0/24, 10.0.11.0/24 → EC2/ECS route 0.0.0.0/0 → NAT in same AZ └─ Private data 10.0.20.0/24, 10.0.21.0/24 → RDS, ElastiCache no internet route Endpoints: S3 + DynamoDB (gateway), SSM/ECR/Logs (interface)

Route Tables

DestinationTargetMeaning
10.0.0.0/16localTraffic inside the VPC (always present)
0.0.0.0/0igw-…Public subnet: internet
0.0.0.0/0nat-…Private subnet: outbound via NAT
10.1.0.0/16pcx-… or tgw-…Peered VPC / Transit Gateway
192.168.0.0/16vgw-… or tgw-…On-premises
pl-… (S3 prefix list)vpce-…Gateway endpoint route (added automatically)
bash aws ec2 create-vpc --cidr-block 10.0.0.0/16 --tag-specifications 'ResourceType=vpc,Tags=[{Key=Name,Value=prod}]' aws ec2 modify-vpc-attribute --vpc-id vpc-0abc --enable-dns-hostnames aws ec2 create-subnet --vpc-id vpc-0abc --cidr-block 10.0.10.0/24 --availability-zone ap-south-1a aws ec2 create-route --route-table-id rtb-0abc --destination-cidr-block 0.0.0.0/0 --nat-gateway-id nat-0abc aws ec2 describe-route-tables --filters Name=association.subnet-id,Values=subnet-0abc

Security Groups vs Network ACLs

Security groupNetwork ACL
LevelInstance/ENISubnet
StateStateful (return traffic automatic)Stateless (open ephemeral ports 1024-65535 for responses)
RulesAllow onlyAllow and Deny, evaluated in number order, first match wins
DefaultDeny all inbound, allow all outboundDefault NACL allows all. A new custom NACL denies all
ReferencesCan reference other security groupsCIDR only
UseMain controlExtra layer, block specific IPs
  • Reference the security group of the app tier in the database rule instead of IP ranges
  • Security group changes apply immediately to existing connections of removed rules? New connections are blocked, but tracked existing connections continue until they end
  • Never open 0.0.0.0/0 for SSH/RDP. Use Session Manager or EC2 Instance Connect Endpoint
  • Use managed prefix lists for repeated CIDR sets

NAT Gateway Operations

  • Create one NAT gateway per AZ and route each private subnet to the NAT in its own AZ (avoids cross-AZ cost and AZ dependency)
  • Costs: hourly + per GB processed. Reduce with gateway endpoints for S3 and DynamoDB (free) and interface endpoints for heavy services
  • Monitor ErrorPortAllocation (too many connections to one destination), PacketsDropCount, BytesOutToDestination
  • NAT instance is a cheaper manual option (disable source/destination check). Not managed or scalable

VPC Endpoints and PrivateLink

TypeServicesHow
Gateway endpointS3 and DynamoDB onlyRoute table entry with prefix list, free, regional, not reachable from on-premises or peering
Interface endpoint (PrivateLink)Most AWS services (SSM, ECR, CloudWatch, STS, Secrets Manager, KMS...) and your own or partner servicesENI with private IP in your subnets, hourly + data cost, security group, optional private DNS, reachable from on-premises over VPN/DX
Gateway Load Balancer endpointInspection appliancesRoute to the endpoint
Resource / service-network endpointsVPC Lattice and resource sharingNewer options
  • Endpoint policies restrict which principals, actions and resources the endpoint allows (for example only a specific S3 bucket)
  • Bucket policies can require aws:SourceVpce to force access through an endpoint
  • Private subnets running SSM need ssm, ssmmessages, ec2messages endpoints (and logs, monitoring for CloudWatch)
  • Enable private DNS and VPC DNS support so default service names resolve to endpoint IPs

VPC Peering

  • One-to-one private connection between two VPCs (same or different account/Region)
  • No transitive routing (A↔B and B↔C does not give A↔C), no overlapping CIDRs
  • Needs accepter approval, routes on both sides, and security group/NACL rules. For many VPCs use Transit Gateway

Other Operational Items

ItemNotes
Elastic IPStatic public IPv4. Public IPv4 addresses are now charged, so release unused ones and prefer IPv6 or private connectivity
IPv6Dual-stack subnets, every address is public-capable, control with security groups and egress-only IGW
VPC sharing (RAM)Share subnets with other accounts in the organization
ENIs and secondary IPsMove failover addresses between instances
Tags and flow logsTag network resources, enable flow logs for troubleshooting
IPAMVPC IP Address Manager plans and tracks CIDRs across accounts
Default VPCCreated per Region for quick tests. Do not use for production
Block Public Access (VPC BPA)Account-level control of internet gateway traffic

Common Connectivity Failures

SymptomCheck in order
Public instance unreachable from internetPublic IP/EIP, route to IGW, security group inbound, NACL both directions, OS firewall, service listening
Private instance cannot reach the internetRoute 0.0.0.0/0 → NAT, NAT in a public subnet with route to IGW, NAT has EIP, SG outbound, NACL
Cannot reach S3 from private subnetGateway endpoint route present, endpoint policy, bucket policy aws:SourceVpce, DNS
Two VPCs cannot talkPeering active, routes on both sides, overlapping CIDR, SG referencing peer
Name does not resolveenableDnsSupport/enableDnsHostnames, Route 53 private zone association, resolver rules
Intermittent drops through NATPort allocation errors, idle timeout (350 s), too many connections

Practice Tasks

  1. Build the three-tier VPC with two AZs, an IGW and one NAT per AZ
  2. Add S3 gateway and SSM interface endpoints and test from a private instance with no NAT
  3. Compare a security group rule with a NACL rule and prove statefulness
  4. Peer two VPCs and fix a missing return route
  5. Review all VPCs for unused NAT gateways and unattached Elastic IPs

Conclusion

Plan non-overlapping CIDRs, separate public, app and data subnets, one NAT per AZ, control traffic with stateful security groups plus optional NACLs, use gateway and interface endpoints to keep traffic private and cut NAT cost, and troubleshoot with the route, security group, NACL and DNS checklist.

Quick Summary: building blocks; layout; routes; SG vs NACL; NAT; endpoints; peering; other items; failures.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators