How networking works: VPC, security groups, peering, Network Hub and NAT

Each tool answers one question: which services live together, who can reach whom, which networks are joined, what is filtered, and which IP you use to go out to the internet.

Production Project · VPC 10.10.0.0/16Subnet 10.10.1.0/24webWeb front endapiAPI serviceSecurity group for dbOnly :5432 from apidbDatabase12Shared tools Project · VPC 10.30.0.0/16monitoringShared tools3VPC Peering4NAT GatewayYour fixed outbound IPBank / partnerWhitelists this IP
The service names and IP ranges in the picture are examples. The dashed line from web is a connection the security group doesn’t allow.

Step by step, following the numbers

  1. Services in the same VPC call each other by their .internal name, and db’s security group has a rule that lets api in on port 5432.
  2. web has no rule, so it can’t reach db. (New services join the Default group, where they reach each other on every port. Move db into its own group first, so the rules take effect.)
  3. VPC peering joins 2 Projects, but opens nothing until you add a security group rule whose source is the peered VPC.
  4. Services in the chosen subnets go out to the internet through the NAT Gateway with a fixed IP that is yours alone, so partners can add that IP to their whitelist.
ToolQuestion it answersRead more
VPC and subnetsWhich services share a networkVPC and subnets
Security groupWho can reach which service, on which portSecurity groups
VPC peeringWhich two Projects in one region can talkVPC peering
Network HubJoining many VPCs, or VPCs in different regionsNetwork Hub
VPN GatewayLetting offices and staff into your VPCsVPN Gateway
FirewallFiltering traffic between VPCs and to the internet with ordered rulesFirewall on a Network Hub
NAT GatewayWhich IP you use to go out to the internetNAT Gateway

Plan each Project’s IP range so they don’t overlap before you create services. Then you can add peering or a Network Hub later without moving IP ranges (see Network layout).

VPC peering joins two VPCs in the same region. To join three or more, VPCs in different regions, or offices over VPN, use a Network Hub.

Still stuck? Let our team help

Open a ticket from the Console. Tell us the site or service, what you did and the message on screen. Our reply comes back in the same ticket, so everything stays in one place.