Azure virtual network enables Azure resources to communicate with each other in Azure network and with external resources through internet. Azure virtual network is like your traditional local area network in datacenter. Azure virtual networks can be connected with another virtual network in Azure and with your On-premises datacenter as well. Azure virtual network supports private ip addressing and subnetting as you do in your on-premises network. Azure virtual network supports subnets within a virtual network, the number of subnets can be defined based on the virtual network class and size of each subnets, and it is as same as VLAN in your traditional network. By default, subnets within virtual network can talk to each other without establishing any connection. Once a virtual network created, multiple address spaces can be added based on your need. While doing this entire exercise, please make sure that any ip address or ip addresses range is not overlapping with each other neither across your Azure virtual networks nor with on-premises network.
Let me show you, how to set up virtual networks step by step. To start login to Azure portal.
In Azure portal, select “+ Create a resource” à“Networking” à “Virtual network”.
Look at the details required to create a virtual network.
Name: Name of the virtual network, it should be unique in your Azure environment.
Address space: Define address space based on your requirement.
Subscription: Select your subscription.
Resource: Either create a new one or use existing resource group.
Location: Select location to create this virtual network resource, It will selected automatically if you are using existing resource group.
Subnet: Define the name of the subnet.
Address range: Define the address range for this subnet.
Service endpoints: Define the service endpoints, by default it is disable.
Look at the below screenshots for filled details. Once filled all the required details, click on “Create” to deploy a virtual network.
Once deployed successfully, you can find this virtual network in your resources.
Select “Subnets” to look at/verify your existing subnet. Click on “+ Subnet” to create a new subnet in your existing virtual network.
Enter the name of the subnet and then enter the address range for this subnet. As we had used 172.26.0.0/20 (172.26.0.0 – 172.26.15.255), therefore the next range will start from 172.26.16.0, You can specify the new range based on your need.
Once filled the required details, select “OK” to deploy a new subnet in your existing virtual network.
Once deployed successfully, you can see both your subnets here.
Go to the Address space, if you would like to add a new address space in your virtual network.
Add the address space based on your requirement. (Example: Many organization uses different – different set of ip address ranges for different types of networks. Very simple example is Corporate and Perimeter network.) Once entered the range, click on “Save”.
Once added the address space successfully, define the subnet in that address space.
In connected device panel, you can see the devices that are using ip address from this virtual network.
In subnet panel, you can define multiple subnets based on your define address ranges.
In DNS panel, you can define the custom DNS server addresses based your network design. By default, it uses Azure-provided DNS server.
In peering panel, you can define peering between two virtual networks that belongs to the same region.
In Service endpoints panel, you can specify services endpoints based on your requirement. In general, you don’t have to define any thing here.
In properties panel, you can see the properties of your virtual network, such as resource id, location, resource group etc.
In Locks, you panel you can define the locks for your resources by defining lock type either “delete” or “read-only”.
In the Automation script panel, you can view the temple of this deployment and you also get an option for download, add to library and deploy.
In the diagram panel, you get the graphical representation of all the subnets and associated resources.
I hope, this step by step blog post helped you to create your virtual network and subnets in Microsoft Azure. To know more about the networking features such as Gateway subnet, peering etc., read the next blog post.