HOW TO CREATE AN AZURE VIRTUAL NETWORK WITH MULTIPLE SUBNETS USING SPECIFIED ADDRESS SPACE
Tags: introduction, virtualnetworks, subnetworks
Published: 2024-07-12 15:53:05

**INTRODUCTION**
An Azure Virtual Network is a service that provides the fundamental building block for your private network in Azure. An instance of the service (a virtual network) enables many types of Azure resources to securely communicate with each other, the internet, and on-premises networks. A virtual network is similar to a traditional network that you'd operate in your own datacenter but it brings extra benefits of the Azure infrastructure, such as scale, availability, and isolation which are actually beyond the scope of this write-up.

When a network, big or small is divided or grouped into smaller categories, the smaller categories are called SUBNETS. Subnet is actually SUBNETWORK which means a part of the parent network but in a smaller representation. Network or subnetworks can be virtual as well as on-premise.

The scope of this write-up is to use Azure resources to create virtual networks and create 4 nos of subnetworks from the virtual network, all these using a specified address range of 192.148.30.0/26. Lets start...

**1. LOGIN TO AZURE PORTAL** with your login details, only then can you access the resources needed to carry out this task.

**2.CREATE VIRTUAL NETWORK**
* On the search bar, type virtual machine and select it from the dropdown menu as below

![First Step To Create Virtual Machine](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7or92vx0pi6vfm9vg6sq.jpg)

* Select_ **CREATE**_ or _**CREATE VIRTUAL NETWORK**_ as shown in the image below. any of the routes leads to the same destination

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5vjf2d7b98lnyqdr2sk9.jpg) 

* Under the _**BASIC**_, _**_Project Details_**_
   *Select the desired subscription type (Azure Subscription 1 in this writeup)
   *Create or Select the desired resource group ( INFOTECH for in this writeup)

**_Under Instant Details_**
   *Select the Virtual network unique name (ITEngineering for example)
   *Select the preferred and available region and click NEXT to setup other parameters


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/82pupk26y7pvadzysu9c.jpg)

**_Under IP Addressing Menu,_**
   *Be sure the IP Address is IPv4
   *Edit the address to the address space you want to work with
   *Edit the subnet space too
   *Remember to delete the default subnet, it can be edited to your spec though.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aijxxbbitro6mhdlqf6n.jpg)

At this stage, the configuration for the Virtual Network is completed.

**CREATE THE SUBNETS**
   * After all the steps above, you will have a replica of the image as below, then select ADD A SUBNET.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/78g48nm8yrcza9fztxaz.jpg)

* We are going to create 4 subnets as below

- ITServersupport

- ATMsupport

- POSsupport

- IToperations 

Kindly note that all these units are under IT Engineering

When adding each of the subnets above, set the parameters as below...
* Subnet Purpose - Default
* Name - The Name of the subnetwork that you want to create ie each the 4 departmental names as listed above 
* Be sure to select the version of the IP you want to run, IPv4 in this case.
* Starting address - This is the first IP of the address range you want to use
* Size - This determines how big each subnet will be. I want equal division of the 64 addresses in my address range into the 4 subnets, meaning each subnet has 16 addresses to work with.  
* Leave every other things as default and add.

The images below show the subnet for each of the department. Kindly note the changed names and IP address range.

**Subnet for IT Server Support Unit**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gszp74ipjzgntuo7l1uo.jpg)

** Subnet for ATM Support Unit**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j03tzm0ab0nyla1yd0oc.jpg)

**Subnet for POS Support Unit**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q3zd7q3l5c8mjt36szv0.jpg)

**Subnet for IT Operation Unit**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s971iybwsaw7ym1oa7ha.jpg)

You will observe that the left pane of **ADD SUBNET** increases as we add another subnet for each of the added subnet and the image below shows that the four subnets for the four named units has been added to the configured Virtual Network, the select **REVIEW +CREATE**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ec5dldvr140mb5kjzron.jpg)

At this stage, the Azure validates your parameters. If validation process is successful, it pops up a screen and tells you to  CREATE as below

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/isuv5mw14wx9fwdfakp6.jpg)

* After a while, Azure creates the virtual network as well as the 4 subnets and pops up the screen as below. At this stage, the deployment is successful.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p9hyuvr5yftfv3l7kcfh.jpg)

* Select** GO TO RESOURCE **to have an overview of the just created Virtual Network

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nvg7o935737bpxkru1t1.jpg)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jqtotki2szq5o8i6z3iw.jpg)

* To have an overview of the 4 subnets we just created, go to SETTING, then SUBNET

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/93wqlfr0g6nz50kcobba.jpg)

**CONCLUSION**
Its quite an easy task to create subnets using Azure portals but care should be taken when dealing with the address ranges.
Its worth noting also that so many things can still be done on these virtual subnets like, peering, setting of firewall, creating Network Security Group, Application Security Group, DDoS Protection and all sort. We end here considering the scope of this write-up.

Remember to cleanup unused resources on your Azure portal.

Thanks
Omoniyi, S. A. Precious