Cloud networking
Core15
What is a VPC, and how do an AWS VPC, an Azure VNet and a GCP VPC differ?
Say this first
A VPC is a private, isolated network you define inside a cloud provider: you pick the address space, cut it into subnets, and control routing and filtering. An AWS VPC and an Azure VNet are regional. A GCP VPC is global: one network spans every region, and only its subnets are regional.
Go deeper
What you get
- An address space you choose (RFC 1918 normally), split into subnets.
- Route tables that decide where traffic leaves each subnet.
- Stateful filters on instances or subnets (security groups, NSGs, firewall rules).
- Gateways for the outside world: internet, NAT, VPN, private circuits, peering.
The provider runs the actual forwarding in its own software-defined fabric. There is no broadcast and no real layer 2: ARP is answered by the hypervisor, and multicast is not supported by default.
Scope differences
AWS VPC Azure VNet GCP VPC Scope One region One region Global Subnet scope One AZ Region (spans zones) Region (spans zones) Address space Set on the VPC, /16 to /28, secondary CIDRs allowed Set on the VNet, can add ranges Set per subnet, no VPC-level CIDR Routing and firewall objects Per subnet route tables, per ENI security groups Route tables per subnet, NSGs per subnet or NIC Routes and firewall rules belong to the whole VPC Why the GCP model matters
In GCP two VMs in different regions of the same VPC talk over Google's backbone with no peering and no gateway. In AWS or Azure the same design needs one VPC or VNet per region plus peering or a transit hub between them.
They will ask next
Does a VPC have a broadcast domain like a VLAN?
No. The fabric is layer 3 underneath. Broadcast and multicast are not delivered between instances by default, and the hypervisor answers ARP for the subnet. That is why tricks such as gratuitous ARP failover between two VMs do not work in a VPC: you move a secondary IP or change a route instead.
What is the default VPC in AWS?
Every region gets one,
172.31.0.0/16, with a/20default subnet per AZ, an internet gateway and public IPs auto-assigned. It is handy for tests and a poor choice for production because its range collides with every other default VPC.
Traps
- Saying an AWS VPC spans regions. It is regional; only GCP VPCs are global.
- Treating a subnet like a VLAN where layer 2 tricks (VRRP, gratuitous ARP) just work.
How do subnets relate to availability zones, and how many addresses do you lose in each subnet?
Say this first
In AWS a subnet lives in exactly one availability zone, so for high availability you build one subnet per tier per AZ. Azure and GCP subnets are regional and span zones. AWS and Azure reserve 5 addresses in every subnet and GCP reserves 4, so a /28 in AWS gives 11 usable addresses, not 14.
Go deeper
AWS
A subnet is tied to one AZ (
us-east-1a, for example). A typical layout for two AZs:Subnet AZ CIDR public-a us-east-1a 10.10.0.0/24 public-b us-east-1b 10.10.1.0/24 private-a us-east-1a 10.10.10.0/24 private-b us-east-1b 10.10.11.0/24 Reserved in
10.10.10.0/24:.0network,.1VPC router,.2Amazon DNS,.3reserved for future use,.255broadcast (broadcast is not supported, but the address is still held back). Subnet size is/16to/28.Azure
A subnet spans all zones in the region; you pick the zone per VM or per zonal resource. Azure reserves
.0network,.1default gateway,.2and.3for Azure DNS mapping, and the last address. The smallest subnet is/29. Some services need a dedicated subnet with a fixed name, such asGatewaySubnetfor VPN and ExpressRoute gateways andAzureFirewallSubnetfor Azure Firewall.GCP
Subnets are regional. GCP reserves the network address, the gateway (
.1), the second-to-last address and the broadcast address in the primary range.They will ask next
Why not use one big subnet per tier in AWS?
You cannot: a subnet cannot cross AZs. And if all instances sat in one AZ, losing that AZ would take the tier down. One subnet per tier per AZ is the normal pattern.
How many usable addresses are in an AWS /27?
32 minus 5 reserved, so 27.
Traps
- Forgetting the 5 reserved addresses when sizing small subnets for load balancers or endpoints.
- Assuming Azure subnets are zonal like AWS subnets.
How did you do?Own pageWhat actually makes a subnet public or private in AWS?
Say this first
Only its route table. A public subnet is associated with a route table that has a default route (
0.0.0.0/0) to an internet gateway. A private subnet has no route to an internet gateway; it usually sends0.0.0.0/0to a NAT gateway instead. The instance also needs a public IP to be reachable from the internet.Go deeper
The three conditions for an instance to talk to the internet directly
- Its subnet's route table has
0.0.0.0/0(or::/0) pointing to anigw-target. - It has a public IPv4 address or an Elastic IP (or a global IPv6 address).
- Security group and network ACL allow the traffic.
Miss any one and it does not work. "Public subnet" is not a checkbox; it is a label people use for condition 1. The "auto-assign public IPv4" subnet setting only helps with condition 2.
Typical route tables
Output rtb-public rtb-private-a 10.10.0.0/16 local 10.10.0.0/16 local 0.0.0.0/0 igw-0c1d2e3f4a5b60789 0.0.0.0/0 nat-0f1e2d3c4b5a69788Why private subnets
Databases and app servers should not be reachable from the internet at all. In a private subnet they can still start outbound connections (updates, APIs) through the NAT gateway, but nothing can open a connection to them from outside.
They will ask next
An instance has a public IP but sits in a private subnet. Can you reach it?
No. Return traffic would follow the subnet's default route to the NAT gateway, not the internet gateway, and inbound packets to the public IP cannot be delivered without an IGW route. The public IP is useless there.
Where do you put a load balancer for a private web tier?
An internet-facing ALB or NLB goes in public subnets (one per AZ); its targets stay in private subnets. The load balancer nodes have public addresses, the servers do not.
Traps
- Saying a subnet is public because instances in it got public IPs.
- Forgetting that the route table association decides it, and a subnet with no explicit association uses the main route table.
How did you do?Own page- Its subnet's route table has
How do route tables work in a VPC, and how is that different in Azure and GCP?
Say this first
In AWS each subnet is associated with exactly one route table; subnets without an explicit association use the main route table. Every table has a
localroute for the VPC CIDR that you cannot delete. Lookups use longest prefix match. Azure starts with system routes and lets you override them with user-defined routes per subnet. GCP routes belong to the whole VPC and can be scoped with network tags.Go deeper
AWS
- Local route.
10.10.0.0/16 localis in every table. All subnets in the VPC can reach each other unless a security group or NACL stops it. - Targets.
igw-,nat-,pcx-(peering),tgw-,vgw-,eni-(an appliance),vpce-(gateway or GWLB endpoint), egress-only IGW for IPv6. - Selection. Longest prefix match first. For identical prefixes, static routes beat propagated (BGP) routes.
- Propagation. A route table can learn routes from a virtual private gateway when route propagation is enabled for it.
- Gateway route tables. You can associate a route table with the internet gateway or virtual private gateway itself (edge association) to steer inbound traffic through a firewall appliance.
Azure
Every subnet gets system routes: the VNet range, peered VNets,
0.0.0.0/0to Internet, and next hopNonefor RFC 1918 and100.64.0.0/10ranges that are not in the VNet. You attach a route table of user-defined routes (UDRs) to a subnet with next hop types such asVirtualAppliance,VirtualNetworkGateway,InternetorNone. For the same prefix, a UDR beats a BGP route, which beats a system route.GCP
Routes are VPC-wide objects. Subnet routes are created for you. A default route to the default internet gateway exists until you delete it. Custom static routes have a priority (lower wins on a tie) and can apply only to instances with a network tag. Cloud Router adds dynamic routes, either for its own region or for all regions depending on the VPC's dynamic routing mode.
They will ask next
Can you route traffic between two subnets of the same VPC through a firewall?
Yes. AWS lets you add a route more specific than the VPC CIDR, for example the other subnet's
/24, pointing to the firewall's ENI or a GWLB endpoint. Without that, thelocalroute sends subnet-to-subnet traffic straight across.Why did my BGP route from the VPN not appear in the subnet's route table?
Route propagation from the virtual private gateway is off for that route table. Propagation is enabled per route table, not per VPC.
Traps
- Thinking a route table is per VPC in AWS. It is associated per subnet.
- Forgetting the main route table. A new subnet silently uses it until you associate another.
How did you do?Own page- Local route.
What is the difference between an internet gateway and a NAT gateway?
Say this first
An internet gateway gives a VPC two-way internet access for instances that have public IPs; it does one-to-one NAT between the public and private address. A NAT gateway lets instances with only private addresses start outbound connections and share one Elastic IP, while blocking inbound connections. A NAT gateway is zonal, sits in a public subnet, and needs its own route to the internet gateway.
Go deeper
Internet gateway (IGW)
- One per VPC, highly available by design, no bandwidth knob to size.
- Does static 1:1 NAT for instances with public IPv4 or Elastic IPs. The instance OS only ever sees its private address.
- For IPv6 there is no NAT. An egress-only internet gateway gives outbound-only IPv6, which is the IPv6 equivalent of a NAT gateway's protection.
NAT gateway
- Created in one subnet of one AZ. A public NAT gateway has an Elastic IP and must sit in a public
subnet (route
0.0.0.0/0to the IGW). - Private subnets route
0.0.0.0/0to it. It translates source address and port (PAT). - Supports up to 55,000 simultaneous connections to each unique destination (IP, port, protocol).
- For AZ resilience you deploy one per AZ and point each private subnet at the NAT gateway in its own AZ. One shared NAT gateway is a single point of failure and adds cross-AZ data charges.
- A private NAT gateway has no Elastic IP and translates to its private address. It is used to reach other networks (for example through a transit gateway) when address ranges overlap.
- You cannot attach a security group to it. The subnet's network ACL still applies.
Equivalents
- Azure: NAT Gateway, a managed resource associated with subnets, using public IPs or prefixes. Each public IP gives 64,512 SNAT ports.
- GCP: Cloud NAT, configured on a Cloud Router. It is software-defined: there is no NAT box in the data path, the translation happens in the host networking stack.
They will ask next
Why does a NAT gateway have to be in a public subnet?
It forwards translated traffic using its own subnet's route table. If that table has no
0.0.0.0/0to the internet gateway, the NAT gateway has nowhere to send packets.Can you use a NAT instance instead?
Yes, an EC2 instance with IP forwarding, source/destination check disabled, and iptables masquerade. It is cheaper at low volume but you own its availability, patching and throughput.
Traps
- Placing the NAT gateway in a private subnet. It looks healthy and nothing works.
- Assuming one NAT gateway is regional and highly available. It lives in one AZ.
How did you do?Own pageSecurity groups versus network ACLs. What is the difference, and when would you use each?
Say this first
A security group is a stateful firewall on each network interface. It has allow rules only, all rules are evaluated together, and return traffic is allowed automatically. A network ACL is stateless and applies to the whole subnet. Its numbered rules are checked lowest first, the first match wins, it can allow or deny, and you must open return traffic yourself, usually ephemeral ports 1024 to 65535.
Go deeper
Security group Network ACL Attached to ENI (instance, endpoint, load balancer) Subnet State Stateful Stateless Rules Allow only Allow and deny Evaluation All rules, most permissive wins By rule number, lowest first, first match Sources CIDR, prefix list, another security group CIDR only Default New SG: no inbound, all outbound Default NACL allows all; a new custom NACL denies all How I use them
- Security groups do the real work. Reference groups instead of addresses: the app SG allows port 8080 from the web SG, the DB SG allows 5432 from the app SG. Instances can be replaced or scaled and the rules still hold.
- NACLs are a coarse guard rail. Block a known bad range, or enforce "this subnet never talks to that subnet" as a second layer. Keep them simple, because every rule needs a matching return rule.
The return traffic trap
A NACL that allows inbound 443 must also allow outbound to the client's ephemeral ports, and a subnet whose instances make outbound calls needs inbound rules for the replies. Linux uses 32768 to 60999, Windows uses 49152 to 65535, and load balancers can use anything from 1024. Allowing 1024 to 65535 is the usual answer.
They will ask next
Can you block one IP address with a security group?
No. Security groups have no deny rule. Use a network ACL deny rule with a lower number than the allow rules, or AWS WAF for HTTP traffic.
What does the default security group allow?
Inbound from other members of the same default security group, and all outbound. Many teams remove its rules so nobody uses it by accident.
Does changing a security group rule cut existing connections?
Not always. Tracked connections can keep flowing after you remove the rule that allowed them, until they close or time out. A NACL change takes effect on the next packet because it has no state.
Traps
- Saying network ACLs are stateful, or that security groups support deny rules.
- Forgetting outbound ephemeral ports on a NACL, then blaming the application.
How did you do?Book 8.5 Example SystemsOwn pageAn EC2 instance has a public IP, but ip addr inside the OS shows only a 10.x address. Why?
Say this first
The public address never reaches the instance. The internet gateway does one-to-one NAT: outbound it rewrites the private source to the public IP, inbound it rewrites the public destination back to the private IP. An auto-assigned public IP changes on stop and start; an Elastic IP is a static address you own until you release it. AWS charges for every public IPv4 address, attached or not.
Go deeper
How it works
The instance's ENI has
10.10.0.25. AWS maps203.0.113.25to it at the edge. Applications must not bind to the public address, and anything that embeds its own IP in the payload (SIP, FTP active mode) needs to be told the public address.Auto-assigned public IP vs Elastic IP
Auto-assigned Elastic IP Lifetime Released on stop or terminate Yours until released Move between instances No Yes, remap in seconds Use cases Throwaway or test instances NAT gateways, allow-listed partners, fixed DNS Cost
Since February 2024 AWS charges an hourly fee for every public IPv4 address, in use or idle. That is one more reason to keep servers private behind load balancers and NAT, and to look at IPv6.
Azure and GCP
Same idea: Azure public IP resources attach to a NIC or a load balancer, and GCP external IPs (ephemeral or static) are attached to the VM's access config. The guest OS sees only the internal address in both.
They will ask next
How can the instance find out its own public IP?
From instance metadata (
public-ipv4underhttp://169.254.169.254/latest/meta-data/, with an IMDSv2 token), or by calling an external "what is my IP" service.Can an instance in a private subnet with an Elastic IP be reached?
No. Without an IGW route in its subnet the mapping is useless; replies go to the NAT gateway.
Traps
- Configuring the Elastic IP as a secondary address inside the OS. It breaks nothing only by luck.
- Saying the instance "has" the public IP on its interface.
How did you do?Own pageWhat are the ways to connect an on-prem data center to the cloud, and how do you choose?
Say this first
Three families: an IPsec site-to-site VPN over the internet, a private circuit (AWS Direct Connect, Azure ExpressRoute, Google Cloud Interconnect), or an SD-WAN overlay that extends into the cloud. VPN is quick and cheap but limited in bandwidth and rides the internet. A private circuit gives steady latency, higher bandwidth and cheaper egress but takes weeks to order. Most enterprises run a circuit as primary and a VPN as backup.
Go deeper
Site-to-site VPN Private circuit SD-WAN into cloud Lead time Minutes Weeks (cross-connect, provider) Days Bandwidth Around 1.25 Gbps per AWS tunnel, scale with ECMP 50 Mbps to 100 Gbps Depends on appliances Path Public internet, encrypted Private, not encrypted by default Overlay over any transport Latency Varies with the internet Predictable Varies Cost Hourly per connection Port hours plus lower egress rates Licenses plus cloud instances How I choose
- Proof of concept or small office: VPN.
- Production data center with steady traffic or latency-sensitive apps: two circuits in two locations, with a VPN as a cheap extra backup.
- Many branches already on SD-WAN: extend the fabric with virtual appliances in a transit VPC or VNet, or the provider's native SD-WAN integration (AWS Transit Gateway Connect, Azure Virtual WAN).
- Compliance requires encryption on the circuit: MACsec where supported, or IPsec over the circuit.
BGP is the routing protocol on every one of these options; static routing exists for VPNs but loses automatic failover.
They will ask next
Is Direct Connect encrypted?
No. It is a private path, not an encrypted one. Use MACsec on supported dedicated connections, or run IPsec over the circuit if the policy demands encryption.
Why keep a VPN if you have two circuits?
It is cheap insurance against a shared failure, such as both circuits in one provider or a misconfiguration that drops both BGP sessions. Make sure the VPN routes are less preferred.
Traps
- Saying a private circuit is encrypted because it is private.
- Proposing a single circuit as "redundant" because the provider has two routers.
How did you do?Own pageWhat does it mean that VPC peering is non-transitive, and why does it matter?
Say this first
A peering connection only carries traffic between the two VPCs it joins. If A peers with B and B peers with C, A cannot reach C through B. A also cannot use B's internet gateway, NAT gateway, VPN, Direct Connect or gateway endpoint. Full connectivity between n VPCs needs n(n-1)/2 peerings, so beyond a handful of VPCs you move to a transit gateway.
Go deeper
Rules in AWS
- One-to-one, between two VPCs, same or different account, same or different region.
- CIDRs must not overlap.
- No edge-to-edge routing: traffic must start or end in one of the two peered VPCs.
- Both sides must add routes to the other VPC's CIDR with the
pcx-target, and security groups must allow the traffic. Peering by itself routes nothing. - In the same region, security groups can reference a group in the peer VPC.
- No hourly charge. Data across AZs or regions is charged as usual.
The scaling math
VPCs Peerings for full mesh 5 10 10 45 50 1225 Each one also needs route entries on both sides. That is where a transit gateway wins.
Other clouds
- Azure VNet peering is non-transitive too. The exceptions are gateway transit (spokes use the hub's VPN or ExpressRoute gateway) and routing through a network virtual appliance with UDRs.
- GCP VPC Network Peering is non-transitive. It exchanges subnet routes, and custom routes only if you enable import and export.
They will ask next
When is peering still the right choice over a transit gateway?
For a few VPCs with heavy traffic between them. Peering has no per-GB processing charge and no hop, so two VPCs that move terabytes between them are cheaper and simpler peered directly.
VPC A peers with B, and B has a VPN to on-prem. Can A reach on-prem through it?
No. That is edge-to-edge routing and AWS drops it. Give A its own path, or connect all three to a transit gateway.
Traps
- Adding the route in one VPC only. Replies need a route back.
- Assuming a peer VPC can use your NAT gateway for internet access.
How did you do?Book 3.4 RoutingOwn pageWalk me through an AWS site-to-site VPN. What do you get, and how does it stay redundant?
Say this first
You create a customer gateway (your device's public IP and ASN), a virtual private gateway on the VPC or a transit gateway, and a VPN connection between them. Each VPN connection has two IPsec tunnels ending on two AWS endpoints in different AZs. You run BGP over both tunnels (or use static routes) and AWS gives each tunnel a /30 inside address from 169.254.0.0/16. For real redundancy you add a second customer device with its own VPN connection.
Go deeper
Pieces
- Customer gateway (CGW): a record of your public IP and BGP ASN.
- Virtual private gateway (VGW): attached to one VPC. Amazon side ASN defaults to 64512. Or terminate on a transit gateway to serve many VPCs.
- VPN connection: two tunnels, each to a different AWS endpoint. IKEv1 or IKEv2, PSK or certificates.
Inside addressing
Each tunnel gets a
/30such as169.254.10.0/30. AWS uses the first host (169.254.10.1), your router uses the second (169.254.10.2). BGP runs between those addresses.Behaviour worth knowing
- By default your device must start IKE; AWS waits. Tunnel options can make AWS initiate with IKEv2.
- A standard tunnel carries around 1.25 Gbps. A VGW will not load-share across tunnels. A transit gateway can ECMP across tunnels and across several VPN connections with BGP.
- Dead peer detection timeout defaults to 30 seconds.
- AWS-provided sample configs clamp TCP MSS on the tunnel interface to avoid fragmentation.
Equivalents
- Azure VPN Gateway (route-based) lives in
GatewaySubnet. Active-standby by default with one public IP; active-active uses two. Default Azure ASN for BGP is 65515. - GCP HA VPN has two interfaces with two external IPs. With tunnels from both interfaces and BGP on Cloud Router it carries a 99.99% SLA; Classic VPN is 99.9%.
They will ask next
Why prefer BGP over static routes on a cloud VPN?
BGP withdraws routes when a tunnel dies, so failover is automatic and fast. With static routes AWS relies on tunnel state alone, and any new on-prem prefix needs a manual route change.
One tunnel shows DOWN in the console all the time. Is that a problem?
Yes, it means you have no redundancy. AWS performs maintenance on one endpoint at a time and expects both tunnels up. Configure both on your device.
Traps
- Configuring only one tunnel because "it works".
- Thinking a VGW load-balances over both tunnels. It does not; a TGW with ECMP does.
How did you do?Book 8.5 Example SystemsOwn pageALB, NLB and GWLB. What is each one for?
Say this first
An Application Load Balancer works at layer 7: it terminates HTTP and HTTPS, routes on host, path and headers, and always opens a new connection to the target, passing the client IP in X-Forwarded-For. A Network Load Balancer works at layer 4 for TCP, UDP and TLS, gives one static IP per AZ, handles very high rates with low latency, and can preserve the client IP. A Gateway Load Balancer sends traffic to firewall appliances inline, wrapped in GENEVE on UDP 6081.
Go deeper
ALB NLB GWLB Layer 7 (HTTP, HTTPS, gRPC) 4 (TCP, UDP, TLS) 3, transparent Routing Host, path, header, query, method Port and protocol All traffic to appliances Static IP No, use the DNS name One per AZ, or Elastic IPs Not addressed by clients Client IP at target In X-Forwarded-ForPreserved for instance targets by default Original packet inside GENEVE Typical use Web apps, microservices, WAF Non-HTTP, extreme rates, PrivateLink services Inline firewalls and IDS Notes that come up
- ALB node addresses change. Partners who need a fixed IP get an NLB, or Global Accelerator in front.
- An NLB can be the front of a PrivateLink endpoint service; an ALB cannot by itself (you can put an ALB behind an NLB as a target).
- GWLB is used with GWLB endpoints placed as route targets in VPC route tables, so traffic is steered to the appliance fleet and back without changing addresses.
Other clouds
AWS Azure GCP ALB Application Gateway (regional), Front Door (global) Application Load Balancer NLB Azure Load Balancer (Standard) Network Load Balancer, passthrough or proxy GWLB Gateway Load Balancer Internal passthrough Network LB as a route next hop Route 53 DNS steering Traffic Manager Cloud DNS routing policies They will ask next
Which one would you put in front of a gRPC service?
An ALB with an HTTP/2 target group if I want per-request routing and health checks at layer 7. An NLB if I only need connection-level balancing, accepting that long-lived HTTP/2 connections pin to one target.
Why does the backend see the ALB's address as the source?
The ALB is a full proxy. It ends the client's TCP connection and opens its own to the target. The original client IP travels in
X-Forwarded-For.
Traps
- Saying an ALB has a static IP.
- Putting UDP traffic behind an ALB. Only an NLB handles UDP.
How did you do?Book 9.1 Traditional ApplicationsOwn pageWhat routing policies does Route 53 offer, and when is an alias record better than a CNAME?
Say this first
Simple, weighted, latency-based, failover, geolocation, geoproximity, multivalue answer and IP-based. Weighted shifts a percentage of traffic, latency sends users to the closest region by measured latency, failover returns a standby when the primary's health check fails. An alias record points to an AWS resource, works at the zone apex where a CNAME is not allowed, and alias queries to AWS resources are free.
Go deeper
Policies
Policy Answers with Typical use Simple One record set A single endpoint Weighted Records in proportion to weights Canary or blue-green, 90/10 Latency The region with lowest latency for the resolver Active-active multi-region Failover Primary, or secondary if the primary is unhealthy Active-passive DR Geolocation By continent, country or US state Compliance, localized content Geoproximity By distance with a bias Shift load between regions Multivalue answer Up to 8 healthy records Simple client-side spreading IP-based By the client's source network (CIDR collections) Steer known ISPs or offices Health checks
- Checkers in several AWS regions probe the endpoint, every 30 seconds by default (10 seconds as an option), and mark it unhealthy after 3 failures by default.
- They run from the internet, so they cannot probe a private IP. For private endpoints, base the health check on a CloudWatch alarm.
- Failover is only as fast as the record TTL lets clients notice. Keep TTLs short (60 seconds or less) on records you expect to fail over.
Alias vs CNAME
- A CNAME cannot sit at the apex (
example.com) because the apex already has SOA and NS records and a CNAME cannot coexist with other data. - An alias is a Route 53 feature that returns the target's A or AAAA records directly, follows the target's address changes, and is free for queries to AWS targets such as ELB, CloudFront and S3 websites.
Private hosted zones
Answer only inside the VPCs they are associated with. Useful for internal names and split-horizon DNS.
They will ask next
Why does latency routing sometimes send a user to the wrong region?
Route 53 sees the recursive resolver's address, not the user's. A user on a far-away public resolver gets the region closest to that resolver. EDNS Client Subnet helps when the resolver sends it.
What is the Azure equivalent?
Traffic Manager, a DNS-based traffic router with priority, weighted, performance, geographic, multivalue and subnet methods. Front Door does it at layer 7 with anycast instead of DNS.
Traps
- Promising instant DNS failover. Clients and resolvers cache answers for the TTL, and some ignore it.
- Pointing a Route 53 health check at a private IP.
How did you do?Book 9.3 Infrastructure ApplicationsOwn pageExplain the Kubernetes networking model. How do pods on different nodes talk to each other?
Say this first
Every pod gets its own IP, and every pod can reach every other pod on any node without NAT. Each node gets a slice of the pod CIDR, often a /24. The CNI plugin creates the pod's interface, assigns the IP and makes the cross-node path work, either with an overlay (VXLAN or IP-in-IP), with plain routing (BGP or cloud route tables), or by giving pods real VPC addresses like the AWS VPC CNI and Azure CNI do.
Go deeper
Inside a node
Each pod has its own network namespace. The CNI plugin creates a veth pair: one end is
eth0in the pod, the other sits on the host, attached to a bridge or routed by the host. Containers in one pod share the namespace and talk overlocalhost.Between nodes
Approach How Examples Overlay Encapsulate pod packets between node IPs Flannel VXLAN, Calico VXLAN or IP-in-IP, Cilium VXLAN or Geneve Routed Advertise each node's pod CIDR Calico with BGP, cloud route tables VPC-native Pods get VPC addresses, the cloud fabric routes them AWS VPC CNI, Azure CNI, GKE VPC-native (alias IPs) Overlay works anywhere but adds encapsulation overhead and lowers the pod MTU. VPC-native avoids the overlay and makes pods first-class in security groups and flow logs, but uses VPC addresses fast.
What CNI is
The Container Network Interface is a spec and a set of plugins. The container runtime calls the plugin with ADD and DEL when a pod sandbox is created or removed. The plugin handles interface setup and IPAM. Network policy enforcement is a separate capability that some CNIs provide (Calico, Cilium) and others do not (Flannel on its own).
Three ranges to plan
Node addresses, the pod CIDR and the service CIDR. None of them may overlap with each other or with networks pods must reach.
They will ask next
A pod gets stuck in ContainerCreating with a CNI error. What do you check?
kubectl describe podevents for the CNI message, the CNI daemonset pods on that node, and IP exhaustion: on the AWS VPC CNI the subnet or the node's ENI limit may have no addresses left.Why might large packets fail between pods on an overlay?
VXLAN adds 50 bytes. If the pod MTU is not reduced to fit the node MTU, large packets are dropped or fragmented. Most CNIs set the pod MTU automatically; custom setups often get it wrong.
Traps
- Saying pods talk through NAT by default. The model requires no NAT between pods.
- Forgetting that the pod CIDR must not overlap with on-prem networks the pods call.
How did you do?Book Perspective: Virtual Networks All the Way DownOwn pageWhat are ClusterIP, NodePort and LoadBalancer Services, and how are they implemented?
Say this first
A Service gives a stable virtual IP and DNS name to a changing set of pods. ClusterIP is the default and is reachable only inside the cluster. NodePort also opens a port, from 30000 to 32767 by default, on every node. LoadBalancer asks the cloud for an external load balancer that sends traffic to the nodes or straight to pods. kube-proxy, or an eBPF data plane like Cilium, programs the translation from the virtual IP to the pod IPs listed in the EndpointSlices.
Go deeper
Types
Type Reachable from Notes ClusterIP Inside the cluster Virtual IP from the service CIDR NodePort Any node IP on a high port Builds on ClusterIP LoadBalancer Outside, through a cloud LB Builds on NodePort unless the controller targets pods directly ExternalName Inside, as a DNS CNAME No proxying, just DNS Headless ( clusterIP: None)Inside DNS returns pod IPs; used by StatefulSets Data path
- Pods matching the selector and passing readiness probes are listed in EndpointSlices.
- kube-proxy watches them and writes rules: iptables DNAT chains, IPVS virtual servers, or nftables in newer releases. Cilium can replace kube-proxy with eBPF.
- A packet to
10.96.40.12:80is translated to a chosen pod, for example10.244.3.17:8080. - CoreDNS answers
web.shop.svc.cluster.localwith the ClusterIP.
YAML apiVersion: v1 kind: Service metadata: name: web namespace: shop spec: type: ClusterIP selector: app: web ports: - port: 80 targetPort: 8080They will ask next
Why can you not ping a ClusterIP?
In iptables mode the ClusterIP is not on any interface. Only the defined ports are translated, so ICMP gets no answer. Test with
curlto the port instead. In IPVS mode the address is bound to a dummy interface and may answer ping.A Service has no endpoints. What is wrong?
The selector does not match the pod labels, or the pods are not ready. This shows what the Service actually selected:
kubectl get endpointslices -n shop -l kubernetes.io/service-name=web
Traps
- Saying a Service is a pod or a process. It is a virtual IP plus rules.
- Exposing many services with one cloud load balancer each, which gets expensive. That is what ingress is for.
How did you do?Own pageHow do you design a cloud network to survive the loss of an availability zone?
Say this first
Use at least two, preferably three AZs. Give every tier a subnet in each AZ, spread instances across them with auto scaling, put load balancers in all of them, and run one NAT gateway per AZ with each private subnet routed to its local one. Use zone-redundant managed services, and avoid anything that pins a tier to one AZ, such as a single NAT gateway or a single-AZ database.
Go deeper
What an AZ is
One or more data centers in a region with separate power, cooling and networking, joined to the other AZs by low-latency links. AZ failures are rare but real; region failures are rarer.
Checklist
- Subnets: public, private and data subnets in each AZ.
- Compute: auto scaling groups across AZs, with enough headroom that two AZs carry the load of three.
- Load balancers: enabled in every AZ that has targets.
- NAT: one NAT gateway per AZ. A single NAT gateway makes every AZ depend on one.
- Data: Multi-AZ databases, replicated caches.
- Hybrid: VPN tunnels and transit gateway attachments already span AZs; make sure the subnets chosen for attachments cover every AZ you use.
AZ names are per account
us-east-1ain one account is not necessarilyus-east-1ain another. AWS publishes AZ IDs such asuse1-az1that are the same everywhere; use them when lining up shared subnets or partner connections.Azure and GCP
Azure regions with zones expose zones 1, 2 and 3; resources are zonal or zone-redundant. GCP zones such as
us-central1-aand regional managed instance groups play the same role.They will ask next
Why can three AZs be cheaper than two for the same resilience?
With two AZs each must be able to carry 100% of the load, so you run 200% capacity. With three, each carries 50% after one fails, so you run 150%.
What breaks if every private subnet uses the NAT gateway in AZ a?
When AZ a fails, every AZ loses outbound internet. You also pay inter-AZ charges for all that traffic.
Traps
- Building redundancy at the instance level but leaving a single NAT gateway or single-AZ database.
- Matching AZs between accounts by name instead of AZ ID.
How did you do?Own page
Working15
How do Azure network security groups and GCP firewall rules compare with AWS security groups?
Say this first
All three are stateful. Azure NSGs allow and deny, use priorities 100 to 4096 (lower wins), and attach to a subnet, a NIC or both, so traffic must pass both. GCP firewall rules belong to the whole VPC, use priorities 0 to 65535, allow or deny, and target instances by network tag or service account, with an implied deny for ingress and allow for egress. AWS security groups are allow-only and per interface.
Go deeper
Azure NSG
- Custom rules use priority 100 to 4096. Default rules sit at 65000 and up: allow VNet to VNet, allow Azure Load Balancer probes inbound, allow internet outbound, then deny all.
- Service tags such as
VirtualNetwork,Internet,AzureLoadBalancerandStoragestand in for address lists Microsoft maintains. - Application security groups (ASGs) group NICs by role, so a rule says "web ASG to app ASG on 8080", close to AWS security group referencing.
- With NSGs on both subnet and NIC: inbound is checked at the subnet first, then the NIC; outbound at the NIC first, then the subnet. Both must allow.
- Watch out:
VirtualNetworkincludes peered VNets and on-prem ranges learned through a gateway, so the default allow is wider than people think.
GCP VPC firewall rules
- Defined on the VPC, applied in every region. Direction is ingress or egress.
- Priority 0 to 65535, default 1000. Implied rules at the lowest priority deny all ingress and allow all egress.
- Targets: all instances, instances with a network tag, or instances running as a service account. Service accounts are stronger because changing them needs IAM permission, while tags are editable by anyone who can edit the VM.
- Hierarchical and network firewall policies add organization-wide rules above the VPC rules.
AWS
Allow-only, per ENI, all rules evaluated, other security groups as sources. Network ACLs are the place for explicit deny.
They will ask next
An Azure VM gets health probes from 168.63.129.16. Why must you allow it?
That address is Azure's platform address used for load balancer health probes, DNS and DHCP. The default NSG rule
AllowAzureLoadBalancerInBoundcovers the probes. If you write a deny-all rule at a higher priority, the load balancer marks the VM down.How do you troubleshoot which NSG rule is blocking traffic?
Network Watcher's IP flow verify tells you allow or deny and the rule name for a given 5-tuple. Effective security rules on the NIC show the merged subnet and NIC rules.
Traps
- Saying GCP firewall rules are per subnet. They are per VPC with targets.
- Forgetting that an Azure NSG on the subnet and another on the NIC must both allow.
How did you do?Own pageHow would you plan IP addressing for a company moving to the cloud?
Say this first
I treat cloud ranges as part of the corporate plan, not separate. I reserve a large block per cloud and region, give each VPC a non-overlapping range sized for growth, keep it unique against on-prem, partners and other VPCs, and track it all in an IPAM. I avoid ranges that collide with common defaults like 172.17.0.0/16 for Docker and 10.0.0.0/16 for every tutorial.
Go deeper
Principles
- Unique everywhere. Anything that may ever be peered, routed over a transit hub or reached from on-prem must not overlap. Overlap is cheap to avoid on day one and very expensive to fix later.
- Hierarchical. For example
10.64.0.0/10for AWS, split by region (10.64.0.0/13us-east-1,10.72.0.0/13eu-west-1), then a/16to/20per VPC. Summaries per region keep the on-prem and transit route tables short. - Size for growth. Kubernetes and serverless consume IPs quickly. A
/16VPC is not wasteful if the block is planned; a/24VPC that has to be rebuilt is. - Leave room in each VPC. Do not carve the whole VPC into subnets on day one. You can add subnets but you cannot resize existing ones.
- Use a tool. AWS VPC IPAM or NetBox as the source of truth, so teams request ranges instead of guessing.
Ranges to avoid
Range Why 172.17.0.0/16Docker's default bridge. Hosts running Docker cannot reach it. 10.0.0.0/16,192.168.0.0/24,192.168.1.0/24Defaults everywhere, including home routers of VPN users. 100.64.0.0/10Carrier-grade NAT space; often reused for Kubernetes pods. Plan it explicitly. 169.254.0.0/16Link-local; used by metadata services and VPN tunnel inside addresses. Kubernetes ranges count too
Pod and service CIDRs that are not VPC addresses still must not overlap anything pods need to reach. EKS, for example, picks
10.100.0.0/16or172.20.0.0/16for services if you do not set one.They will ask next
Can you grow a VPC later?
In AWS you can add secondary CIDR blocks, with some restrictions on which ranges combine. In Azure you can add address ranges to a VNet. Neither lets you resize an existing subnet.
Would you use IPv6 to avoid all this?
IPv6 removes the scarcity problem and helps with the public IPv4 charge, but most enterprises still need IPv4 for on-prem and partners, so you plan both. Dual stack is the usual step.
Traps
- Letting every team pick 10.0.0.0/16 because it is the console default.
- Forgetting partner networks and acquisitions when checking for overlap.
How did you do?Own pageWhere does data transfer cost money in AWS, and how do you design to keep egress costs down?
Say this first
Inbound from the internet is free. You pay for data out to the internet, between regions, between availability zones (in each direction), and for processing through NAT gateways, transit gateways and interface endpoints. I keep chatty traffic inside one AZ where the design allows, send S3 and DynamoDB traffic through free gateway endpoints instead of NAT, and cache or compress what leaves.
Go deeper
The meters that surprise people (us-east-1 list prices, they change, always check)
Path Charge Internet egress Roughly 0.09 USD per GB for the first tier, cheaper at volume Between AZs in a region 0.01 USD per GB out of one AZ and 0.01 USD per GB into the other NAT gateway 0.045 USD per hour plus 0.045 USD per GB processed Transit gateway Per attachment per hour plus about 0.02 USD per GB processed Between regions Charged per GB, varies by region pair Design habits
- Gateway endpoints for S3 and DynamoDB. They are route table entries, free, and remove that traffic from the NAT gateway. A backup job pushing terabytes to S3 through NAT is a classic bill shock.
- NAT gateway per AZ. Besides resilience, it avoids paying inter-AZ charges on every outbound byte.
- AZ affinity. Keep app-to-cache and app-to-database traffic in the same AZ when the service supports it; replicate across AZs on purpose, not by accident.
- CDN in front of public content. CloudFront or another CDN offloads repeated downloads.
- Direct Connect for heavy hybrid traffic. Data transfer out over Direct Connect is billed at a lower rate than internet egress.
- Measure. VPC Flow Logs plus Cost Explorer by usage type (
DataTransfer-Regional-Bytes,NatGateway-Bytes) shows who is moving data.
Other clouds
Azure and GCP follow the same shape: free ingress, paid internet and inter-region egress. GCP also charges for traffic between zones in a region.
They will ask next
Is traffic over VPC peering free?
Inside one AZ it is free. Across AZs it carries the normal inter-AZ charge, and inter-region peering is charged as inter-region transfer. Peering has no hourly fee, unlike a transit gateway.
How would you find which workload drives the NAT gateway bill?
Enable flow logs on the NAT gateway's ENI and aggregate bytes by source address, or use CloudWatch
BytesOutToDestinationon the NAT gateway with flow logs to split it per instance.
Traps
- Saying all traffic inside a region is free. Cross-AZ traffic is not.
- Quoting exact prices as permanent facts. Give the shape and say you would check the current price list.
How did you do?Own pageHow does DNS work inside a VPC, and how do you make on-prem and cloud resolve each other's names?
Say this first
Every VPC has the Amazon-provided resolver at the VPC base address plus two (10.10.0.2 for 10.10.0.0/16) and at 169.254.169.253. It answers public names, private hosted zones and instance names. For hybrid DNS I use Route 53 Resolver endpoints: an inbound endpoint that on-prem DNS servers forward cloud zones to, and an outbound endpoint with forwarding rules that send on-prem zones to the corporate DNS.
Go deeper
VPC settings
enableDnsSupportturns the Amazon resolver on (default true).enableDnsHostnamesgives instances DNS hostnames (default false in custom VPCs). Private hosted zones need both set to true.- Private hosted zones are associated with specific VPCs, so the same name can resolve differently inside and outside (split-horizon).
Hybrid with Route 53 Resolver
Output on-prem DNS --- conditional forward aws.corp.example --> inbound endpoint IPs (ENIs in the VPC) VPC resolver --- rule: forward corp.example --------> outbound endpoint --> on-prem DNS 192.168.10.53Each endpoint has ENIs in at least two AZs. Forwarding rules can be shared to other accounts with AWS RAM and associated with many VPCs.
Azure and GCP
- Azure: the platform resolver is
168.63.129.16. Private DNS zones link to VNets. Azure DNS Private Resolver gives inbound and outbound endpoints plus forwarding rulesets, the same pattern as Route 53 Resolver. Before it existed, people ran DNS forwarder VMs. - GCP: Cloud DNS private zones, forwarding zones to on-prem, and an inbound server policy that gives on-prem a forwarding target inside the VPC.
They will ask next
Why might DNS queries fail under load even though the resolver is up?
The Amazon resolver limits each network interface to 1024 packets per second. A busy host without a local cache can hit that. A local caching resolver on the host fixes it.
Why not point instances directly at on-prem DNS servers?
Then they lose private hosted zones, endpoint private DNS and instance names unless on-prem forwards back. Every lookup also crosses the VPN or circuit. Forwarding rules keep each zone answered where it lives.
Traps
- Forgetting
enableDnsHostnamesand wondering why the private hosted zone does not resolve. - Running only one resolver endpoint ENI, which makes DNS the single point of failure for hybrid traffic.
How did you do?Book 9.3 Infrastructure ApplicationsOwn pageWhat is a transit gateway and how does it replace a peering mesh?
Say this first
An AWS transit gateway is a regional router you attach VPCs, VPNs, Direct Connect gateways and other transit gateways to. Each attachment is associated with one TGW route table, used for its lookups, and can propagate its routes into one or more route tables. That gives hub-and-spoke routing with segmentation, instead of a full mesh of peerings. Azure does the same with Virtual WAN or a hub VNet with a firewall, and GCP with Network Connectivity Center.
Go deeper
Building blocks
- Attachments: VPC (one subnet per AZ, best as a small dedicated
/28), site-to-site VPN, Direct Connect gateway (through a transit VIF), TGW peering (between regions, static routes only), and Connect (GRE plus BGP for SD-WAN appliances). - Route tables: a TGW can have many. Association says which table an attachment uses when its traffic enters the TGW (exactly one). Propagation says which tables learn that attachment's routes (zero or more).
- Static routes can be added, including blackhole routes that drop traffic.
- VPC side: the VPC's own route tables still need routes such as
10.0.0.0/8totgw-....
Packet walk
Output VPC A instance -> VPC A route table (10.0.0.0/8 to tgw) -> TGW attachment A -> lookup in the route table associated with A -> attachment B -> VPC B local route -> instanceThings to know
- It is a regional resource. Inter-region needs TGW peering with static routes.
- It charges per attachment hour and per GB processed, so it is not free like peering.
- With BGP VPNs it can ECMP across many tunnels, which is how you get past the per-tunnel bandwidth.
- Amazon side ASN defaults to 64512 unless you set it at creation.
Equivalents
- Azure Virtual WAN: a Microsoft-managed hub with transitive routing between VNets, VPN, ExpressRoute and point-to-site. The do-it-yourself version is a hub VNet with Azure Firewall or an NVA, spokes peered to it, and UDRs pointing at the firewall.
- GCP Network Connectivity Center: a hub with VPC spokes and hybrid spokes (VPN, Interconnect, router appliances).
They will ask next
Why put the TGW attachment in its own small subnet?
The attachment ENIs follow the subnet's network ACL and route table. A dedicated subnet lets you keep those simple and separate from workload subnets, which matters for inspection designs.
Does attaching a VPC automatically make it reachable?
Only if the attachment propagates into the right TGW route tables and the VPC route tables point the right prefixes at the TGW. Missing either half is the most common TGW bug.
Traps
- Confusing association (where I look up) with propagation (where my routes are learned).
- Forgetting the VPC route table entry pointing to the TGW.
How did you do?Own page- Attachments: VPC (one subnet per AZ, best as a small dedicated
You have Direct Connect plus two VPN tunnels to the same VPC. How does AWS pick a path, and how do you steer it?
Say this first
Longest prefix match comes first. For the same prefix on a virtual private gateway, AWS prefers Direct Connect BGP routes, then static VPN routes, then BGP VPN routes. Between BGP VPN paths it takes the shortest AS path, then the lowest MED. So I steer AWS's return traffic with prefix length and AS path prepending on the backup, and I steer my outbound traffic with local preference on my own routers.
Go deeper
AWS side (traffic from the VPC to on-prem)
- Most specific prefix wins. Advertising
10.20.0.0/16over DX and10.0.0.0/8over VPN keeps traffic on DX until the/16is withdrawn. - Same prefix: Direct Connect BGP, then VPN static, then VPN BGP.
- Between VPN BGP routes: shortest AS path, then lowest MED.
To make tunnel 2 the backup, advertise the same prefixes on it with a prepended AS path:
Cisco IOS route-map AWS-TUN2-OUT permit 10 set as-path prepend 65010 65010 ! router bgp 65010 address-family ipv4 neighbor 169.254.20.1 route-map AWS-TUN2-OUT outYour side (traffic from on-prem to AWS)
Your routers choose. Set a higher local preference on routes learned over DX, and keep the VPN routes at the default 100 so they are used only when DX disappears.
Transit gateway is different
A TGW can ECMP across VPN tunnels when the paths are equal and ECMP is enabled. That is a feature for bandwidth, and a trap when you wanted active-standby: then make the paths unequal on purpose.
They will ask next
Traffic leaves on-prem over DX but returns over the VPN. Why is that bad?
Asymmetric routing through stateful firewalls on-prem breaks sessions, and the VPN may not have the bandwidth. Make the AWS side prefer DX, usually by advertising the same prefixes on both and letting DX win, or more specific prefixes on DX.
Why can a static VPN route beat your BGP VPN route?
Static VPN routes rank above BGP VPN routes for the same prefix. A forgotten static route on the VPN connection can pin traffic to one tunnel and ignore BGP failover logic.
Traps
- Using local preference to influence AWS. It never leaves your AS; AWS cannot see it.
- Advertising a more specific prefix over the VPN by accident and pulling all traffic off DX.
How did you do?Own page- Most specific prefix wins. Advertising
Explain AWS Direct Connect. What are the connection types and virtual interfaces?
Say this first
Direct Connect is a private Ethernet connection from your router to AWS at a Direct Connect location. A dedicated connection is a physical port, typically 1, 10 or 100 Gbps; a hosted connection is a slice sold by a partner. Over it you run 802.1Q virtual interfaces, each with its own BGP session: a private VIF to reach VPCs, a public VIF to reach AWS public endpoints, and a transit VIF to reach transit gateways through a Direct Connect gateway.
Go deeper
Connection types
- Dedicated: a cross-connect to an AWS router port in a colocation facility. You order it, get a Letter of Authorization (LOA-CFA), and have the cross-connect run.
- Hosted: a partner already connected to AWS provisions a VLAN for you at a fixed bandwidth, from as little as 50 Mbps.
Virtual interfaces
VIF Reaches Attaches to Private VPC private addresses A VGW, or a Direct Connect gateway Transit Many VPCs via transit gateways A Direct Connect gateway associated with TGWs Public AWS public service addresses (S3, DynamoDB, public endpoints) AWS public prefixes, needs public IPs A Direct Connect gateway is a global object: one private or transit VIF can reach VGWs or TGWs in many regions. It does not route VPC to VPC through itself.
Rules that cause outages
- BGP is mandatory on every VIF.
- A private VIF accepts at most 100 prefixes from you. Advertise more and the BGP session goes down. Summarize.
- Direct Connect is not encrypted. MACsec is available on some dedicated connections; otherwise run IPsec over it.
Redundancy
One connection is a single point of failure. AWS's guidance for critical workloads is connections at two separate Direct Connect locations, each on separate devices, with BFD for fast failover and a VPN as an optional last resort.
They will ask next
How do you make on-prem prefer one of two Direct Connect connections?
For AWS-to-on-prem traffic, use AS path prepending or more specific prefixes on the preferred link; AWS also honours a set of local preference BGP communities on private and transit VIFs. For on-prem-to-AWS traffic, set local preference on your routers.
What is a LAG on Direct Connect?
Several dedicated connections of the same speed at the same location bundled with LACP into one logical connection. It adds bandwidth and link redundancy, not location redundancy.
Traps
- Advertising a full internal routing table over a private VIF and dropping the session.
- Calling Direct Connect secure because it is private.
How did you do?Own pageHow does Azure ExpressRoute work, and what is the GCP equivalent?
Say this first
An ExpressRoute circuit is a private connection, through a provider or ExpressRoute Direct, into Microsoft's edge. Every circuit has a primary and a secondary link to two Microsoft edge routers, both active, each with its own BGP session. Private peering reaches VNets through an ExpressRoute gateway in the VNet's GatewaySubnet; Microsoft peering reaches Microsoft 365 and Azure public services. Microsoft's ASN is 12076. GCP offers Dedicated and Partner Interconnect with BGP on Cloud Router.
Go deeper
Circuit anatomy
- Ordered at a peering location with a bandwidth (provider circuits from 50 Mbps up to 10 Gbps; ExpressRoute Direct gives you 10 or 100 Gbps ports).
- Two links, two BGP sessions per peering. For private peering you supply two
/30subnets (one per link), a VLAN ID and your ASN. - Private peering: to VNets. Needs an ExpressRoute virtual network gateway in
GatewaySubnet. FastPath can send data around the gateway for high-throughput cases. - Microsoft peering: to public Microsoft services, with public IPs and route filters.
- Global Reach: connects two of your circuits so two on-prem sites talk over Microsoft's backbone.
- Premium add-on: reach VNets in other geopolitical regions and a larger route limit.
Not encrypted
Same as Direct Connect. MACsec is available on ExpressRoute Direct; otherwise IPsec over private peering.
GCP Cloud Interconnect
- Dedicated Interconnect: your own 10 or 100 Gbps circuits into a Google colocation.
- Partner Interconnect: through a provider, smaller sizes.
- VLAN attachments connect to a Cloud Router, which runs BGP and installs routes in the VPC. Google publishes the topologies (two metros, four connections) needed for the 99.99% SLA.
Mapping across clouds
AWS Azure GCP Direct Connect connection ExpressRoute circuit Interconnect connection Private VIF Private peering VLAN attachment Public VIF Microsoft peering Private Google Access for on-prem hosts BGP on your router to AWS BGP to the Microsoft edge routers BGP to Cloud Router They will ask next
Is a single ExpressRoute circuit redundant?
The two links protect against one edge router or link failing, but both sit in one peering location. A facility or provider outage takes both down. Critical sites use two circuits in two locations.
Where does the ExpressRoute gateway live, and why does it matter?
In
GatewaySubnetof the hub VNet. Its SKU caps throughput and connections, so a busy hub can be limited by the gateway rather than the circuit.
Traps
- Thinking the secondary link is standby. Both are active by default.
- Forgetting the ExpressRoute gateway SKU when planning bandwidth.
How did you do?Own pageWhat is the difference between a gateway endpoint, an interface endpoint and PrivateLink?
Say this first
A gateway endpoint is a route table entry that sends S3 or DynamoDB traffic over the AWS network; it is free and only works from inside that VPC. An interface endpoint is an ENI with a private IP in your subnet that fronts a service; it is built on PrivateLink, costs per hour and per GB, and can be reached from on-prem and peered networks. PrivateLink also lets you publish your own service behind an NLB to other VPCs, one way only, even with overlapping CIDRs.
Go deeper
Gateway endpoint (S3, DynamoDB only)
- Adds a prefix list route (
pl-...) to the route tables you choose. - No hourly charge, no data processing charge.
- Cannot be used from on-prem, a peered VPC or through a transit gateway.
Interface endpoint (most AWS services)
- One ENI per chosen AZ, with a security group.
- Private DNS option makes the normal service name (for example
sqs.us-east-1.amazonaws.com) resolve to the endpoint IPs inside the VPC. - Reachable over VPN, Direct Connect, peering and transit gateway.
Your own service with PrivateLink
Output consumer VPC (10.0.0.0/16) provider VPC (10.0.0.0/16, same range) app -> interface endpoint 10.0.5.20 -> PrivateLink -> NLB -> service targetsThe provider creates an endpoint service from an NLB and allows principals. The consumer creates an interface endpoint. Only the consumer can start connections. The provider sees the NLB's address as the source unless it enables proxy protocol v2.
Azure and GCP
- Azure Private Endpoint: a NIC with a private IP mapped to one specific resource (one storage account, one SQL server). Service endpoints are older: the service still has a public IP, but the subnet's identity is used to allow access, and on-prem cannot use them. Private Link service publishes your own service behind a Standard Load Balancer.
- GCP Private Service Connect: an internal IP endpoint for Google APIs or for services published by producers with a service attachment. Private Google Access lets VMs without external IPs reach Google APIs.
They will ask next
Why does a backup job to S3 cost a fortune through NAT, and what is the fix?
The NAT gateway charges per GB processed. A free S3 gateway endpoint in the route table sends that traffic around the NAT gateway.
Can an endpoint policy stop data exfiltration?
It helps. An endpoint policy can allow only your own buckets through the endpoint, so a compromised host cannot copy data to an outside bucket over that path. Pair it with bucket policies that require the endpoint.
Traps
- Expecting on-prem to use an S3 gateway endpoint. It needs an interface endpoint.
- Forgetting the security group on an interface endpoint, which must allow 443 from clients.
How did you do?Own page- Adds a prefix list route (
In an Azure hub-and-spoke, what do allow forwarded traffic, gateway transit and use remote gateways do?
Say this first
Allow forwarded traffic lets a VNet accept packets that did not originate in the peer, such as traffic routed through a firewall in the hub. Allow gateway transit on the hub side and use remote gateways on the spoke side let spokes use the hub's VPN or ExpressRoute gateway. Spoke-to-spoke traffic still needs UDRs pointing at a firewall or NVA in the hub, because peering is not transitive.
Go deeper
Peering settings, set on each side
Setting Where Effect Allow virtual network access Both Basic reachability between the two VNets Allow forwarded traffic Both, as needed Accept traffic forwarded by an NVA in the peer Allow gateway transit Hub to spoke peering Offer the hub's gateway to the spoke Use remote gateways Spoke to hub peering Use the hub's gateway; the spoke cannot have its own Spoke-to-spoke routing
Spoke 1 and spoke 2 are peered only with the hub. To connect them:
- Route table on spoke 1 subnets:
10.2.0.0/16next hopVirtualApplianceat the firewall IP (for example10.0.1.4). - Route table on spoke 2 subnets:
10.1.0.0/16to the same firewall. - Firewall policy allows the flow. Forwarded traffic allowed on the peerings.
Gateway route propagation
A route table has a "propagate gateway routes" setting. Turning it off on spoke subnets stops on-prem routes learned by the gateway from bypassing the firewall; a UDR then sends on-prem traffic to the firewall instead.
They will ask next
Why can a spoke with use remote gateways not have its own VPN gateway?
Azure allows one gateway path per VNet in that setup. The spoke delegates its hybrid routing to the hub, which keeps on-prem routing in one place.
What replaces all these UDRs at scale?
Azure Virtual WAN with routing intent, or Azure Virtual Network Manager to generate the hub-and-spoke peerings and route tables for you.
Traps
- Expecting spoke-to-spoke traffic to flow through the hub just because both are peered to it.
- Forgetting the return UDR on the second spoke, which causes asymmetric routing around the firewall.
How did you do?Own page- Route table on spoke 1 subnets:
How do target health checks and cross-zone load balancing work on AWS load balancers?
Say this first
Each target group has its own health check. For an ALB the defaults are HTTP on the traffic port, path
/, every 30 seconds, 5 second timeout, healthy after 5 passes and unhealthy after 2 failures. Removed targets drain for the deregistration delay, 300 seconds by default. Cross-zone load balancing spreads traffic over targets in all AZs: it is always on at the ALB level and off by default on an NLB.Go deeper
Health checks
- Probes come from the load balancer nodes' private IPs. The target security group must allow them, ideally by referencing the load balancer's security group.
- Point the check at a real health endpoint (
/healthz) that tests dependencies the instance needs, not just "the web server answers". - Success codes default to
200for an ALB; you can widen it, for example200-399. - Fail open: if every target in a target group is unhealthy, the load balancer sends traffic to all of them anyway. A bad health check path does not cause an outage, but it hides the real health.
Deregistration delay
During scale-in or deploys, a target stops getting new connections but keeps existing ones for up to 300 seconds. Short-lived HTTP services often lower it to 30 seconds to speed up deploys.
Cross-zone
ALB NLB GWLB Default On (can be turned off per target group) Off Off Cost when on No inter-AZ charge Inter-AZ data charges apply Inter-AZ data charges apply With cross-zone off, each AZ's load balancer node only uses targets in its own AZ. If AZ a has 2 targets and AZ b has 8, each AZ still gets half the traffic, so the 2 targets in AZ a run four times hotter.
They will ask next
All targets show unhealthy but the site still works. How?
Fail-open behaviour. The load balancer routes to all targets when none are healthy. Usually the health check path or port is wrong, or the security group blocks the probes.
What is slow start mode?
An ALB option that ramps a newly healthy target up to its full share over a set period, so a cold cache or JIT does not get the full load at once.
Traps
- Forgetting to allow the health check from the load balancer's security group.
- Uneven target counts per AZ with cross-zone off.
How did you do?Own pageHow does a backend learn the real client IP behind cloud load balancers?
Say this first
It depends on whether the load balancer proxies or passes packets through. An ALB, Application Gateway or GCP proxy load balancer adds the client IP to X-Forwarded-For. An NLB preserves the source IP for instance targets by default, but not for IP targets with TCP or TLS, where you enable client IP preservation or proxy protocol v2. Azure Load Balancer and GCP passthrough load balancers do not rewrite the source at all.
Go deeper
By load balancer
Load balancer How the client IP arrives AWS ALB X-Forwarded-For, plusX-Forwarded-ProtoandX-Forwarded-PortAWS NLB, instance targets Source IP preserved by default AWS NLB, IP targets, TCP or TLS Not preserved by default; turn on preservation or proxy protocol v2 AWS NLB, UDP Preserved Azure Load Balancer Passthrough, source preserved Azure Application Gateway X-Forwarded-ForGCP passthrough Network LB Source preserved GCP Application LB and proxy Network LB X-Forwarded-For, or PROXY protocol for TCP proxySide effects of preserving the client IP
- The target's security group must allow the real client addresses, not just the load balancer.
- Replies must go back through the load balancer path. With a passthrough design, a server whose default route points elsewhere breaks the flow.
- Hairpin: with NLB client IP preservation, a target that connects to its own NLB and is balanced to itself sees a packet from its own IP to its own IP, and the connection fails.
Kubernetes
A
LoadBalancerService withexternalTrafficPolicy: Clusterlets kube-proxy send traffic to a pod on another node, and it SNATs the packet, so the pod sees a node IP.externalTrafficPolicy: Localkeeps traffic on nodes that run a pod and preserves the client IP, at the cost of possibly uneven spread.They will ask next
Can you trust X-Forwarded-For?
Only the entries added by your own proxies. A client can send its own header, so the application should take the address added by the last trusted hop, not the first value in the list.
What does proxy protocol v2 add on an NLB?
A binary header at the start of the TCP stream with the original source and destination. Through PrivateLink it also carries the VPC endpoint ID. The backend must be configured to expect it, or it will treat the header as garbage.
Traps
- Turning on proxy protocol on the NLB without enabling it on the backend, which then fails every request.
- Assuming an NLB always preserves the client IP whatever the target type.
How did you do?Own pageWhat is an Ingress, and how is it different from a LoadBalancer Service and the Gateway API?
Say this first
An Ingress is a set of HTTP and HTTPS rules (host and path to Service) that an ingress controller turns into real proxy configuration. One load balancer and controller can serve many Services, with TLS termination in one place. A LoadBalancer Service is one external load balancer per Service at layer 4. The Gateway API is the newer, role-oriented replacement for Ingress, with Gateways and routes for HTTP, gRPC, TCP and more. The Ingress API itself is frozen.
Go deeper
Ingress needs a controller
The Ingress object does nothing on its own. The controller watches it and configures a proxy:
- Self-hosted proxies (NGINX-based, Traefik, HAProxy, Envoy-based) running as pods behind one LoadBalancer Service.
- Cloud-managed: the AWS Load Balancer Controller builds an ALB from an Ingress; GKE builds a Google Application Load Balancer.
YAML apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: shop namespace: shop spec: ingressClassName: alb tls: - hosts: [shop.example.com] secretName: shop-tls rules: - host: shop.example.com http: paths: - path: /api pathType: Prefix backend: service: name: api port: number: 80With the AWS controller, TLS is normally done with an ACM certificate annotation rather than a secret.
Gateway API
Split by role: the platform team owns
GatewayClassandGateway(listeners, certificates), app teams ownHTTPRouteobjects that attach to it. It supports header matching, traffic splitting and more protocols without controller-specific annotations.They will ask next
Where does TLS terminate with an ALB ingress, and does the pod see HTTPS?
At the ALB, using an ACM certificate. The ALB talks HTTP to the pods unless you configure HTTPS to the backend. The original scheme is passed in
X-Forwarded-Proto.Why not just use a LoadBalancer Service for every app?
Each one creates and bills a separate cloud load balancer and public address, and you lose central TLS, routing and WAF. Ingress or Gateway consolidates them.
Traps
- Creating an Ingress with no controller installed and wondering why nothing happens.
- Mixing annotations from one controller into another controller's ingress class.
How did you do?Own pageHow do Kubernetes NetworkPolicies work, and what usually goes wrong with them?
Say this first
By default every pod can talk to every pod. Once any NetworkPolicy selects a pod for ingress or egress, that direction becomes deny by default for the pod and only what some policy allows gets through. Policies are additive allow lists with no deny rule. They only work if the CNI enforces them, and the classic mistakes are forgetting DNS on egress and mixing up the AND versus OR form of selectors.
Go deeper
Default deny plus an allow
YAML apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: default-deny-ingress namespace: shop spec: podSelector: {} policyTypes: [Ingress] --- apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: api-from-web namespace: shop spec: podSelector: matchLabels: app: api policyTypes: [Ingress] ingress: - from: - podSelector: matchLabels: app: web ports: - protocol: TCP port: 8080The AND vs OR trap
YAML # One element: namespace AND pod must match - from: - namespaceSelector: {matchLabels: {team: web}} podSelector: {matchLabels: {app: web}} # Two elements: namespace OR pod matches - from: - namespaceSelector: {matchLabels: {team: web}} - podSelector: {matchLabels: {app: web}}One dash changes the meaning and can open a namespace wide.
Enforcement
Calico, Cilium, the AWS VPC CNI with its network policy agent, and Azure's options enforce policies. Flannel alone does not, and the API server accepts the objects anyway, so nothing warns you.
They will ask next
You apply default-deny egress and everything breaks, even allowed calls. Why?
DNS. Pods can no longer reach CoreDNS on UDP and TCP 53 in
kube-system, so names never resolve. Add an egress rule allowing port 53 to the DNS pods.How do you write a deny rule?
Standard NetworkPolicy has none. You get deny by selecting the pod and not allowing the traffic. Calico and Cilium policies add explicit deny and cluster-wide scope.
Traps
- Assuming policies work on any cluster. The CNI must enforce them.
- Forgetting that a policy with only ingress rules leaves egress wide open for the same pods.
How did you do?Own pageTwo instances in AWS cannot talk. How do you troubleshoot it, and what do flow logs not show you?
Say this first
I follow the path both ways: route tables at the source and at the destination, then security groups, then network ACLs in both directions, then the OS firewall and whether the app listens. Reachability Analyzer checks the configuration hop by hop without sending packets. VPC Flow Logs show ACCEPT or REJECT decisions by security groups and NACLs, but they do not log packets dropped for lack of a route, and they skip some traffic such as Amazon DNS and instance metadata.
Go deeper
Order of checks
- Routing, both directions. The return route is the one people forget.
- Security groups. Inbound on the destination, outbound on the source.
- Network ACLs. Both subnets, both directions, including ephemeral return ports.
- Host.
ss -ltnpto see the listener,iptablesor Windows Firewall, the app's bind address.
Flow logs
Output 2 123456789012 eni-0a1b2c3d4e5f60718 10.10.10.25 10.20.10.40 49152 5432 6 10 840 1731230000 1731230060 REJECT OKVersion, account, ENI, source, destination, ports, protocol (6 is TCP), packets, bytes, window start and end, action, log status. A REJECT points at a security group or NACL.
Not captured: traffic to the Amazon DNS resolver, the instance metadata service, the Amazon Time Sync service, DHCP, and Windows license activation. Records are aggregated over an interval (10 minutes by default, 1 minute as an option), so they are not real time.
Tools by cloud
AWS Azure GCP Reachability Analyzer Network Watcher IP flow verify, next hop, connection troubleshoot Connectivity Tests VPC Flow Logs VNet flow logs VPC Flow Logs, firewall rules logging Traffic Mirroring Packet capture Packet Mirroring They will ask next
Flow logs show ACCEPT inbound on the server but the client times out. What next?
The request arrived, so look at the reply. Check the server's route back to the client, the outbound NACL on the server's subnet for the ephemeral port, and whether the app actually answered.
What does Reachability Analyzer not cover?
It analyses configuration, not live behaviour. It will not see an OS firewall, an app that is down, or a third-party appliance dropping traffic.
Traps
- Treating the absence of a REJECT as proof the network is fine. Routing drops never show.
- Checking only the source side. Most cloud connectivity bugs are on the return path.
How did you do?Own page
Expert6
Two VPCs, or a VPC and an on-prem site, use the same CIDR and now must talk. What are your options?
Say this first
The clean fix is to re-address one side. If that is not possible, I would expose only the services needed through PrivateLink, which does not care about overlap, or translate addresses: a private NAT gateway in a small routable secondary range, NAT on a VPN gateway or appliance, or load balancers in routable subnets for inbound flows. Plain peering is out, because AWS refuses peering between overlapping VPCs.
Go deeper
Option 1: re-IP
Painful, but it removes the problem forever. Often the right answer for a small VPC or a new acquisition.
Option 2: PrivateLink (service-level connectivity)
The provider puts the service behind an NLB and publishes an endpoint service. The consumer creates an interface endpoint, which takes an IP from the consumer's own subnet. Neither side ever routes to the other's range, so overlap does not matter. Limits: one direction only (consumer starts connections), and it exposes services, not whole networks.
Option 3: NAT with a private NAT gateway (AWS pattern)
- Add a small, unique secondary CIDR to each VPC (the routable range), for example
100.64.10.0/24. - Keep workloads in the overlapping, non-routable range.
- Put a private NAT gateway in a routable subnet. Outbound traffic to the other network is SNATed to it and sent via the transit gateway.
- For inbound, place an internal ALB or NLB in the routable subnets with targets in the overlapping range.
Option 4: NAT on the edge
For on-prem overlap, translate on the VPN or firewall: Azure VPN Gateway supports NAT rules, and a firewall or router appliance in a transit VPC can do static or dynamic NAT. Every translated service needs DNS that returns the translated address.
What I tell the interviewer
Overlap is a planning failure; NAT is a workaround that adds state, breaks protocols that embed addresses, and complicates troubleshooting. I would choose PrivateLink for a few services and re-IP for broad connectivity.
They will ask next
Can a transit gateway route between two attached VPCs with the same CIDR?
Not usefully. It cannot hold two routes for the same prefix pointing at different attachments in one route table, so you still need NAT or separate route tables with translation.
Which applications break with NAT in the path?
Anything that carries IP addresses inside the payload or needs inbound connections to a specific host: FTP active mode, SIP without an ALG, some licensing and Kerberos setups, and peer-to-peer protocols.
Traps
- Suggesting VPC peering. AWS will not create a peering connection between overlapping CIDRs.
- Forgetting DNS. After NAT, clients must resolve names to the translated addresses.
How did you do?Own page- Add a small, unique secondary CIDR to each VPC (the routable range), for example
How would you segment prod, dev and shared services on a transit gateway, and where does inspection fit?
Say this first
I use separate TGW route tables. Prod attachments associate with a prod table that learns prod, shared services and on-prem routes. Dev associates with a dev table that learns dev and shared services only. Shared services learns everything. For inspection, spoke tables send traffic to an inspection VPC attachment, and I turn on appliance mode on that attachment so both directions of a flow hit the same firewall in the same AZ.
Go deeper
Route tables
TGW route table Associated attachments Propagations from rt-prod prod VPCs prod VPCs, shared VPC, VPN or DX rt-dev dev VPCs dev VPCs, shared VPC rt-shared shared services VPC prod, dev, VPN or DX Prod and dev never learn each other's routes, so there is no path. That is routing-based isolation; security groups still apply inside.
Blackhole routes
If a spoke table has
0.0.0.0/0to a central egress VPC, I add a blackhole route for the internal supernet (for example10.0.0.0/8). Traffic to an internal range nobody has propagated is dropped at the TGW instead of wandering toward the NAT gateways. Longer propagated routes still win by longest prefix match.Inspection VPC
- Spoke tables have
0.0.0.0/0(or the internal supernet) to the inspection VPC attachment. - The inspection VPC sends traffic through AWS Network Firewall endpoints or a Gateway Load Balancer with third-party firewalls, then back to the TGW.
- The inspection attachment is associated with a table that knows all spoke routes.
Why appliance mode
By default a TGW keeps traffic in the AZ where it entered. If the source is in AZ a and the destination in AZ b, the request enters the inspection VPC in AZ a and the reply in AZ b. Two different firewalls see the two halves; the stateful one that sees the reply has no session and drops it. With appliance mode enabled on the inspection VPC attachment, the TGW picks one AZ for the flow and uses it for both directions.
They will ask next
Which wins on a TGW, a static route or a propagated route for the same prefix?
The static route. Longest prefix match still comes first.
How do you let dev reach one prod service without opening prod?
Do not propagate prod into rt-dev. Publish the service through PrivateLink, or add only that service's /32 or small prefix as a static route and enforce it with the firewall and security groups.
Traps
- Forgetting appliance mode and seeing random drops only for cross-AZ flows.
- Treating TGW route tables as firewalls. They decide reachability, not ports.
How did you do?Own page- Spoke tables have
A private endpoint works from inside the VNet but on-prem users still hit the public IP. Why, and how do you fix it?
Say this first
Private endpoints depend on DNS. The public name has a CNAME to a privatelink name, and only networks that use the private DNS zone get the private A record. On-prem DNS asks the internet and gets the public IP. The fix is a conditional forwarder on-prem for the service's zone to a resolver inside the cloud (Azure DNS Private Resolver inbound endpoint or Route 53 Resolver inbound endpoint), so the query is answered with the private zone.
Go deeper
Azure example
Output mystore.blob.core.windows.net CNAME mystore.privatelink.blob.core.windows.net inside a VNet linked to privatelink.blob.core.windows.net -> A 10.50.2.4 anywhere else (public DNS) -> public IP- Create the private DNS zone
privatelink.blob.core.windows.net, link it to the hub VNet, and let the private endpoint register its record there. - Deploy Azure DNS Private Resolver with an inbound endpoint in the hub (or a DNS forwarder VM that uses
168.63.129.16). - On-prem DNS: conditional forwarder for
blob.core.windows.netto the inbound endpoint IP. Microsoft recommends forwarding the public zone name, not the privatelink name, so the CNAME chain is followed inside Azure.
168.63.129.16itself is only reachable from inside Azure, which is why on-prem cannot forward to it directly.AWS equivalent
An interface endpoint with private DNS creates a hidden private hosted zone for the service name in that VPC. On-prem forwards the service domain to a Route 53 Resolver inbound endpoint. For endpoints shared from a central VPC, turn private DNS off on the endpoint, create your own private hosted zone for the service name with an alias to the endpoint, and associate that zone with every spoke VPC.
Design rule
One private DNS zone per privatelink name for the whole organisation, linked to the VNets or VPCs that need it. Duplicate zones in different hubs give different answers depending on where you ask.
They will ask next
The storage account has public network access disabled. What does the on-prem user see before the fix?
The name resolves to the public IP, the connection reaches the public endpoint, and the service rejects it, usually with a 403 authorization error. It looks like a permissions problem but it is DNS.
How do you prove it is DNS?
nslookup mystore.blob.core.windows.netfrom on-prem and from a VM in the VNet. Different answers (public vs10.50.2.4) tell you resolution is the issue.
Traps
- Forwarding only the privatelink zone and breaking the CNAME chain for some clients.
- Opening the firewall to the public endpoint "to make it work", which defeats the private endpoint.
How did you do?Book 9.3 Infrastructure ApplicationsOwn page- Create the private DNS zone
How would you design networking for an organisation with dozens of AWS accounts?
Say this first
A dedicated network account owns the transit gateway, the Direct Connect gateway, central egress and inspection, and shared DNS and endpoints. Workload accounts get VPCs from an IPAM pool and attach to the TGW, which is shared through AWS RAM. Segmentation lives in TGW route tables, inspection in a central firewall VPC with appliance mode, and internet egress goes through NAT gateways in one egress VPC per region. GCP does the same with Shared VPC, Azure with a hub VNet or Virtual WAN.
Go deeper
The pieces
- Network account: TGW per region (shared via RAM), TGW peering between regions, Direct Connect gateway with transit VIFs, VPN backup.
- IPAM: pools per region and environment so every VPC gets a unique, summarizable range.
- Inspection VPC: AWS Network Firewall or GWLB with third-party firewalls, for east-west and egress.
- Egress VPC: NAT gateways per AZ. Spokes have no IGW or NAT of their own.
- Shared services VPC: interface endpoints shared through private hosted zones, Route 53 Resolver endpoints and rules shared with RAM, directory services.
- Guard rails: service control policies that stop spoke accounts from creating IGWs or peering on their own.
Alternative: VPC sharing
AWS RAM can share subnets of one VPC with many accounts. Accounts launch resources in shared subnets, the network team owns routing. Fewer VPCs and attachments, but a bigger blast radius per VPC.
Trade-offs to state out loud
- Central egress saves NAT gateway hours across many VPCs but adds TGW processing charges per GB.
- Central inspection adds a hop and cost; inspect what policy requires, not everything by default.
- One TGW per region is a shared dependency; change control on its route tables matters.
Other clouds
- GCP Shared VPC: a host project owns the VPC and subnets; service projects use them. Combine with NCC or VPN and Interconnect in the host project.
- Azure: a hub VNet per region with Azure Firewall, gateways and DNS resolver, spokes per subscription, policy to enforce UDRs. Virtual WAN is the managed version.
They will ask next
How do spokes resolve names for centrally hosted interface endpoints?
Private DNS is turned off on the shared endpoints. The network team creates private hosted zones for the service names, aliases them to the endpoints, and associates the zones with every spoke VPC.
Why stop spoke accounts from creating their own internet gateways?
A stray IGW bypasses the central firewall and egress logging. A service control policy makes the central path the only path.
Traps
- Designing without IPAM and discovering overlap after the first acquisition.
- Forgetting cross-region traffic needs TGW peering with static routes.
How did you do?Own pageAn EKS cluster stops scheduling pods because the subnets ran out of IPs. Why does that happen, and how do you fix it?
Say this first
The AWS VPC CNI gives every pod a real VPC address from secondary IPs on the node's ENIs, and it keeps a warm pool of spare addresses per node. Busy clusters burn through small subnets fast. Fixes, in order of effort: tune the warm pool, turn on prefix delegation so each ENI slot holds a /28, use custom networking to put pods in a large secondary CIDR such as one from 100.64.0.0/10, or run the cluster on IPv6.
Go deeper
Why it runs out
- Max pods per node is bounded by ENIs times IPs per ENI. The classic formula is
ENIs x (IPs per ENI - 1) + 2. Anm5.largehas 3 ENIs with 10 IPs each, so 3 x 9 + 2 = 29 pods. - The CNI pre-allocates: by default it keeps a whole spare ENI's worth of addresses warm on every node. Fifty nodes can reserve hundreds of idle addresses.
Fixes
Fix What it does Watch out for WARM_IP_TARGET,MINIMUM_IP_TARGETKeep fewer idle IPs per node More EC2 API calls when pods churn Prefix delegation Assigns /28 prefixes (16 addresses) per ENI slot, raising pods per node Needs free contiguous /28s; fragmented subnets fail. Nitro instances only Custom networking ENIConfigper AZ puts pods in subnets from a secondary VPC CIDRThe primary ENI no longer hosts pods, so max pods drops IPv6 cluster Pods get IPv6 from a huge prefix Every dependency must handle IPv6 or go through egress translation Custom networking sketch
- Add a secondary CIDR to the VPC, for example
100.64.0.0/16. - Create pod subnets per AZ from it.
- Set
AWS_VPC_K8S_CNI_CUSTOM_NETWORK_CFG=trueand create oneENIConfigper AZ. - Pods take addresses from the large range; nodes keep their routable addresses. Pod traffic leaving the VPC is SNATed to the node IP by default, so the 100.64 range does not need to be routable on-prem.
They will ask next
How do you see current IP usage?
aws ec2 describe-subnetsshowsAvailableIpAddressCountper subnet. On the cluster, the CNI'sipamdmetrics show assigned and warm addresses per node.Why might pods be unreachable from on-prem after custom networking?
The 100.64 range is not advertised over VPN or Direct Connect, and pods SNAT to the node address on the way out. Inbound calls should go to a load balancer in routable subnets, not to pod IPs directly.
Traps
- Sizing EKS subnets as /24s because "we only have ten nodes".
- Enabling prefix delegation on a fragmented subnet and getting allocation failures.
How did you do?Own page- Max pods per node is bounded by ENIs times IPs per ENI. The classic formula is
What MTU do you get in AWS, and where do large packets get into trouble?
Say this first
Current instance types use jumbo frames, 9001 bytes, inside a VPC. Traffic through an internet gateway is limited to 1500. A transit gateway carries up to 8500 bytes between VPCs and Direct Connect, and drops anything larger. A site-to-site VPN supports an MTU of 1446 and MSS of 1406. Path MTU discovery needs the ICMP fragmentation-needed message, so security groups must allow it or large transfers hang.
Go deeper
AWS numbers
Path MTU Inside a VPC (current instance types) 9001 Through an internet gateway 1500 Transit gateway between VPCs, Direct Connect, peering 8500 Site-to-site VPN 1446 (MSS 1406) Direct Connect private VIF 1500 or 9001 if jumbo is enabled Direct Connect transit VIF 1500 or 8500 if jumbo is enabled Where it hurts
- An instance with MTU 9001 sends large segments to a host across the transit gateway or the internet. If ICMP type 3 code 4 is blocked, the sender never learns to shrink, and transfers stall after the handshake.
- On-prem over VPN: the tunnel overhead leaves less than 1500 for the inner packet. Clamp MSS on the tunnel interface of your router.
What I do
- Allow ICMP "destination unreachable, fragmentation needed" inbound in security groups for paths that cross gateways.
- For instances that mostly talk off-VPC, set the interface MTU to 1500:
Shell ip link show eth0 sudo ip link set dev eth0 mtu 1500 - Clamp MSS on VPN routers. AWS's sample Cisco config uses
ip tcp adjust-mss 1379.
GCP
VPC networks default to an MTU of 1460 and can be raised up to 8896. The guest OS must match the VPC setting.
They will ask next
How do you prove an MTU problem from an instance?
ping -M do -s 1472 <dst>works (1500 total) andping -M do -s 8972 <dst>fails, ortracepathreports the path MTU. Small requests succeeding while large responses hang is the classic sign.Why does SSH work but scp stalls?
SSH login packets are small. The file transfer fills full-size segments, which hit the smaller MTU and are dropped with no ICMP getting back.
Traps
- Blocking all ICMP in security groups and NACLs "for security".
- Assuming 1500 everywhere and missing that instances default to 9001 inside the VPC.
How did you do?Book 3.3 Internet (IP)Own page