Advertisement
Digital Intelligence Hub

How to Calculate a Subnet Mask: Step-by-Step Subnetting With Worked Examples (2026)

Expert Analyst Robert Harrison
Publish Date Oct 29, 2026
Advertisement
How to Calculate a Subnet Mask: Step-by-Step Examples
Nodemaven

To calculate a subnet mask, you need one fact the IP address does not contain: the prefix length, such as /26, or the number of hosts or subnets you must fit. From a prefix, write that many 1 bits and convert each group of eight to decimal, so /26 becomes 255.255.255.192. From a host count, add 2, round up to the nearest power of two and find its exponent: 50 hosts need 64 addresses, which is 2⁶, so 32 − 6 gives a /26.

Plenty of guides promise a mask "from an IP address", then start from a prefix they never explain. Your home router may pair 192.168.x.x addresses with 255.255.255.0, but that is a router setting, not something the address dictates. RFC 4632, the IETF's 2006 document on CIDR — Classless Inter-Domain Routing, which sizes networks by prefix instead of by class — calls the old Class A, B and C system legacy.

Advertisement

Subnetting still matters in 2026. Cisco's CCNA v2.0 exam goes live on 3 February 2027 with IPv4 subnetting in its exam topics. In the cloud, AWS, Azure and Google Cloud reserve four or five addresses in each subnet's main IPv4 range, so subtracting only two overstates how many hosts fit there. Size a cloud subnet too small and you may have to recreate it.

This guide covers three ways to calculate a subnet mask, a /8 to /32 cheat sheet, the block-size method for network and host ranges, the 10.67.100.0/17 practice question, mixed-size subnet plans and the exceptions to the minus-two rule.

Robert Harrison, OSINT & Network Utility Expert, explaining how to calculate a subnet mask at TrustMyIP.com
Author: Robert Harrison OSINT & Network Utility Expert

"A subnet mistake I see often in 2026 is not a math slip; it is a missing number. Someone asks for the mask of 10.20.0.0 and expects one answer, but an address alone never tells you the mask. Once we agree on the prefix length or the host count, the rest takes a minute with the block-size method. I still check every plan with a short script before it touches a router."

"The minus-two rule has exceptions, too. Cloud platforms reserve more addresses, five per subnet on AWS and Azure and four on Google Cloud, while a /31 point-to-point link uses both of its addresses. Plan with the rule that matches where the subnet will live. Leave room to grow, because renumbering a full subnet later costs far more than a slightly bigger CIDR block today."

Quick Answer: Calculating a Subnet Mask

To calculate a subnet mask, start from the prefix length or the number of hosts you need, never from the IP address alone. Add 2 to the host count, round up to the nearest power of two and subtract its exponent from 32: 50 hosts need 64 addresses (2⁶), so 32 − 6 gives a /26, or 255.255.255.192. Then check the network and host range in our free subnet calculator.

Advertisement

Can You Calculate a Subnet Mask From an IP Address Alone?

No. An IPv4 address such as 10.20.30.40 can sit inside a /8, a /24 or a /28, and nothing in those four numbers says which. To find the subnet mask from an IP address, you need a second input: the prefix length after the slash or a requirement such as 50 hosts or 6 subnets. With it, the network address, broadcast and host range all follow from simple binary arithmetic.

Classful addressing, the system older textbooks teach, guessed the mask from the first octet: 255.0.0.0 for Class A, 255.255.0.0 for Class B and 255.255.255.0 for Class C. RFC 4632, the IETF's CIDR best-practice document (BCP 122) from August 2006, states that you cannot infer the network mask from an address's initial bit pattern, and it defines networks by prefix instead, such as 172.16.0.0/16. Our guide to IP address classes explains where those old defaults came from, but treat them as history, not as a calculation method.

Just setting a static IP at home?

