subnet
A range of IP addresses sharing the same network prefix, such as 192.0.2.0/24, whose members can reach each other without a router.
In more detail
A subnet is a range plus a boundary, not just a number with dots. Destinations inside your subnet are delivered locally; everything else needs a route, usually through the default gateway. Address appearance alone does not prove reachability.
Examples
In AWS: A smaller slice of a VPC’s address range, placed in one availability zone, where resources actually live.ip_network("10.20.1.128/25").subnet_of(ip_network("10.20.1.0/24")) # Truea=192.0.2.9 local=y b=198.51.100.9 local=n compares a same-subnet peer with a remote one.resource "aws_subnet" "public_a" {
vpc_id = aws_vpc.main.id
cidr_block = "10.0.0.0/24"
}In Terraform: In a cloud network, machines are launched into subnets rather than directly into the network. In Terraform a subnet refers to its network's identifier, which creates the dependency that builds the network first.Related terms
- VPC — A virtual private cloud: your own isolated private network inside a cloud provider, with an address range you choose.
- public subnet — A subnet whose route table sends its default route to an internet gateway, so resources with public addresses can be reached from the internet.
- private subnet — A subnet with no route to an internet gateway, so nothing on the internet can start a connection to resources inside it.
- route table — A list of destinations and next hops that decides where packets leaving a subnet go.
- IP address — The numeric address, such as 192.168.1.10, that identifies a machine or container on a network.
- CIDR — A compact way to write a range of IP addresses, such as 10.244.0.0/24, where the number after the slash says how many leading bits are fixed.
- CIDR notation — A compact way to write a block of IP addresses as an address, a slash and a number, such as 10.20.1.0/24.
- segmentation — Dividing a network into separate zones with controlled paths between them, so a problem or attacker in one zone cannot freely reach the others.
- security group — A stateful firewall attached to a resource’s network interface, made only of allow rules for ports, protocols and sources.
- prefix length — The number after the slash in an address such as 192.0.2.42/24, saying how many leading bits identify the network.
- routing table — The kernel's list of destination prefixes and where to send packets for each: out of which interface and through which next hop.
- default gateway — The router a host sends packets to when the destination is outside its own subnet and no more specific route exists.
- availability zone — One of several isolated groups of data centres inside a cloud region, with separate power and networking so a failure in one does not take down the others.
Taught in
- One Database Doing Five Jobs — AWS Certified Cloud Practitioner (CLF-C02) Exam Prep
- The Public Subnet That Was Not — AWS Certified Cloud Practitioner (CLF-C02) Exam Prep
- Confusable Services Sprint: One Clue Each — AWS Certified Cloud Practitioner (CLF-C02) Exam Prep
- Forty Eight Of Sixty Five — AWS Certified Cloud Practitioner (CLF-C02) Exam Prep
- The Morning An Availability Zone Went Dark — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- The Network As A Control: CIDR, Routes, ACLs And Security Groups — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- Private Paths: VPC Endpoints And PrivateLink — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- The Edge: WAF, Shield, CloudFront And GuardDuty — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- Network Cost: NAT Gateways, Zones And Data Out — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- Long-Stem Clinic: The Phrase That Decides — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- The Link That Would Not Die: Keys, SAS And Storage Firewalls — Microsoft Azure Administrator (AZ-104) Exam Prep
- Ninety-Nine Percent Full: Disks, Sizes And Availability — Microsoft Azure Administrator (AZ-104) Exam Prep
- Bristol Cannot See The Scans: Address Plans, Peering And Routes — Microsoft Azure Administrator (AZ-104) Exam Prep
- Port 22 Answers From The Internet: NSGs And Application Security Groups — Microsoft Azure Administrator (AZ-104) Exam Prep
- No Public Doors: Bastion, Service Endpoints And Private Endpoints — Microsoft Azure Administrator (AZ-104) Exam Prep
- Healthy, Said The Load Balancer: Azure DNS And Load Balancing — Microsoft Azure Administrator (AZ-104) Exam Prep
- Networking — Microsoft Azure Fundamentals (AZ-900) Exam Prep
- Zero Trust, Defence In Depth And Defender For Cloud — Microsoft Azure Fundamentals (AZ-900) Exam Prep
- Network Exposure: NodePorts, Host Firewalls And Egress — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Virtual Private Clouds — Cloud Infrastructure & Hyperscaler Architecture
- Subnets: Public and Private — Cloud Infrastructure & Hyperscaler Architecture
- Route Tables and Internet Gateways — Cloud Infrastructure & Hyperscaler Architecture
- Network Address Translation — Cloud Infrastructure & Hyperscaler Architecture
- Security Groups and Firewalls — Cloud Infrastructure & Hyperscaler Architecture
- Load Balancing and DNS — Cloud Infrastructure & Hyperscaler Architecture
- Elastic Compute Cloud (EC2) — Cloud Infrastructure & Hyperscaler Architecture
- Auto Scaling Groups — Cloud Infrastructure & Hyperscaler Architecture
- Elastic File System (EFS) — Cloud Infrastructure & Hyperscaler Architecture
- Managed Relational Databases (RDS) — Cloud Infrastructure & Hyperscaler Architecture
- Infrastructure as Code (Handover to Terraform) — Cloud Infrastructure & Hyperscaler Architecture
- Shared Responsibility Model & Cloud Threat Landscapes — Cloud Security & DevSecOps Engineering
- Cloud Network Isolation: VPC Peering & PrivateLink — Cloud Security & DevSecOps Engineering
- Security Architecture Gap Analysis — Cybersecurity Fundamentals, GRC & Cryptography
- Enterprise Risk Registers & Treatment Plans — Cybersecurity Fundamentals, GRC & Cryptography
- First Network And Observability Setup — Google Cloud Associate Cloud Engineer Exam Prep
- Networking: VPCs, Firewalls And Hybrid Links — Google Cloud Associate Cloud Engineer Exam Prep
- Running Compute Engine — Google Cloud Associate Cloud Engineer Exam Prep
- Running The Network — Google Cloud Associate Cloud Engineer Exam Prep
- Monitoring And Logging — Google Cloud Associate Cloud Engineer Exam Prep
- The gcloud And Product-Name Sprint — Google Cloud Associate Cloud Engineer Exam Prep
- IP Addresses, Netmasks And Subnets — Linux Fundamentals & Systems Administration
- Interfaces, Routes And The Default Gateway — Linux Fundamentals & Systems Administration
- What Is Infrastructure As Code? — Infrastructure as Code with Terraform
- Why Modules: Composition Versus Monoliths — Infrastructure as Code with Terraform
- Writing A Custom Network Module — Infrastructure as Code with Terraform
- Calling Your Module And Passing Variables — Infrastructure as Code with Terraform
- Remote State With The Backend Block — HashiCorp Terraform Associate (004) Exam Prep
- VCS, CLI And API Workflows: Speculative Plans And Run Triggers — HashiCorp Terraform Associate (004) Exam Prep
- Twelve Old Servers, Two New Hosts: KVM, QEMU, libvirt And Disk Images — CompTIA Linux+ (XK0-006) Exam Prep
- The Tracker Is Down, For Some People: Link, Address, Route, Name And Port — CompTIA Linux+ (XK0-006) Exam Prep
- Three PBQs Against The Clock: A Performance-Based Mock On Both Families — CompTIA Linux+ (XK0-006) Exam Prep
- Ninety Minutes, Five Domains: The Full Mock And The Week Before The Exam — CompTIA Linux+ (XK0-006) Exam Prep
References
- Subnets for your VPC
- Python documentation: ipaddress
- RFC 950: Internet Standard Subnetting Procedure
- RFC 4632: Classless Inter-domain Routing (CIDR)
Certification courses
- AWS Cloud Practitioner course and practice exam: CLF-C02
- AWS Solutions Architect Associate course and practice exam: SAA-C03
- AZ-104 course and practice exam: Microsoft Azure Administrator
- AZ-900 course and practice exam: Microsoft Azure Fundamentals
- CKS course and practice exam: Certified Kubernetes Security Specialist
- Google Associate Cloud Engineer course and practice exam: Google Cloud certification
- Terraform Associate course and practice exam: HashiCorp Terraform Associate (004)
- CompTIA Linux+ course and practice exam: XK0-006