Use it to split an address block into equal subnets, or to check that a subnet plan has room for the hosts it needs.
Subnetting
Subnetting divides one network into smaller subnets by borrowing host bits for the network part; each borrowed bit doubles the number of subnets and halves the hosts per subnet.
1. Hosts needed per subnet → host bits (e.g. 50 hosts → 6 bits → /26).
2. Subnets of /26 in a /24: 4 (.0, .64, .128, .192).
3. Enough subnets? If not, use a larger block or VLSM.
4. Write network, gateway and broadcast for each.
5. Check no subnet overlaps an existing one.
host requirement → prefix length → block size → subnet list → no overlap → assigned to VLANs and links
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show ip route 192.168.10.0 255.255.255.0 longer-prefixesVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Check your result Verify boundary
ipcalc 192.168.10.0/26
show ip route 192.168.10.0 255.255.255.0 longer-prefixes
Step 2 Common mistakes Narrow the fault
- Off-by-one errors: forgetting the network and broadcast addresses.
- Not aligning subnets to their block size, causing overlap.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Borrowing n bits gives 2^n subnets; remaining h host bits give 2^h − 2 hosts. Work from the requirement: hosts needed → host bits → prefix. Leave room for growth.
show ip interface brief— addresses on each interface.show ip interface <if> | include Internet address— address with prefix length.show ip route connected— the subnets the router derives from its addresses.show ip route <prefix> longer-prefixes— overlapping or more specific routes.- Subnet calculator (e.g.
ipcalc <ip>/<len>on Linux) — network, broadcast and host range.
ReferenceWhat it is1 section · depth on demand
Worked example
Split 192.168.10.0/24 into subnets of at least 50 hosts:
- 50 hosts need 6 host bits (62 usable) → /26, block size 64.
- Subnets: .0/26, .64/26, .128/26, .192/26.
| Subnet | Hosts | Broadcast |
|---|---|---|
| 192.168.10.0/26 | .1–.62 | .63 |
| 192.168.10.64/26 | .65–.126 | .127 |
| 192.168.10.128/26 | .129–.190 | .191 |
| 192.168.10.192/26 | .193–.254 | .255 |
Number of subnets = 2^(borrowed bits); hosts per subnet = 2^(host bits) − 2.
ReferenceWhy it matters1 section · depth on demand
How it works
Subnetting borrows host bits to create more, smaller networks. Borrowing n bits gives 2^n subnets; the remaining h host bits give 2^h − 2 hosts each. Work in the interesting octet: block size = 256 − mask, subnets start at multiples of the block size, and the broadcast is one less than the next subnet.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Worked example in the third octet
Split 172.16.0.0/16 into /23 subnets.
- Borrowed bits: 23 − 16 = 7 → 2^7 = 128 subnets
- Host bits: 32 − 23 = 9 → 2^9 − 2 = 510 hosts per subnet
- Mask: 255.255.254.0 → block size in the third octet = 256 − 254 = 2
| Subnet | Network | First host | Last host | Broadcast |
|---|---|---|---|---|
| 0 | 172.16.0.0 | 172.16.0.1 | 172.16.1.254 | 172.16.1.255 |
| 1 | 172.16.2.0 | 172.16.2.1 | 172.16.3.254 | 172.16.3.255 |
| 18 | 172.16.36.0 | 172.16.36.1 | 172.16.37.254 | 172.16.37.255 |
| 127 | 172.16.254.0 | 172.16.254.1 | 172.16.255.254 | 172.16.255.255 |
Which subnet does 172.16.37.200/23 belong to?
Third octet 37 → largest multiple of 2 not above 37 = 36 → network 172.16.36.0/23, broadcast 172.16.37.255. 172.16.37.200 is a valid host; so is 172.16.36.255, which looks like a broadcast but is not, because the subnet spans two third-octet values.
Subnet zero and the all-ones subnet
RFC 950 originally discouraged using the first and last subnet. Modern IOS allows both (ip subnet-zero is the default), and CIDR made the restriction obsolete; old exam material that subtracts 2 from the subnet count is outdated.
Fast check method
1. Find the octet where the mask is neither 255 nor 0.
2. Block size = 256 − mask value in that octet.
3. Network = largest multiple of block size ≤ address octet; following octets become 0.
4. Broadcast = next network − 1; following octets become 255.
Verify
show ip interface Gi0/0/1 | include Internet address displays the configured address/prefix; show ip route connected shows the subnet the router derived. If a host and its gateway disagree on the subnet, they disagree on which addresses are local, and some destinations fail while others work.
Subnetting shortcut
1. Find the interesting octet (where the mask is not 255 or 0).
2. Block size = 256 − mask value in that octet (e.g. 256 − 224 = 32).
3. Networks start at multiples of the block size (0, 32, 64…).
4. Broadcast = next network − 1; hosts are in between.
Example: 10.1.5.77/27 → block 32 → network 10.1.5.64, broadcast 10.1.5.95, hosts .65–.94.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in IP Fundamentals → IPv4 → Addressing → Subnetting. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc791.html · confidence 94%