You probably do not need to calculate anything. Copy the mask your other devices already show, which on home networks is often 255.255.255.0, a /24. Our guide on how to find your private IP address shows the screens where Windows, iPhone and Android list the mask, and you only need the math below when you design or split a network.

If you need a refresher on what a subnet mask is, start there. Here the focus is producing the right numbers, and most of them use CIDR notation, where the number after the slash counts the network bits.

Advertisement

Every subnetting problem starts from one of four inputs. Find yours in the table, and it points you to the method that solves it.

What you know What to do Example
The prefix, such as /26 Write that many 1 bits and convert each octet to decimal /26 → 255.255.255.192
Hosts per subnet, such as 50 Add 2, round up to the nearest power of two, subtract its exponent from 32 52 → 64 = 2⁶ → /26
A subnet count, such as 6 from a /24 Borrow s bits so that 2 to the power of s covers the subnet count 2³ = 8 → /24 + 3 = /27
An address and prefix, such as 192.168.1.130/26 Use the block size to find network, broadcast and hosts Network 192.168.1.128, broadcast 192.168.1.191

Start with the simplest case, a prefix you already know, because every other method ends by converting a prefix anyway.

How Do You Convert a CIDR Prefix Into a Subnet Mask?

Converting a prefix is the quickest way to calculate a subnet mask: write as many 1 bits as the prefix length, fill the rest of the 32 bits with 0s and convert each group of eight bits to decimal. A /26 becomes 11111111.11111111.11111111.11000000, which is 255.255.255.192. Every full octet is 255, because eight 1 bits add up to 255, and the one partial octet takes one of a few fixed values.

Each bit in an octet is worth 128, 64, 32, 16, 8, 4, 2 and 1 from left to right, so 11000000 is 128 + 64 = 192. Adding the bits from the left one at a time gives every value a mask octet can take after 0: 128, 192, 224, 240, 248, 252, 254 and 255. For a /20, the first two octets are full and four bits spill into the third, which makes 240, so the mask is 255.255.240.0.

Your prefix length also gives the size of the block: 32 minus the prefix is the number of host bits, and 2 to the power of that number is the total address count. So when you see /26 on an IP address, it means 26 network bits and 6 host bits: 64 addresses, 62 of them usable. To read a dotted mask as a prefix, reverse the process and add up the 1 bits in each octet: 255.255.240.0 is 8 + 8 + 4 + 0, a /20.

Advertisement

Devices show the same mask in different formats. Windows' ipconfig and the iPhone's Wi-Fi details list a dotted mask such as 255.255.255.0, while Linux's ip address command prints /24 after the address.

Here is a /8 to /32 subnet mask cheat sheet, and I checked every row with Python's ipaddress module, so you can skip the conversion when you are in a hurry.

Prefix Subnet mask Total addresses Usable hosts
/8 255.0.0.0 16,777,216 16,777,214
/9 255.128.0.0 8,388,608 8,388,606
/10 255.192.0.0 4,194,304 4,194,302
/11 255.224.0.0 2,097,152 2,097,150
/12 255.240.0.0 1,048,576 1,048,574
/13 255.248.0.0 524,288 524,286
/14 255.252.0.0 262,144 262,142
/15 255.254.0.0 131,072 131,070
/16 255.255.0.0 65,536 65,534
/17 255.255.128.0 32,768 32,766
/18 255.255.192.0 16,384 16,382
/19 255.255.224.0 8,192 8,190
/20 255.255.240.0 4,096 4,094
/21 255.255.248.0 2,048 2,046
/22 255.255.252.0 1,024 1,022
/23 255.255.254.0 512 510
/24 255.255.255.0 256 254
/25 255.255.255.128 128 126
/26 255.255.255.192 64 62
/27 255.255.255.224 32 30
/28 255.255.255.240 16 14
/29 255.255.255.248 8 6
/30 255.255.255.252 4 2
/31 255.255.255.254 2 2 (point-to-point, RFC 3021)
/32 255.255.255.255 1 1 (single host)

