Azure – Networking – Part 2 – Azure Virtual Network (Vnet)
Let’s continue with Azure Networking. As said in my last article, I am going into explore each component in details level. Today in this article we will discuss on Azure Virtual network (Vnet). If you have missed our last articles, please check it in following links.
Next Article : Part 3 – Subnet in Azure
An Azure Virtual Network (VNet) is a representation of our own network in the cloud. It is a logical isolation of the Azure cloud dedicated to your subscription.It provides following benefits.
- Bring our own networks.
- Allow to create subnets with our private IP addresses.
- Bring our own DNS or use Azure – Provided DNS.
- Secure with Network Security Group ACLs.
- Control traffic flow with User Defined Routes.
Create New Azure Virtual Network Using Azure Portal:
1. Connect to your Azure portal dashboard using your subscription account. If you don’t have any subscription, in that case you can get trial Azure subscription with one-month of validity. Then you can connect to the azure portal dashboard as in following figure.
2. On the left side menu of the screen, select Create a resource > Networking > Virtual network. In Create virtual network page, enter or select the information like Name, Subscription, Resource Group, Location, Subnet – Name ( currently I have set the default one), Subnet – Address range. Here I have set the default address range for Subnet .
One more important information need to be set. One is Virtual Network address space . One should think and planed well before creating the V-Net. It Specifies the number of the IPs provided by the virtual network. There is a calculation on this by considering teh IP mask. By default the Vnet Address space is 10. 1.0.0/16. This means, the first two section is fixed and the Vnet will provide the address between 10.1.0.0 to 10.1.256.256 (65536 addresses). And later we will see how can we divide the total address among multiple Subnets.
Following image shown an example of V-Net with only 256 Addresses.
Following image shown an example of V-Net with only 65536 Addresses.
3. Leave the rest of the value as defaults and select Create button as shown in the above image. It will take couple of seconds to create the Virtual Network as shown in the following image.
Create New Azure Virtual Network Using Power Shell :
In the above example we have covered, how to create Virtual Network through Azure Portal. Now we will create a virtual network using Power Shell in a different resource group.. So let’s create a new resource group in a different region for the new VNet.
Before we proceed to use the power shell , Open Cloud Shell in our browser or Click the Cloud Shell button on the menu in the upper right of the Azure portal as shown in the following figure. Those modules are pre-installed and easy to use. We can also install and use PowerShell locally .
Now once we are ready with powershell editor let’s first create a new resource group with New-AzureRmResourceGroup and then Create a virtual network with New-AzureRmVirtualNetwork. the following example creates a new virtual network named ManasVirtualNetwork in the EastUS location:
New-AzureRmResourceGroup -Name ManasRG -Location EastUS $ManasvirtualNetwork = New-AzureRmVirtualNetwork -ResourceGroupName ManasRG -Location EastUS -Name ManasVirtualNetwork -AddressPrefix 126.96.36.199/16
Create a virtual network using the Azure CLI :
Now we will create Azure Virtual Network using Azure CLI. Before we proceed to use the Azure CLI , Open Cloud Shell in our browser or Click the Cloud Shell button on the menu in the upper right of the Azure portal as shown in the above figure 6. Those modules are pre-installed and easy to use. We can also install and use Azure CLI locally .
Let’s create a resource group to host the virtual network if not exists yet. Create a resource group with az group create and Create a virtual network with az network vnet create. Following scrip is doing all the magic as we can see in the following figures.
az group create --name ManasRG2 --location eastus az network vnet create --name ManasVNetCLI --resource-group ManasRG2 --subnet-name default
In upcoming articles , we will discuss more on the best practices, to configure/planning Azure networking topology. The next article of this series is Azure – Networking – Part 3 – Subnet in Azure .
Thanks for reading 🙂
Keep reading, share your thoughts, experiences. Feel free to contact us to discuss more. If you have any suggestion / feedback / doubt, you are most welcome.
Stay tuned on Knowledge-Junction, will come up with more such articles.