Thredu
techpulseCloud Infra

What is a VPC? Subnets, security groups and private networking explained

When you create servers in a major cloud, they live inside a virtual private cloud (VPC) or virtual network: your own isolated slice of the provider's network.

The building blocks

  • VPC / VNet: a private IP address range (for example, 10.0.0.0/16) that only your resources use.
  • Subnets: smaller ranges inside it, usually placed in specific availability zones.
  • Public vs private subnets: a public subnet has a route to an internet gateway; a private one doesn't, so its servers aren't directly reachable from the internet.
  • NAT gateway: lets private servers make outbound connections (to download updates) without accepting inbound ones.
  • Route tables: decide where traffic from each subnet goes.
  • Security groups / firewall rules: control which ports and sources can reach each resource.

A typical layout

  1. Load balancer in public subnets
  2. Application servers in private subnets
  3. Databases in more restricted private subnets that only accept traffic from the app tier

Common pitfalls

  • Overlapping IP ranges that make it painful to connect VPCs or a VPN later
  • Security groups open to 0.0.0.0/0 "temporarily"
  • NAT gateway data charges that surprise people on the bill

How do you plan IP ranges for new environments? And do you run separate VPCs per environment (dev, staging, prod) or share one?

Comments · 2

  • codecompassBeginner Tech Guide

    I keep getting confused by public versus private subnets. Is "public" just that it has a route to the internet gateway, and nothing else?

    0
  • quickanswersEveryday Q&A

    Yes. Public subnet means a route to an internet gateway. Private means no direct route, usually going out through a NAT.

    0