A table is handy when you already know the prefix. More often you know how many devices need addresses, and the prefix is what you have to find.

How Do You Calculate a Subnet Mask From the Number of Hosts?

Add 2 to the number of hosts to cover the network and broadcast addresses. Round up to the nearest power of two, keeping the number if it already is one, and note its exponent, which is the number of host bits; 32 minus that number is the prefix. For 50 hosts, 52 rounds up to 64, which is 2⁶, so 6 host bits give a /26, or 255.255.255.192, with 62 usable addresses for devices.

Powers of two worth memorizing are 4, 8, 16, 32, 64, 128, 256, 512 and 1,024, which match 2 to 10 host bits.

Two more host-count examples

  • →500 hosts: 502 rounds up to 512, or 2 to the 9th, so 9 host bits give a /23, 255.255.254.0, with 510 usable addresses.
  • →1,000 hosts: 1,002 rounds up to 1,024, or 2 to the 10th, so 10 host bits give a /22, 255.255.252.0, with 1,022 usable addresses.

Count the router too, because the default gateway takes one usable address. A /26 has 62 usable addresses, so 60 devices and a router leave room for just one more printer or access point, and growing the subnet later can mean changing the mask on every device or renumbering them.

Cloud subnets need a bigger cushion

Amazon's VPC subnet sizing documentation lists five reserved addresses in a 10.0.0.0/24 subnet: the network address, the VPC router, the DNS server, one that AWS keeps for future use and the broadcast address. Azure also reserves five, the first four and the last, according to Microsoft's Azure Virtual Network FAQ (July 2026), while Google Cloud reserves four in each primary range, according to its VPC subnets documentation (October 2026).

Where the subnet lives Reserved per subnet Smallest IPv4 subnet Usable in a /26
Classic LAN rule 2 (network and broadcast) /30, or /31 on point-to-point links 62
AWS VPC 5 (first four and last) /28 59
Microsoft Azure VNet 5 (first four and last) /29 59
Google Cloud VPC 4 (first two and last two of the primary range) /29 60

So when you calculate a subnet mask for AWS or Azure, add 5 instead of 2, or 4 on Google Cloud, then apply the platform's minimum size: /28 on AWS and /29 on Azure and Google Cloud. Sixty devices and a router fit a /26 on an office LAN, but AWS counts the router among its five reserved addresses, so 60 + 5 = 65 pushes the same workload to a /25.

Plan per zone as well: each AWS subnet sits entirely within one Availability Zone, so a design that spans three zones needs at least three subnets. Google Cloud lets you expand a subnet's primary range later but never shrink it, so an oversized range stays oversized. On any platform, size for today's hosts plus realistic growth. Host counts drive most designs, while the other common requirement is a fixed number of subnets that you carve from one block.

How Many Bits Do You Borrow for a Set Number of Subnets?

Borrow the smallest number of bits, s, where 2 to the power of s is at least the number of subnets you need, then add s to the original prefix. To split 192.168.10.0/24 into 6 subnets, 3 bits give 8, so the new prefix is /27, the mask is 255.255.255.224, and each subnet holds 32 addresses with 30 usable hosts. Exactly 8 subnets also need 3 bits, but 9 would need 4.

Borrowed bits — host bits you turn into network bits to create subnets — always trade hosts for subnets: each extra bit doubles the subnet count and halves the addresses in each one. In this example the eight /27 subnets start 32 addresses apart, at 192.168.10.0, .32, .64, .96, .128, .160, .192 and .224, so six go to your departments now and two stay free for later.

Always check the host side as well. Six subnets of at least 40 hosts each cannot come from one /24, because 3 borrowed bits leave /27s with only 30 usable hosts, so that design needs a larger block.

