Microsoft Learn

Virtual Networks: Addressing

This article delves into the crucial aspect of addressing within Azure Virtual Networks (VNet). Proper IP addressing is fundamental for enabling communication between your Azure resources and between your Azure VNet and on-premises networks.

Understanding IP Addressing in Azure VNets

An Azure VNet provides a representation of your private network in the cloud. You define a private IP address space for your VNet, which can include one or more Classless Inter-Domain Routing (CIDR) blocks. These blocks dictate the range of IP addresses that can be assigned to resources within that VNet.

Key Concepts:

CIDR Notation Explained

CIDR notation is a method for representing IP addresses and their associated network prefixes. It's typically written as an IP address followed by a slash and a number, such as 192.168.1.0/24. The number after the slash indicates the number of bits used for the network portion of the IP address. A /24 means the first 24 bits define the network, leaving 8 bits for host addresses, allowing for 256 addresses (though two are reserved).

Address Allocation and Reservations

Azure reserves the first four and the last IP address of every subnet for its own use. This means that for a subnet with a /24 prefix (256 addresses), only 253 are available for your resources.

Designing Your VNet Address Space

When designing your VNet address space, consider the following:

Example Scenario

Consider a VNet with the address space 10.1.0.0/16. This provides a total of 65,536 IP addresses. You could then define subnets within this space:

Subnet Name Address Range (CIDR) Available IPs
Frontend 10.1.1.0/24 253
Backend 10.1.2.0/24 253
Database 10.1.3.0/27 30
Best Practice: For maximum flexibility, start with a larger VNet address space than you initially think you'll need. Overlapping IP address spaces between on-premises and cloud networks is a common pitfall.

Next Steps

Understanding VNet addressing is the first step. The next logical step is to learn about configuring subnets and managing IP address assignments for your Azure resources.