Soru

Zorluk: KolayCreate and Configure Virtual Networks and Subnets

An administrator is configuring a virtual network named `vnet-prod` in a resource group named `rg-prod`. The virtual network is assigned the address space of 172.16.0.0/16172.16.0.0/16. The administrator needs to create a new subnet to host a database cluster that requires a minimum of 1212 usable IP addresses. Which of the following is the smallest subnet mask that meets this requirement in Azure?

  1. /27Cevap
  2. B
    /28
  3. C
    /29
  4. D
    /26

Cevap

The correct subnet mask is /27 because it is the smallest prefix that provides at least 12 usable IP addresses after accounting for the 5 IP addresses reserved by Azure.
The correct subnet mask is /27. A /27/27 subnet has 3232 total IP addresses. Azure always reserves the first four and the last IP addresses in any subnet (a total of 55 addresses). Therefore, a /27/27 subnet provides 325=2732 - 5 = 27 usable IP addresses, which is sufficient to meet the requirement of 1212 hosts. A /28/28 subnet only provides 1111 usable IP addresses (165=1116 - 5 = 11), which is not enough, making /27 the smallest viable subnet mask.

Adım Adım Çözüm

1
Determine the number of usable IP addresses required.
The requirement is 1212 usable IP addresses.
To host the database cluster, the subnet must support at least 1212 hosts.
2
Account for Azure's reserved IP addresses.
Add 55 to the required host count: 12+5=1712 + 5 = 17 total IP addresses needed.
Azure reserves the first four IP addresses and the last IP address of every subnet, making them unavailable for resource assignment.
3
Find the smallest subnet size that accommodates the total needed IP addresses.
A /27/27 subnet provides 3232 total IP addresses (2(3227)=322^{(32-27)} = 32), which is the smallest power of 2 greater than or equal to 1717.
A /28/28 subnet only provides 1616 total IP addresses (which results in 1111 usable addresses), while a /27/27 subnet provides 3232 total IP addresses (resulting in 2727 usable addresses).

Anahtar Kavram

Azure Virtual Network Subnet IP Allocation and Reservations
Bu soruyu puanla