Volume 2 · Chapter 8 — AWS Networking Deep Dive (VPC)

IP Addressing, ENIs, and VPC Building Blocks in Depth

Goutham Mayaluri 5 min read AWSCloudVPCNetworking

8.1 Introduction

The certification exams probe VPC details that the fundamentals chapter glossed over: exactly how many IPs a subnet gives you, secondary CIDRs, the difference between a default and custom VPC, elastic network interfaces and their variants, Elastic IPs, IPv6 with egress-only internet gateways, and DHCP option sets. These are the mechanics an architect must know cold, because they determine capacity, connectivity, and cost.

8.2 CIDR, Subnet Sizing, and Reserved Addresses

A VPC gets a primary IPv4 CIDR block between/16(65,536 addresses) and/28(16 addresses), and you can addsecondary CIDR blockslater if you run out of space. A critical exam detail: AWSreserves five IP addresses in every subnet- the network address, the VPC router, the DNS/Amazon-provided DNS, a future-use address, and the broadcast address - so a/24subnet (256 addresses) yields only251usable IPs, not 256. This matters when sizing subnets for large fleets or for services (like the ENIs that RDS, Lambda-in-VPC, or interface endpoints consume). Subnet CIDRs must be non-overlapping subsets of the VPC CIDR and cannot be changed after creation, so sizing with headroom up front is essential.

8.3 Default VPC vs Custom VPC

Every account comes with adefault VPCper Region - preconfigured with a/16, a public subnet in each AZ, an internet gateway, and route tables, so instances launched there get public connectivity automatically. It’s convenient for quick starts but not how you build production - acustom VPCgives you full control over CIDR, subnet layout (public/private tiers), routing, and security. The exam expects you to know the default VPC exists and is public-by-default, and that production architectures use purpose-built custom VPCs with private subnets for sensitive tiers.

8.4 Elastic Network Interfaces (ENI, ENA, EFA) and Elastic IPs

An**Elastic Network Interface (ENI)is a virtual network card in a subnet - it has a private IP, optional public/Elastic IP, MAC address, and security groups, and can be attached/detached and moved between instances (useful for failover of a fixed IP/MAC). Many managed services (interface VPC endpoints, RDS, Lambda-in-VPC) work by placing ENIs in your subnets, consuming IPs. Two performance variants matter: theElastic Network Adapter (ENA)enables enhanced networking (higher throughput, lower latency) on supported instances, and theElastic Fabric Adapter (EFA)adds OS-bypass for HPC and tightly-coupled workloads (MPI). AnElastic IP (EIP)**is a static public IPv4 address you own and can remap between resources; EIPs are a limited, now-chargeable resource, so you release unused ones (a Trusted Advisor cost check flags unattached EIPs).

flowchart TB
  Subnet["Subnet /24 = 251 usable IPs (5 reserved)"] --> ENI1[ENI - private IP + SGs]
  ENI1 --> Inst[EC2 instance]
  ENI1 -.optional.-> EIP[Elastic IP - static public IPv4]
  Subnet --> ENI2[ENI - interface endpoint]
  Subnet --> ENI3[ENI - RDS / Lambda-in-VPC]
  Note[Managed services consume ENIs and IPs in your subnets] -.-> ENI2

8.5 IPv6 and Egress-Only Internet Gateways

AWS supports dual-stack VPCs (IPv4 + IPv6). A key exam distinction: IPv6 addresses in AWS are allglobally unique and public- there’s no NAT for IPv6. To give IPv6 resources outbound-only internet access (the IPv6 equivalent of a NAT gateway’s role) you use anegress-only internet gateway, which allows outbound IPv6 traffic while blocking inbound - so IPv6 private workloads can reach the internet without being reachable. Remember: NAT gateway is for IPv4 outbound-only; egress-only internet gateway is the IPv6 counterpart.

8.6 DHCP Option Sets and DNS in the VPC

A VPC has DNS attributes (enableDnsSupportandenableDnsHostnames) that control whether the Amazon-provided DNS resolver works and whether instances get DNS hostnames - both often must be enabled for private hosted zones and interface-endpoint private DNS to resolve.DHCP option setslet you customize the DNS servers, domain name, and NTP/NetBIOS settings handed to instances - for example pointing instances at your own on-premises DNS in a hybrid setup. These are the knobs behind name resolution in a VPC, and misconfigured DNS attributes are a common reason private DNS or endpoint resolution fails.

8.7 Banking Production Scenario

A bank sizes its VPC as a/16and carves/24subnets (251 usable IPs each) across three AZs, adding a secondary CIDR when a large EKS cluster’s ENIs exhaust the original range. It never uses the default VPC for workloads. Interface endpoints, RDS, and Lambda-in-VPC each consume ENIs in the private subnets, which the bank accounts for in IP planning. A dual-stack customer-facing tier uses IPv6 with an egress-only internet gateway for outbound patching without inbound exposure. DHCP option sets point instances at the corporate DNS over Direct Connect for hybrid name resolution, and the VPC’s DNS attributes are enabled so interface-endpoint private DNS resolves. This precise IP and interface planning is exactly what a certified architect is expected to get right.

8.8 Chapter Revision Notes

  • VPC CIDR /16–/28; add secondary CIDRs if you run out. AWS reserves 5 IPs per subnet, so a /24 gives 251 usable.
  • Default VPC (one per Region) is public-by-default for quick starts; production uses custom VPCs with private tiers.
  • ENIs are virtual NICs (private IP, SGs, movable) that managed services consume; ENA = enhanced networking, EFA = HPC OS-bypass; EIP = static remappable public IPv4 (release unused ones).
  • IPv6 is always public (no NAT); use an egress-only internet gateway for outbound-only IPv6 (the NAT-gateway counterpart).
  • VPC DNS attributes + DHCP option sets control name resolution; enable DNS support/hostnames for private hosted zones and endpoint private DNS.