Older material tells you to discard the first and last subnet. RFC 950 said back in 1985 that you should not assign the all-zeros and all-ones subnet values to physical subnets. Cisco's subnet-zero note (February 2023 revision), however, says its routers have enabled subnet zero by default since IOS Software Release 12.0 and calls the practice generally accepted. Count all eight here unless an exam question or a legacy device says otherwise.

However you calculate a subnet mask, the next job is the one exams actually test: turning any address into its network, broadcast and host range.

How Do You Find the Network Address and Usable Host Range?

Use the block-size method. Find the interesting octet — the first one where the mask is not 255 — and subtract its mask value from 256 to get the block size, the step between subnet starts in that octet. Round that octet down to a multiple of the block size and set every later octet to 0 for the network address. The broadcast is the next block's start minus one, with later octets at 255, and usable hosts sit between.

Block-size method: 192.168.1.130/26

1Write the mask

A /26 is 255.255.255.192, so the fourth octet is the interesting one.

2Find the block size

Subtract 192 from 256 to get 64, the block size some courses call the magic number, so subnets in that octet start at 0, 64, 128 and 192.

3Round down to the block

The value 130 sits between 128 and 191, so the network address is 192.168.1.128. There are no later octets to reset here.

4Find the broadcast

Since the next block starts at 192, the broadcast is one less: 192.168.1.191.

5List the usable hosts

Hosts run from 192.168.1.129 to 192.168.1.190, which gives 62 usable addresses.

6Confirm the count

With six host bits, a /26 holds 2 to the 6th, or 64 addresses, and removing the network and broadcast leaves 62.

Split the same /24 into four /26 blocks and the example address lands in the third one.

192.168.1.0/26 Hosts .1 to .62, broadcast .63
192.168.1.64/26 Hosts .65 to .126, broadcast .127
192.168.1.128/26 Hosts .129 to .190, broadcast .191 192.168.1.130 is here
192.168.1.192/26 Hosts .193 to .254, broadcast .255

The block-size method is a shortcut for a bitwise AND — a bit-by-bit comparison that keeps a 1 only where both the address and the mask have one. In binary, 130 is 10000010 and the mask octet 192 is 11000000; ANDing them gives 10000000, which is 128, the same network you found by rounding. Setting the six host bits to 1 gives 10111111, or 191, the broadcast.

When you write a Cisco access control list (ACL) or an OSPF network statement, you need the mask's opposite, the wildcard mask — 255.255.255.255 minus the subnet mask, which marks host bits instead of network bits. For a /26, that wildcard is 0.0.0.63.

That broadcast address has a job of its own, which our guide to broadcast addresses in networking covers in detail. Those steps also work when the mask ends in the third octet, which is exactly where the /17 practice question trips people up.

What Is the First Possible Host IP for the 10.67.100.0/17 Network?

The first possible host IP for the 10.67.100.0/17 network is 10.67.0.1. A /17 mask is 255.255.128.0, so blocks of 128 in the third octet start at 0 and 128, and 100 falls in the 0 block. That makes the network 10.67.0.0, the broadcast 10.67.127.255, the last usable host 10.67.127.254 and the usable count 32,766. In other words, 10.67.100.0 looks like a network address but is not one.

In binary, 100 is 01100100 and the mask octet is 10000000, so ANDing them gives 00000000, which is why the third octet drops to 0. Exam questions like this one go past the mask: they hand you an address and a prefix and expect the whole range. Cisco's 2026 exam topics for CCNA v2.0 still include troubleshooting IPv4 address configuration, assignment and subnetting for public and private ranges, so expect more questions that follow the same pattern.

Input Mask Network First host Last host Broadcast Usable
192.168.1.130/26 255.255.255.192 192.168.1.128 192.168.1.129 192.168.1.190 192.168.1.191 62
10.67.100.0/17 255.255.128.0 10.67.0.0 10.67.0.1 10.67.127.254 10.67.127.255 32,766
172.16.37.10/20 255.255.240.0 172.16.32.0 172.16.32.1 172.16.47.254 172.16.47.255 4,094
10.50.100.75/22 255.255.252.0 10.50.100.0 10.50.100.1 10.50.103.254 10.50.103.255 1,022

