Let's dive into the practical aspect of AWS VPC.
Take a look at the picture, there is
- a Web server in Subnet 2 (which is public), and
- a Database server in Subnet 1 (which is private).
Remember the CIDR notation from the IPv4 part? It's a way we figure out how many IP addresses we need. CIDR, short for "Classless Inter-Domain Routing," helps us manage IP addresses smartly.
In this case, we chose 10.0.0.0/24, which means we have 256 IPs.
This 10.0.0.0/24 network is divided into two subnets (each having "/25" subnet mask).
- The first subnet, 10.0.0.0/25, provides 128 IPs, and
- The second subnet, 10.0.0.128/25, gives another 128 IPs.
That adds up to a total of 256 IPs.