
🌐Networking basics for DevOps beginners.
An IP address identifies a device on a network. A subnet divides a network into smaller networks.
CIDR defines the size of an IP address range. The formula is total IPs = 2^(32 − prefix).
For example, 10.0.0.0/24 leaves 8 free bits, so 2⁸ gives you 256 total IPs. In AWS, 5 of them are reserved in every subnet, so 251 are usable. A bigger number after the slash means a smaller network.
A port is a numbered door on a device that points to a specific service. The IP address finds the device, and the port finds the service running on it.
Common ports to know: 22 for SSH, 80 for HTTP, 443 for HTTPS, 3306 for MySQL, and 5432 for PostgreSQL.
In AWS, a public subnet has a route to an Internet Gateway. A private subnet uses a NAT Gateway for outbound internet access, when required. Security groups control which traffic is allowed, including which ports are open.