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"))   # True
a=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

Taught in

References

Certification courses