DEV Community

Cover image for Step-by-Step Guide to Creating an Azure Virtual Network with Four Subnets
Florence Enenmo
Florence Enenmo

Posted on

Step-by-Step Guide to Creating an Azure Virtual Network with Four Subnets

Creating a virtual network (VNet) with multiple subnets in Azure is essential for organizing and securing your cloud resources. This blog will walk you through creating a VNet with four subnets using the address space 192.148.30.0/26.

Step 1: Understanding the Address Space
The CIDR notation 192.148.30.0/26 means:

Network address: 192.148.30.0
Subnet mask: 255.255.255.192
Total number of IP addresses: 64 (2^6)
We need to divide this address space into four subnets. Each subnet will have a /28 prefix, giving us 16 IP addresses per subnet (2^4).

Step 2: Calculating the Subnets
Here's how we can divide the 192.148.30.0/26 address space into four /28 subnets:

Subnet 1: 192.148.30.0/28

Network address: 192.148.30.0
Broadcast address: 192.148.30.15
Usable IP range: 192.148.30.1 to 192.148.30.14

Subnet 2: 192.148.30.16/28

Network address: 192.148.30.16
Broadcast address: 192.148.30.31
Usable IP range: 192.148.30.17 to 192.148.30.30

Subnet 3: 192.148.30.32/28

Network address: 192.148.30.32
Broadcast address: 192.148.30.47
Usable IP range: 192.148.30.33 to 192.148.30.46

Subnet 4: 192.148.30.48/28

Network address: 192.148.30.48
Broadcast address: 192.148.30.63
Usable IP range: 192.148.30.49 to 192.148.30.62

1. Create the Virtual Network

Log in to the Azure Portal

Open your web browser and go to the Azure Portal.

Image description
Create a New Resource Group

Navigate to Resource groups.

Image description

Click on Create and fill in the required details:

Image description

Resource group name: Give your resource group a name
Region: Select your preferred region
Click Review + create and then Create.
Create the Virtual Network

Image description

Navigate to the Virtual network page
Click on virtual network

Image description
Click on create

Image description

Fill in the required details:
Name: Name of choice
Subscription: Select your subscription
Resource group: MyResourceGroup
Region: Select the same region as your resource group
Click on next until IP addresses"

Image description

2. Configure IP address and Subnets##

Enter the IPV4 address for the virtual network which is 192.148.30.0/26, and from this network, there are going to be 64 addresses. Click on Add a Subnet

Image description

Image description

The subnet address range will be
Subnet-1 :192.148.30.0/28 - 192.148.30.15/28.
Subnet-2 :192.148.30.16/28 - 192.148.30.31/28.
Subnet-3 :192.148.30.32/28 - 192.148.30.47/28.
Subnet-4 :192.148.30.48/28 - 192.148.30.63/28.

Click on review + create

Image description

Click on Create

Image description

When Your deployment is complete, click on Go to resource

Image description

To have a view of the subnets created, click on Settings on the left pane and then on Subnets

Image description

Creating a virtual network (VNet) with multiple subnets is crucial for organizing and securing your Azure resources. Following the steps above, you can set up a VNet with subnets using an address space. VNets help improve organization, enhance security, boost performance, simplify management, and enable seamless connectivity between your on-premises and cloud resources. This setup will make everything neat, secure, and easy to manage, ensuring your cloud infrastructure runs smoothly and efficiently with Azure VNets!

Top comments (0)