Subnetting / CIDR Explained: What Is 192.168.1.0/24 and How to Calculate
Symptom: 192.168.1.0/24 looks cryptic
Configuring servers, container networks, or a cloud VPC, you keep meeting 10.0.0.0/16, 192.168.1.0/24. What does that number after the slash mean?
What CIDR is
CIDR (Classless Inter-Domain Routing) writes a network as IP/prefix-length. For 192.168.1.0/24:
- An IPv4 address is 32 bits;
/24means the first 24 bits are the network portion, the remaining 8 bits are host portion;- The subnet mask is
255.255.255.0(24 binary 1s).
Devices sharing the network bits are on the same subnet and can talk directly; crossing subnets needs a gateway.
To determine whether two IPs are on the same segment: write both IPs and the mask in binary, AND them bitwise, and compare. 192.168.1.100/24 and 192.168.1.200/24 both AND down to 192.168.1.0 — same segment. 192.168.2.100/24 gives 192.168.2.0 — a different segment. That is the entire principle behind "ping fails? first check whether you crossed a subnet."
How to compute usable addresses
| Item | Calculation |
|---|---|
| Host bits | 32 - prefix length |
| Total addresses | 2 ^ host bits |
| Usable hosts (prefix 0–30) | 2 ^ host bits - 2 (minus network and broadcast) |
Common prefixes:
| CIDR | Mask | Usable hosts | Typical use |
|---|---|---|---|
/24 | 255.255.255.0 | 254 | Home / department LAN |
/25 | 255.255.255.128 | 126 | Splitting a segment in half |
/26 | 255.255.255.192 | 62 | Small business subnet |
/28 | 255.255.255.240 | 14 | DMZ / small cluster |
/16 | 255.255.0.0 | 65534 | Cloud VPC main block |
/8 | 255.0.0.0 | 16777214 | Huge private network (use carefully) |
Two special cases overturn “minus 2”: /31 (RFC 3021 — both addresses usable) and /32 (single host). If arithmetic claims a /31 has zero usable addresses, trust the RFC and this site’s tools.
Implementer notes for this site’s tools
| Tool | Input | Boundaries |
|---|---|---|
| CIDR Calculator | One string a.b.c.d/n | IPv4 only; host bits zeroed; /31//32 host counts special-cased |
| Subnet Calculator | IP, prefix, divide into (power of two) | Equal splits; new prefix = old + log₂(count); parent masked first, then stepped |
Neither tool does IPv6, start–end → CIDR compression, or automatic overlap detection. VLSM (unequal sizes) means you allocate biggest-first by hand, then verify each block in the CIDR tool — the subnet page only equal-splits.
Planning VPC segments in practice
When laying out cloud networks, work top-down with room to grow:
- Give the VPC one large prefix (e.g.
10.0.0.0/16); - Cut environments at
/20or/22: production, staging, testing each take a block, with gaps in between for future environments; - Inside each environment, split by tier at
/24: application, data, middleware separated — security-group rules written against subnets are far more maintainable than per-IP rules; - Never squeeze two environments into one /24 "just for now" — untangling later means touching dozens of machine configurations.
The reverse trap matters too: prefixes cannot be aggregated arbitrarily. 192.168.0.0/24 and 192.168.1.0/24 can merge into a /23; 192.168.0.0/24 and 192.168.2.0/24 cannot — aggregation must land on clean binary boundaries.
Private ranges, routing, and ACLs
RFC 1918: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. Only 172.16–31 is private; 172.32.x.x is public. Expand office ranges in the calculator before copying them into configs.
Routing follows longest prefix; ACL / security-group engines often follow rule order. Aggregating four /26s into one /24 announcement shrinks the table, but if the firewall only lists the aggregate and a narrower deny sits lower, behavior depends on LPM vs first-match — probe both sides with two addresses before go-live.
Layer hostname or full-URL allowlists separately from CIDR allowlists: split with the URL parser; TLS identity belongs in the certificate decoder. Container dual-stack port occupancy is covered in the on-site Docker and port troubleshooting posts.
Common pitfalls
- Subtract 2 for usable (0–30): beginners often use
2^8 = 256, but the first and last addresses can't be assigned to hosts; - Network address: all host bits 0 (e.g.
192.168.1.0) denotes the segment itself, never assignable to a device; - Broadcast address: all host bits 1 (e.g.
192.168.1.255) is for broadcasting to the whole segment; - Gateway overhead: real assignable capacity usually shrinks further — the gateway takes an address (conventionally the first usable), and cloud providers reserve a few more for internal services. Seeing fewer "available IPs" in the console than your math says is normal;
- /31, /32 special: point-to-point links and single-host routes have dedicated uses; this site’s tools count them per RFC 3021 / host-route semantics.
How to compute with a tool
Open the Subnet Calculator or CIDR Calculator on ToolVault:
- CIDR page: enter one string (e.g.
192.168.1.100/24) and read the normalized network, broadcast, and range; - Subnet page: enter IP, prefix, and divide into 4/8/… pieces to list each child block;
- Change prefix or piece count to see sizes update live — no manual math.
Computed locally. When planning cloud networks, pair it with the Dockerfile Generator to bake segment conventions into deployment configs. Longer CIDR write-up: CIDR calculator guide.
FAQ
Are /24 and 255.255.255.0 the same?
Yes, just two notations. /24 is the prefix-length form; 255.255.255.0 is dotted-decimal mask — both say "first 24 bits are network". Note: this site’s CIDR input accepts /n only, not a bare dotted mask string.
Why are home routers usually /24?
A /24 gives 254 usable addresses — plenty for home devices, yet not so large it's unmanageable. Larger segments mean more broadcast traffic and bigger ARP tables; bigger is not better.
Must subnetting and mask always match?
They must. The mask defines "which bits are network"; CIDR's /N is just shorthand for the mask.
What happens if two subnets overlap?
The routing table becomes ambiguous and packets can leave through the wrong interface. Cloud platforms refuse to create overlapping subnets outright. This site’s tools do not auto-flag overlap — expand candidates and verify network–broadcast spans do not intersect before committing.
The mental shortcut: powers of two
You rarely need a subnet calculator for rough planning if you memorize the boundary values. A /n subnet holds 2^(32-n) addresses (minus 2 for prefixes 0–30):
| Prefix | Addresses | Usable | Natural fit |
|---|---|---|---|
| /24 | 256 | 254 | A floor, a lab bench |
| /25 | 128 | 126 | Half a floor |
| /26 | 64 | 62 | A team, a small cluster |
| /27 | 32 | 30 | A handful of VMs |
| /28 | 16 | 14 | A management network |
| /30 | 4 | 2 | A point-to-point link |
A worked VLSM example: one /24 for a company with four departments of very different sizes. Allocate the largest first: engineering (100 hosts) takes /25 (126 usable); QA (50) takes /26 (62); ops (20) takes /27 (30); the remaining /27 halves into two /28s for management and growth. Allocate descending, keep boundaries aligned to powers of two, and every later allocation still fits without renumbering.
Triage notes
The opening ties same-subnet detection to a real failure: AND the two IPs with the mask, and only equal results mean the same subnet — that is the principle behind 'if ping does not work, first check whether you are crossing subnets'. The pitfall most likely to trip mental arithmetic is /31: both addresses on a point-to-point link are usable, overturning the 'minus 2' rule, and the article says outright to trust the RFC and the tools. The top-down VPC planning carries one hard discipline — never squeeze two environments into one /24 'just for now', because the later split means touching dozens of machine configurations — and the reverse aggregation trap is equally concrete: 0.0/24 and 1.0/24 merge into a /23, but with 2.0/24 they do not; aggregation must land on power-of-two boundaries.
Provided by ToolVault. Related tools: Subnet Calculator, CIDR Calculator, URL Parser, Certificate Decoder, Dockerfile Generator. Related reading: CIDR calculator guide. Visit the home page for more developer tools.
Related Tools
Related Articles
Linux Crontab in Practice: Commands, Logs, and Debugging
Crontab beyond syntax: three must-know commands, /etc/cron.d vs user crontabs, five-step debugging, PATH/timezone/% escaping, MAILTO, and what to do when you need second-level scheduling.
docker run to docker-compose: The Complete Migration Guide (with Flag Map)
Migrate docker run commands to docker-compose.yml: five advantages of compose over raw run, a flag-by-flag mapping table (ports, volumes, env, restart, networks), the classic pitfalls (bare -e passthrough, anonymous volumes, --rm semantics), and an online converter that runs locally in your browser.
Permission denied (publickey): 6 Reasons Git Push Fails Over SSH (and the Fix for Each)
git clone or push rejected with Permission denied (publickey) fatal: Could not read from remote repository? Covers missing keygen, key not loaded in the agent, public key not added to GitHub/GitLab, multi-account key routing with ~/.ssh/config, deploy key limits, and wrong remote URLs — with ssh -v diagnostics.