AWS Builder Center
Four networking concepts I only understood after breaking a VPC

Four networking concepts I only understood after breaking a VPC

Passing the assessment taught me nothing. A missing route table entry at 11pm taught me everything. Four networking ideas that stayed abstract until AWS made them expensive or embarrassing.

Cyberseecurity Analyst | AI/ML Engineer | Software Engineer
I could draw a subnet mask on paper long before I understood one. That is the problem with learning networking from slides. You get very good at answering questions about networks and remain completely useless at building one.
Here are four things that stayed abstract until AWS made them expensive or embarrassing.

1. CIDR is a street, not a spell

For two years,  /24  was a number I memorised alongside 254 usable hosts. I could compute it. I could not see it.
Then I picked  10.0.0.0/24  for a VPC because it looked tidy, and later needed to carve out four subnets across two availability zones. Suddenly the tidy number was a wall.
The click: the slash tells you how much of the address is locked.  /16  locks the first half and leaves you 65,536 addresses to play with.  /24  locks three quarters and leaves you a cul-de-sac. Small number, big street. Big number, small street.
I now start every VPC at  /16  and carve down. Costs nothing. Saves the rebuild.

2. Security groups remember you. NACLs do not.

Exam version: security groups are stateful, NACLs are stateless. I wrote that sentence on maybe six practice tests.
Real version: I allowed inbound traffic on my NACL, watched the request arrive, and watched the response die on the way out. I was trying to SSH into a test instance, and I lost about forty minutes to it.
A security group is a bouncer with a good memory. He let you in, so he lets you out. You only write the inbound rule.
A NACL is a bureaucrat. He does not care that he stamped your form eleven seconds ago. Outbound is a separate form. Write both, or your packets go in and never come home.

3. A subnet is not public because you called it public

This is the one I am slightly embarrassed about.
I named a subnet  public-subnet-1 , put an instance in it, gave it a public IP, and could not reach it. I checked the security group. I checked the instance. I checked the name again, as if the name would help.
The route table decides. Nothing else. A subnet is public because its route table has a line sending  0.0.0.0/0  to an internet gateway. No route, no internet, regardless of what you called the thing or how public the IP looks.
The internet gateway existing is not the same as the internet gateway being used. I know that sounds obvious written down. It was not obvious at 11pm.

4. The NAT Gateway is a one-way mirror with a meter running

Private subnets need to reach out for updates. They must not be reachable from outside. That is a NAT Gateway.
Picture a one-way mirror. Your instance can see out and start a conversation. Nothing outside can see in or start one.
The part nobody mentions in the tutorial: it bills hourly whether you use it or not, plus per gigabyte processed. I left one running over a long weekend and it quietly billed me about five dollars for doing nothing. It taught me more about AWS billing than any documentation page.

The actual lesson

Every one of these was in material I had already studied and passed assessments on. Passing meant nothing. Breaking something meant everything.
If you are learning networking right now: build the VPC. Break the VPC. Nothing in a slide deck will teach you what a missing route table entry feels like at 2am.
What is the concept that took you longest to actually understand, as opposed to memorise? I want to know I am not alone here.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article