Apply the same method to the /20 row. The mask 255.255.240.0 gives a block size of 16 in the third octet. Since 37 rounds down to 32 and the fourth octet resets to 0, the network is 172.16.32.0, and the next block starts at 48, so the broadcast is 172.16.47.255. Notice that the range spans every third-octet value from 32 to 47, so the last usable host is 172.16.47.254, not an address inside 172.16.32.x.

Equal sizes keep the math tidy, but a network with 100 sales devices and a two-device firewall link needs something more flexible.

How Do You Split One Network Into Different-Sized Subnets With VLSM?

VLSM — variable-length subnet masking, which gives each subnet only the prefix its host count needs — works by sizing every requirement before you allocate any addresses. Calculate each subnet's prefix with the host method, sort the subnets from biggest to smallest and place each one at the next free address that is a multiple of its block size. Placing big blocks first keeps small ones from splitting the space a big block needs.

Take 192.168.50.0/24 with four needs: 100 sales devices, 50 office devices, 20 lab devices and one point-to-point link to a firewall. You calculate a subnet mask for each need separately, then place the blocks largest first.

Need Hosts + 2 Block Prefix and mask Network Usable range Broadcast
Sales, 100 hosts 102 128 /25, 255.255.255.128 192.168.50.0 .1 to .126 192.168.50.127
Office, 50 hosts 52 64 /26, 255.255.255.192 192.168.50.128 .129 to .190 192.168.50.191
Lab, 20 hosts 22 32 /27, 255.255.255.224 192.168.50.192 .193 to .222 192.168.50.223
Firewall link, 2 hosts 4 4 /30, 255.255.255.252 192.168.50.224 .225 to .226 192.168.50.227
Spare for growth None yet 28 addresses /30, /29 and /28 192.168.50.228, .232 and .240 Free Free

Order matters because every block must begin on a multiple of its own size. If the 20-host lab took 192.168.50.0/27 first, the 100-host /25 could only start at .128, and only smaller pieces could use addresses .32 to .127.

On private ranges like this one, waste only costs future room. On public space it costs money. Across 596 IPv4 transactions in the first half of 2026, the reported average price was $20.04 per address, according to a July 2026 CircleID analysis by the founder of the IPv4.Center marketplace. At that average, an idle /25 of 128 public addresses represents roughly $2,565.

For the firewall link, a /31 such as 192.168.50.224/31 would use just two addresses if both devices support it. One thing I always check after a VLSM plan is overlap. This one-line Python check does it for the four blocks above:

python3 -c "import ipaddress as i, itertools as t; nets=[i.ip_network(x) for x in ['192.168.50.0/25','192.168.50.128/26','192.168.50.192/27','192.168.50.224/30']]; print([(str(a),str(b)) for a,b in t.combinations(nets,2) if a.overlaps(b)] or 'no overlaps')"
# prints: no overlaps

That /31 option raises a fair question: why subtract two at all, and when does that rule stop applying?

Why Do You Subtract 2 From the Host Count, and When Don't You?

In a normal IPv4 subnet, the all-zeros host address names the network and the all-ones host address is the broadcast, so neither can go to a device. That is why usable hosts equal 2 to the power of the host bits, minus 2. The rule breaks in three places: /31 point-to-point links, /32 single-host routes, and cloud subnets, where providers reserve four or five addresses.

RFC 3021, the IETF standard for 31-bit prefixes from December 2000, says that devices on a point-to-point link with a 31-bit mask must treat both addresses as host addresses. A /31 therefore gives you two usable addresses and wastes none. A /32 describes a single address, which you meet in host routes, loopback interfaces and firewall rules that target one machine.

Cloud subnets sit at the other extreme, with more reserved addresses than the classic rule, as the host-count section showed. Check your platform's reserved count before you calculate a subnet mask for a cloud network.

