What is subnetting?
Subnetting is the practice of dividing a single IP network into several smaller networks called subnets. Each subnet has its own network address, broadcast address and range of host addresses. In subnetting in computer networks this is how a company turns one address block into separate networks for departments, floors, servers, guests and links between routers.
Subnetting definition: creating subnetworks by extending the network portion of an address into the host portion, so that a longer subnet mask (a larger CIDR prefix) identifies smaller networks.
Why do we subnet?
- Less broadcast traffic. Broadcasts stay inside their own subnet, so a chatty segment does not slow the whole company.
- Better security. Firewalls and ACLs can control traffic between subnets, isolating servers, guests or IoT devices.
- Efficient addressing. Give each segment only the addresses it needs.
- Simpler troubleshooting and routing. Failures and routes are easier to reason about when networks are small and well named.
Subnetting in 5 steps
- Know the starting network — for example
192.168.10.0/24. - Decide how many subnets or hosts you need. Need 4 subnets? Borrow 2 bits (2² = 4).
- Write the new mask. /24 + 2 borrowed bits = /26 = 255.255.255.192.
- Find the block size. 256 − 192 = 64 addresses per subnet.
- List the subnets. Network addresses step by 64.
Worked example: splitting 192.168.10.0/24 into four subnets
| Subnet | Network | Usable range | Broadcast |
|---|---|---|---|
| 1 | 192.168.10.0/26 | .1 – .62 | 192.168.10.63 |
| 2 | 192.168.10.64/26 | .65 – .126 | 192.168.10.127 |
| 3 | 192.168.10.128/26 | .129 – .190 | 192.168.10.191 |
| 4 | 192.168.10.192/26 | .193 – .254 | 192.168.10.255 |
Verify any row with the IP subnet calculator.
Subnetting table (IPv4)
This quick-reference IP subnetting table shows how many subnets you get when you borrow bits from a /24 network. The full table for every prefix is on the subnet mask cheat sheet.
| Bits borrowed | New prefix | Subnet mask | Subnets | Usable hosts each |
|---|---|---|---|---|
| 1 | /25 | 255.255.255.128 | 2 | 126 |
| 2 | /26 | 255.255.255.192 | 4 | 62 |
| 3 | /27 | 255.255.255.224 | 8 | 30 |
| 4 | /28 | 255.255.255.240 | 16 | 14 |
| 5 | /29 | 255.255.255.248 | 32 | 6 |
| 6 | /30 | 255.255.255.252 | 64 | 2 |
Subnetting vs supernetting
Subnetting takes one network and makes it smaller by lengthening the prefix: one /24 becomes two /25s. Supernetting (also called route aggregation or summarisation) takes several contiguous networks and makes them one larger network by shortening the prefix: 192.168.0.0/24 and 192.168.1.0/24 become 192.168.0.0/23. Supernetting only works when the networks are contiguous and the first network starts on a boundary that fits the new, larger block. CIDR made both techniques routine; the IP range calculator performs aggregation for you.
| Subnetting | Supernetting | |
|---|---|---|
| Direction | Splits one network | Merges networks |
| Prefix | Gets longer (/24 → /26) | Gets shorter (/24 → /23) |
| Goal | Segmentation, efficiency | Smaller routing tables |
| Used by | LAN administrators | ISPs, core routers |
Subnetting and addressing: key terms
- Network address – first address of the subnet; identifies the network.
- Broadcast address – last address; reaches every host in the subnet.
- Usable hosts – addresses between the two, assignable to devices.
- Subnet mask / prefix – marks the network/host boundary. See the subnet mask calculator.
- Default gateway – the router interface hosts use to leave their subnet.
Next steps
Test yourself with subnetting practice questions, plan uneven networks with VLSM, and read how VLSM, FLSM and CIDR differ. For the legacy ranges that older textbooks still use, see IP address classes.