I’ll present you the right way to design non-public IP addresses on your Azure digital community subnets utilizing easy steps on this information.
Overview
Whenever you design the IP addressing scheme on your Azure Digital Community (vNET) subnets, it should meet the next:
- It can not overlap with some other Azure vNET or the on-premises community.
- Plan for present capability and future development.
Keep in mind that the primary three IP addresses are reserved by default for all Azure subnets. Moreover, all subnets’ first and final IP addresses are additionally reserved for protocol conformance.
The primary handle of a subnet (for instance, 192.168.10.0) is known as the community handle, whereas the final handle (192.168.10.255) is known as the broadcast handle.
For instance, contemplate the CIDR 192.168.10.0/24. The primary IP handle (192.168.10.0) is reserved for protocol conformance. In the meantime, the subsequent three IP addresses – 192.168.10.1, 192.168.10.2, and 192.168.10.3, are reserved for Azure.
Azure makes use of the .1 IP handle because the subnet’s default gateway, whereas the .2 and .3 addresses are DNS addresses.
Within the remaining sections of this information, I’ll clarify the fundamental steps to figuring out a CIDR’s subnet masks and variety of out there IP addresses.
The Fundamentals of IP Addressing
An IP handle has 4 octets, separated by durations. An octet represents 8 bits (11111111). So, 4 octets is:
11111111.11111111.11111111.11111111
Taking this to the subsequent step, every octet equals 255. So, the above values are the identical as:
255.255.255.255
Right here is how we bought the 255:
Counting from left to proper, the primary octet equals 27 (128), the second 26 (64), and so forth. The desk under provides a full breakdown of the eight octets:
| 1 | 27 | 128 |
| 1 | 26 | 64 |
| 1 | 25 | 32 |
| 1 | 24 | 16 |
| 1 | 23 | 8 |
| 1 | 22 | 4 |
| 1 | 21 | 2 |
| 1 | 20 | 1 |
| Whole (32) | Whole (128+64+32+16+8+4+2+1) | 255 |
Equally vital, in the event you sum the 1s within the octets (the binary numbers), you get 32.
11111111.11111111.11111111.11111111
However what’s the relationship between these numbers and an IP handle? Let’s discover out within the following sections.
Calculating Community and Host Handle in a CIDR
Azure subnet IPv4 addresses, like on-premises subnets, are written in a Classless Inter-Domain Routing (CIDR) notation. In CIDR notation, a subnet is split into 2 elements, separated by a “/”.
An instance of a subnet written in CIDR notation is 192.168.10.0/24. The primary a part of the IP handle (“192.168.10.0”) is the community handle.
In the meantime, the second half, “24,” signifies that the primary 24 bits are a part of the community handle, which leaves 8 (32-24) bits for host addresses.
For those who recall, within the final part, I defined that the full bits within the 4 octets of an IP handle—11111111.11111111.11111111.11111111—equals 32.
That is how we arrived at 32-24 to present us 8.
This brings us to the subsequent a part of the calculation: figuring out the subnet masks and the variety of IP addresses out there to be assigned to hosts within the subnet.
Persevering with with our 192.168.10.0/24 instance, the octets will probably be written as proven under:
11111111.11111111.11111111.00000000
This is similar as 255.255.255.0, which is the subnet masks of 192.168.10.0/24.
Every 255 is computed utilizing desk 1.0 above.
The remaining 8 digits are used to compute the IP addresses out there to be assigned to hosts utilizing the components:
2x - 2
the place x is the variety of digits left to compute the IP addresses. Within the CIDR 192.168.10.0/24, it’s 8.
So, the variety of out there IPs are:
28 - 2 = 256 - 2 = 254
As I discussed earlier, the components subtracts 2 as a result of the primary and final IP addresses are reserved.
So, for the subnet 192.168.10.0/24, the subnet masks is 255.255.255.0, and 254 addresses can be found to hosts.
Keep in mind that Azure retains the primary three IP addresses, so you may have 254 – 3 (251) IP addresses that may be assigned to hosts within the Azure subnet.
In abstract, listed below are the steps to find out the subnet masks and the variety of out there IPs in a subnet:
- Write down the CIDR in binary format utilizing the octet notation. For instance, 192.168.10.0/24 signifies that the primary 24 bits will probably be 1, whereas the final 8 will probably be 0s.
11111111.11111111.11111111.00000000
- Compute the subnet masks by changing the community handle octets into decimals utilizing the desk from the final part. Right here is the desk:
| 1 | 27 | 128 |
| 1 | 26 | 64 |
| 1 | 25 | 32 |
| 1 | 24 | 16 |
| 1 | 23 | 8 |
| 1 | 22 | 4 |
| 1 | 21 | 2 |
| 1 | 20 | 1 |
| Whole (128+64+32+16+8+4+2+1) | 255 |
Keep in mind that the above desk is computed from the left to proper of the octets. So, if we convert 11111111.11111111.11111111.00000000 to decimals utilizing the above desk, we get 255.255.255.0.
We compute the worth in locations the place we now have 1, and we don’t the place we now have a 0. So, the primary, second, and third octets have 1s, which is 255.255.255.
Nonetheless, the final octet has all 0s, which provides us 0. Combining 255.255.255. and .0, we get 255.255.255.0
- Laptop the variety of IP addresses out there within the subnet utilizing the components 2x – 2, the place x equals the octets remaining after eradicating the community handle digits.
- Lastly, subtract 3 IP addresses (reserved for Azure) to find out the ultimate variety of IP addresses out there for hosts within the subnet.
Up to now, we now have computed community addresses and host IP addresses from a CIDR. Nonetheless, in some design situations, you could have what number of IP addresses required and want to find out the CIDR.
For instance, what would be the CIDR of 172.16.0.0 that can give me 1,000 host addresses?
Utilizing the components,
2x - 2 = 1000
We will compute the worth of x (the host digits within the octet notation) with this components:
x = ln(1000)/ln (2) = 9.97
Copying ln(1000)/ln (2) to an AI software like ChatGPT, Copilot, or Gemini will compute it for you. Alternatively, open the calculator in your Home windows laptop and allow the scientific function. Then, to laptop ln(1000)/ln (2), enter 1000 and press ln. After that, press the division signal, then enter 2, and press ln. lastly, press the equal signal to compute the consequence.