Does IPv6 subnetting work the same way?

Not quite. IPv6 has no broadcast address, and nearly every LAN subnet is a /64, the exact size Azure requires for IPv6 subnets, according to its Virtual Network FAQ. With 64 host bits per subnet, the question shifts from counting hosts to planning prefixes: a /56 holds 256 of those /64 subnets, and a /48 holds 65,536.

That planning is no longer a niche skill. According to an April 2026 Internet Society Pulse report, native IPv6 access to Google services passed 50% for the first time on 28 March 2026, reaching 50.10% that day. Dual-stack networks — which run IPv4 and IPv6 side by side — now need both kinds of plan, and our beginner's guide to IPv6 addresses and prefixes covers the IPv6 side. With the rules and exceptions in hand, the last step is checking your numbers before they reach a router.

How Can You Check Your Subnet Math in Seconds?

Check every subnet mask calculation with a second method before you configure anything. Our subnet calculator shows the network, broadcast, usable range and private-range status for any IPv4 prefix, Python's built-in ipaddress module does the same in one line, and Linux tools such as ipcalc print the values in a terminal. If two methods disagree, recheck the interesting octet first, because that is where errors usually hide.

A similar one-liner covers the /17 question; on Windows, type py or python instead of python3.

python3 -c "import ipaddress as i; n=i.ip_network('10.67.100.0/17', strict=False); print(n, n.netmask, n.broadcast_address, n.network_address+1, n.broadcast_address-1)"
# prints: 10.67.0.0/17 255.255.128.0 10.67.127.255 10.67.0.1 10.67.127.254

The strict=False flag matters. Without it, Python stops with the error "has host bits set", because 10.67.100.0 is not the network address of a /17, which is the same trap the practice question sets.

Six mistakes that break subnet math

  • →Treating the given address as the network address, as in the 10.67.100.0/17 question.
  • →Forgetting to reset the later octets to 0 for the network and to 255 for the broadcast.
  • →Forgetting the two reserved addresses, or subtracting only 2 in a cloud that reserves 4 or 5.
  • →Leaving out the router when you count the devices a subnet must hold.
  • →Rounding hosts down instead of up to the nearest power of two.
  • →Overlapping VLSM blocks because a block did not start on a multiple of its own size.

Subnetting practice questions

  • →Q1. What are the network and broadcast addresses for 192.168.5.77/28?
  • →Q2. Which mask fits 300 hosts?
  • →Q3. How many usable hosts does a /21 hold?
  • →Q4. What are the network and broadcast addresses for 10.10.200.5/19?
  • →Q5. What are the network and broadcast addresses for 10.200.33.7/12?
  • →Q6. What is the first usable host for 172.27.103.132 with mask 255.255.255.128?
  • →Q7. Do 192.168.1.60 and 192.168.1.70 share the same /26?

Answers I checked in Python

  • →A1. Network 192.168.5.64, broadcast 192.168.5.79, hosts .65 to .78, 14 usable.
  • →A2. 302 rounds up to 512, so a /23, 255.255.254.0, with 510 usable.
  • →A3. 2 to the 11th, minus 2, equals 2,046.
  • →A4. Block size 32 in the third octet: network 10.10.192.0, broadcast 10.10.223.255.
  • →A5. Block size 16 in the second octet: network 10.192.0.0, broadcast 10.207.255.255.
  • →A6. The network is 172.27.103.128, so the first usable host is 172.27.103.129.
  • →A7. No: .60 sits in 192.168.1.0/26 and .70 in 192.168.1.64/26.

Get the prefix right first, and every other number in a subnet falls into place.

You can calculate a subnet mask from three starting points — a prefix, a host count or a subnet count — but never from an IP address alone. Convert prefixes with the octet values, size host subnets by adding 2 and rounding up to a power of two, and borrow bits when you need a set number of equal subnets. Then use the block size to find each network, broadcast and usable range, and allocate the largest block first when sizes differ.

