Cloud networking
Internet gateway and NAT gateway
The VPC's doors: one-to-one public IPs both ways through the internet gateway, and outbound-only overload through a NAT gateway.
The internet gateway maps each instance's public (elastic) IP to its private address, both ways: static NAT, held in the gateway, so the instance never sees its public address and the IP can move to another instance in a moment. An instance without one gets no internet, even in a public subnet. A NAT gateway sits in a public subnet with a public IP of its own and overloads (PAT) a private subnet onto it: replies come back, new connections from the internet do not. To join your own network, a site-to-site VPN (a virtual private gateway, IPsec over the internet) is quick and cheap; a direct connect (AWS Direct Connect, Azure ExpressRoute) is a private circuit with steady bandwidth and latency. VPC peering joins two VPCs privately: it carries nothing until each VPC's route table points at it, it needs address blocks that don't overlap, and it never passes traffic on to a third VPC.
Read next
- VPC (virtual private cloud) A private network of your own inside a cloud provider, split into subnets whose route tables decide their way out.
- Static NAT, dynamic NAT and PAT One address for one device (static), addresses from a pool as devices go out (dynamic), or one address shared by port (PAT).
- NAT A router rewriting addresses as packets pass, usually to hide many private devices behind one address.
- VPN Packets wrapped, encrypted, in UDP to a VPN server, which unwraps them on the far side.