For those who want a components for this, it’s:
host bits = ln(variety of hosts)/ln (2)
For the reason that host digits need to be an entire quantity, we should approximate 9.97 to 10. So, the CIDR 172.16.0.0/22 will give us 210 – 2 = 1,022 hosts.
I bought 22 by subtracting 10 from 32. 32 is the full variety of digits in 11111111.11111111.11111111.11111111.
To compute the subnet handle, convert the octet under to decimal:
11111111.11111111.11111100.00000000
The primary 22 digits are for community addresses (from 172.16.0.0/22), whereas the final 10 digits are for host addresses. So, the primary and second octets give us 255.255 (see Desk 1.0).
In the meantime, within the third octet, we now have simply the primary 6 digits as 1s – which provides us 27 + 26 + 25 + 24 + 23 + 22 = 128 + 64 + 32 + 16 + 8 + 4 = 252.
Lastly, the final octet is all 0s, so the subnet masks is 255.255.252.0. Subsequently the CIDR is 172.16.0.0/255.255.252.0 or 172.16.0.0/22.
Azure vNET Subnet IP Handle Design Examples
You propose to create an Azure vNET known as CoreServicesVnet with two subnets within the 10.20.10.0 and 10.20.20.0 non-public IP addresses.
The ten.20.10.0 subnet will probably be known as SharedServicesSubnet, whereas 10.20.20.0 will probably be known as DatabaseSubnet.
You anticipate the SharedServicesSubnet subnet to have 500 VMs and DatabaseSubnet 700 VMs. Decide the community handle and host sizes of the subnets.
Let’s begin with the SharedServicesSubnet, the place we anticipate to have 500 VMs. To find out the host bit dimension, use the components:
host bits = ln(variety of hosts)/ln (2)
So, for 500 hots, our host’s bit is:
host bits = ln(500)/ln (2) = 8.9 = 9 (aproximated)
If 9 is the host bit, the community handle bit is 32-9 = 23. Thus, the subnet’s CIDR is 10.20.10.0/23.
Write the 23 bits within the octet notation to find out the subnet masks.
11111111.11111111.11111110.00000000
Primarily based on the above octet illustration, the primary two octets are 255.255. In the meantime, 7 digits are 1s, whereas the final digit is a 0 within the second octet.
7 digits of 1s equals 27 + 26 + 25 + 24 + 23 + 22 + 21 = 128 + 64 + 32 + 16 + 8 + 4 +2 = 254.
So, the subnet masks is 255.255.254.0 (all digits within the final octet are 0s). To find out the precise variety of out there IPs for hosts, use:
29 - 2 = 512 - 2 = 510
So, the CIDR, 10.20.10.0/23 permits for 510 IP addresses for hosts, which will probably be 507 hosts, contemplating that Azure reserves the primary 3 IP addresses.
Particularly, the primary out there IP handle is 10.20.10.4, and the final is 10.20.11.254.
For the DatabaseSubnet (10.20.20.0) that requires 700 IP addresses, the host bit is:
host bits = ln(700)/ln (2) = 9.45 = 10 (aproximated)
So, the community handle bit is 32-10, which is 22. Scripting this in octet notation, we get:
11111111.11111111.11111100.00000000
The subnet masks is 255.255.252.0
252 = 27 + 26 + 25 + 24 + 23 + 22 (11111100). So, the CIDR is 10.20.20.0/22 or 10.20.20.0/255.255.252.0.
The precise variety of IP addresses for hosts is 210 – 2 = 1022. If we account for Azure reserved IPs, we can have 1019 IP addresses, which is sufficient for the 700 VMs we anticipate on this subnet.
The primary IP handle for an Azure VM will probably be 10.20.20.4, whereas the final will probably be 10.20.23.254.
To substantiate that this works, here’s a screenshot of the final stage of making an Azure vNET with these two subnets.

Conclusion
Designing and planning non-public IP addressing for Azure vNET subnets is much like doing the identical activity on your on-premissies community with just a few variations.
The key is studying the right way to compute the community and host subnet parts in CIDR notation. On this information, I walked you thru the simplified steps to finish these duties and I hope you discovered it useful.
Let me know your ideas by responding to the “Was this web page useful?” suggestions request under.