Keep the exceptions in view: a /31 link uses both addresses, a /32 is one host, and AWS, Azure and Google Cloud reserve four or five addresses in each subnet's main range. Once a subnet exists, our guide to how DHCP assigns IP addresses explains how devices get theirs, and our step-by-step look at the DNS resolution process shows how they then find each other by name.

Before you configure anything, paste every block of your plan into the overlap checker below and confirm that none of them collide.

Check Your Subnet Plan for Overlaps

Paste your CIDR blocks and the checker compares every pair, flags identical, contained or adjacent blocks, merges the list into the smallest covering set and marks any gaps.

Advertisement

Frequently Asked Questions

Q How do you calculate a subnet mask?

A
To calculate a subnet mask, start from the prefix length or the number of hosts you need. For a prefix, write that many 1 bits and convert each octet to decimal, so /26 becomes 255.255.255.192. For hosts, add 2, round up to the nearest power of two and find its exponent: 50 hosts need 64 addresses (2⁶), so 32 − 6 gives a /26.

Q Can you find a subnet mask from an IP address alone?

A
No. An address such as 10.20.30.40 could belong to a /8, a /24 or a /28, so to calculate a subnet mask you also need the prefix length or a requirement such as a host count. Old Class A, B and C defaults only guessed the mask from the first octet, and RFC 4632 calls that classful system legacy.

Q What subnet mask do I need for 50 hosts?

A
Add 2 for the network and broadcast addresses to get 52, then round up to the nearest power of two, 64. That is 2 to the 6th, so you need 6 host bits and a /26 prefix, which is 255.255.255.192 with 62 usable addresses, one of them for your router. In AWS or Azure, add 5 instead of 2, which still fits 50 hosts in a /26.

Q How do you find the network and broadcast address of a subnet?

A
Find the octet where the mask stops being 255 and subtract its value from 256 to get the block size. Round the address's value in that octet down to a multiple of the block size and set any later octets to 0: that is the network address. The broadcast is one less than the next block, with later octets at 255, and usable hosts lie between them.

Q What is the first possible host IP for the 10.67.100.0/17 network?

A
The first possible host IP is 10.67.0.1. A /17 mask is 255.255.128.0, so the block size in the third octet is 128, and 100 rounds down to 0. That makes the network 10.67.0.0, the broadcast 10.67.127.255 and the last usable host 10.67.127.254, with 32,766 usable addresses. The given address, 10.67.100.0, is a host, not the network.

Q Why do you subtract 2 when counting usable hosts?

A
In a normal IPv4 subnet, the all-zeros host address identifies the network and the all-ones address is the broadcast, so neither can go to a device. The exceptions are /31 point-to-point links, where RFC 3021 makes both addresses usable, /32 single-host routes, and cloud subnets, where AWS and Azure reserve five addresses and Google Cloud reserves four in each main range.

Q How many bits do you borrow for a set number of subnets?

A
To calculate a subnet mask for a set number of subnets, borrow the smallest number of bits, s, where 2 to the power of s covers the subnets you need, then add s to the original prefix. Splitting 192.168.10.0/24 into 6 subnets takes 3 bits and gives 8 subnets, so each becomes a /27 with mask 255.255.255.224 and 30 usable hosts.
Robert Harrison
Verified Content Expert

Robert Harrison

OSINT & Network Utility Expert

Robert Harrison is a network infrastructure specialist and OSINT researcher based in Boston, Massachusetts, with over 18 years of experience in DNS architecture, port security, and network reconnaissance. At Trust My IP, he leads the technical utility layer — building and documenting diagnostic tools and publishing hands-on guides for DNS troubleshooting, port scanning, SSL analysis, and open-source intelligence methodology. His work is grounded in systems administration and network engineering experience that predates most of the security frameworks in use today.

Helpful Insight?

Share with your professional network