Wednesday 10 July 2024

Brief Introduction of Azure Virtual Network

 

Overview of Azure

Azure is the name of the cloud computing service owned by Microsoft that provides Infrastructure as a Service (IaaS), Platform as a Service (Paas) and Software as a Service (SaaS). Azure’s cloud computing services are network, storage, compute, database, analytics, security, and many more. In this blog, we will only focus on the basics of network services.

What Is Azure Virtual Network?

An Azure Virtual Network (VNet) is a fundamental building block for creating your network within the Microsoft Azure cloud platform.
When it’s created, the services and Virtual Machines within the Azure network interact securely with one another.

Advantages of Using Azure Virtual Network

Some of the foremost advantages of using Microsoft Azure VNet are as follows:

  • It provides an isolated environment for your applications
  • A subnet in a very VNet can access the general public internet by default
  • We can easily direct traffic from resources
  • It is a highly secure network
  • It has high network connectivity
  • It builds sophisticated network topologies in a very simple manner

Moving on, let’s have a glance at the components of Azure VNet.

Elements of Azure Virtual Network

Azure networking components provide a large range of functionalities that may help companies build efficient cloud applications that meet their requirements.

The components of Azure Networking are listed below, and we have explained each of those components in an exceedingly detailed manner:

  1. Subnets
  2. Routing
  3. Network Security Groups

Subnets

Subnets let users segment the virtual network into one or more sub-networks.
These sub-networks may be separated logically, and every subnet consists of a server.
We can further divide a subnet into two types:

  1. Private – Instances can access the web with NAT (Network Address Translation) gateway that’s present within the public subnet.
  2. Public – Instances can directly access the net.

Routing

  • It delivers the information by choosing an appropriate path from source to destination.
  • For each subnet, the virtual network automatically routes traffic and creates a routing table.

Network Security Groups

  • It is a firewall that protects the virtual machine by limiting network traffic.
  • It restricts inbound and outbound network traffic depending upon the destination IP addresses, port, and protocol.

How to Launch an Instance using Azure VNet?

launch

  • First, create a virtual network within the Azure cloud
  • Next, create subnets into each virtual network
  • Now, assign each subnet with the respective instance/Virtual Machine
  • After which you’ll connect the instance/ VM to a relevant Network Security Group
  • Finally, configure the properties within the network security and set policies if required for specific requirement
  • As a result, you’ll be able to launch your instance/ VM on Azure

You can also checkout our detailed blog on  How to create and connect Windows Virtual Machine in Azure

Moving forward, we’ll see an indication on creating an Azure virtual network step-by-step.

Demo: Step-By-Step Demo of Creating Azure  Virtual Network

Step 1 − First, log into your Azure  Portal by browsing to URL (portal.azure.com)

Azure LoginStep 2 − Search Virtual Network in Search resources , services & docs
Virtual Network

Step 3 – Click  on +Create
Create VN

Step 4 − Now, Enter all the required details of basic tab then click on Review + Create

Virtual Network basics Step 5 – Click on Create

Create VNStep 6 – Click on Go to resource to see your created Virtual Network.

VN Created

Virtual Network Overview
Congratulations, you’ve successfully created an Azure Virtual Network.

Getting Familiar with IP Addressing

Before understanding IP Address, we need to learn the binary numbers. If you are not familiar with binary and decimal conversion, look at the brief explanation below.

In the decimal number system, the combinations are made using only the numbers from 0 to 9. In other words, it is the number system with a base of 10 (0 to 9). Similarly, in the Binary Number System base of 2 (0 and 1) is used. Each value in a binary number is made with 2N (‘N’ is the place value that increases from right to left). The below table shows the basic conversion between binary and decimal.

BinaryConversionDecimal
0000x22+0x21+0x200
0010x22+0x21+1×201
0100x22+1×21+0x202
0110x22+1×21+1×203
1001×22+0x21+0x204
1011×22+0x21+1×205

Also Check:  ARM Template.

What is IP Address?

IANA is the Internet Assigned Numbers Authority that manages and assigns the IP address in the world. IP Address identifies each device on a network uniquely. There are currently two IP Adress that is IPv4 and IPv6. An IPv4 address contains a total of 32 binary bits divided into 4 equal octets (8-bit block), whereas IPv6 is written in hexadecimal notation, separated into 8 groups of 16 bits by the colons, thus (8 x 16 = 128) bits in total. We will focus on IPv4 as it is the most used. Each octet of an IP Address is separated by a decimal and ranges from 0 to 255. You will clearly understand the binary number, octets, and IP address formation in the below table.

IP AddressOctet 1Octet 2Octet 3Octet 4
10.2.7.400001010000000100000011100000100
192.124.249.16111000000011111001111100110100001
255.255.140.4011111111111111111000110000101000

There are two different IP address one is private, and the other is public.

  • Private IP is accessed only within a network like a simple school network with a LAN connection.
  • Public IP is accessed globally via the Internet.

The table below shows the Private IP address range assigned by IANA, and the rest are all Public IP address.

Private IP Range
10.0.0.1 – 10.255.255.255
172.16.0.0 – 172.31.255.255
192.168.0.0 – 192.168.255.255

Check Out: Azure Service Bus Pricing

What is IP Subnetting?

Subnetting is the process of dividing a network into many smaller networks. There are 5 classes of IP address and each with a unique purpose. Only the first octet is used for dividing an IP Address into different classes. The table below shows the range of IP address of the 5 classes.

ClassOctet 1 Range (in Binary)Octet 1 Range (in Decimal)
Class A00000000-011111110-126
Class B10000000-10111111128-191
Class C11000000-11011111192-223
Class D11100000-11101111224-239
Class E11110000-11110111240-255

Class D is reserved for multitasking and broadcasting purpose, whereas Class E is reserved for research and development. So both these classes are reserved and can not be used. The below table shows the range of the first octet in an IP address with each class.

Note: The IP address with the first octet as 127 (in decimal) is a loopback address to check the network and address of the machine itself.

An IP address can further be divided into small networks depending on the use and purpose. The above classes are not sufficient for real-life use. Only 5 classes can not hold all the hosts on the same network, and the loss of IP address will be huge. So, the CIDR method was introduced.

CIDR (Classless Inter-Domain Routing)

CIDR is a method for allocating IP Address. Using this method, we can apply a subnet mask to an IP Address. This mask defines the number of bits used as a network, and the host will use the other bits that left. To understand CIDR better, we will decode a simple IP address with a subnet mask.

Suppose 192.168.1.30/28 is an IP address with 28 as the subnet mask. By comparing with IP address classes in the above table, this IP comes under Class C. Now, 24 bits are made of 3 octets, so the network will take four extra bits from the next octet to complete 28 bits. Using 2N(‘N’ is the number of borrowed bits from the host), a total of 16 subnets is formed. After taking the four bits, the last octet is left with only 4 bits that a host will use. Using 2H(‘H’ is the number of host bits left), each subnet will contain a block of 16 IP address. The first and last IP is reserved for network and broadcast in each subnet, so the total number of hosts will be 2H-2(‘H’ is the number of host bits) equals 14.

Although a total of 16 subnets or network are possible for this example, the table below listed the initial 4 subnets that can be formed using 28 as the subnet mask. Each subnet contains a total of 16 IP address, and the number of hosts will be 14 as the other two are reserved for network and broadcast.

After comparing the IP given in the example that is 192.168.1.30/28 with the table below, it is clearly visible that it belongs to the second subnet ranging from 192.168.1.16 to 192.168.1.31.

Note: Every subnet’s first and last address is not allocated to any host as it is reserved for network and broadcast.

SubNetTotal IPNetwork IPBroadcast IPRange of HostsTotal Hosts
116192.168.1.0192.168.1.15192.168.1.1-192.168.1.1414
216192.168.1.16192.168.1.31192.168.1.17-192.168.1.3014
316192.168.1.32192.168.1.47192.168.1.33-192.168.1.4614
416192.168.1.48192.168.1.65192.168.1.49-192.168.1.6414

Check Out:  Azure Bastion.

IP Address in Azure

The two different types of IP Address used and allocated in Azure are Public IP and Private IP.

  • Private – The Private IP address allows communication of resources within the azure resource group. In other words, resources can not access a private IP outside the network. The resources that can be connected using a private address are VM Network Interface, ILB (Internal Load Balancer) and Application Gateway.
  • Public – The Public IP address allows Azure Resources to communicate with public-facing Azure services via the Internet. In other words, resources can access public IP outside the network. Some resources that can be connected using public address are VM Network Interface, Public Facing ILB, Application Gateway, VPN Gateway and Azure Firewall.

IP Allocation

  • Dynamic IP – The default allocation method by which Azure can automatically assign the available and unreserved IP address from the subnet’s address range. Also, the Dynamic IP is not fixed and changes with time.
  • Static IP – This is the custom allocation method to assign the available and unreserved IP address from the subnet’s address range. The Static IP is fixed and does not vary with time.

Also Read: Azure Load Balancer.

Azure Virtual Network

Azure Network is the interlinking and communication of all the Azure Resources in an organization. Networking leads to efficient resource work with better consistency and coordination.

Virtual Networking is the communication between devices, servers, virtual machines over the internet. Similarly, Azure Virtual Network (VNet) is a private network with interconnected Azure Resources like Azure Virtual Machines, Infrastructure and Network. It enables communication between various Azure Resources via the Internet. In a Virtual Network, a continuous block of IP Address is used to create multiple subnet networks.

Azure Virtual Network

Azure Subnet

As we know, the subnet is a part of a network that covers a range of IP Address. In Azure, VNet can be divided into smaller subnets for organizations. When a VNet is created in Azure, the subnet range and topology needs to be specified. In Subnet, the IP Address range will be a subpart from a big block of IP Address used in Virtual Network (VNet). The Virtual Machines and resources in a network will be assigned the IP Address from these subnets.

Azure Network Interface

In Azure, NIC is virtual ethernet cards that help communicate the Virtual Machines present in a network. When a Virtual Machine is created in Azure, the NIC with default settings is automatically created. Also, Network Interface settings in Azure can be customized using command tools like Azure CLI and PowerShell.

Network Security

Azure provides various protection methods for securing a service in a network. I have listed down some of the basic network security tools with a short description.

Network Security Group (NSG)

Network Security Group

The Network Security Group in Azure acts like a firewall at the network level. It filters the traffic passing through Azure Resources in a virtual network. NSG is a group of security rules that defines the priority, source or destination, protocol, direction, port range and action. Using these rules, NSG allows or deny inbound and outbound traffic. The rules for entering traffic inside a resource is also called ‘Ingress‘, and the rules for exiting the traffic or going out of the resource is called ‘Egress‘. When all the rules are created, the NSG can be used in a Virtual Machine that will interact with a network.

Service Endpoints

Azure Service Endpoint

Service Endpoints in Azure provides secure connectivity over the optimized route of the Azure Network. Without needing a public IP address, Service Endpoints allows Private IP address in a VNet to reach the endpoint of an Azure Service. It is simple to set up and improves security for the Azure resources in a network. The services here can be Azure Storage, Azure Database, etc.

Web Application Firewall (WAF)

Web Application Firewall

Web applications are a common target for hackers to steal user information. So, protection from the most common attacks like SQL injection, cross-site scripting, etc., is a must. Web Application Firewall by Azure is a firewall for protecting the web application from these common threats. It provides an easy setup for applying various protection of layers that results in better security management. A user can deploy the WAF with other services like Azure Application Gateway, Azure Content Delivery Network (CDN) and Azure Front Door.

Azure Network Models

Network Models are the representation and methods of connecting multiple networks. In Azure also, Microsoft enables some ways to connect multiple networks. I have listed down some of the most used network models.

VNet Peering

Azure VNet Peering

Virtual Network peering enables to connect the two or more Virtual Networks in Azure. It also allows transferring data between deployment models, Azure Subscriptions, Azure Active Directory Tenants and Azure regions without downtime and failure. The traffic between the peered virtual networks use  Microsoft’s backbone infrastructure and is routed through a private network. Thus, gateways, encryption and public internet are not required.

There are two types of Virtual Network Peering:

  1. Regional VNet Peering – When the two networks needed to peer are in the same region, the peering is called Regional VNet Peering.
  2. Global VNet Peering – When the two networks are from different regions, the peering is called Global VNet Peering.

See MoreVNet Peering in Azure

Virtual WAN (Wide Area Network)

Virtual WAN in Azure allows creating a web of multiple networks that are interconnected to each other. It brings multiple networking, security, and routing functionalities together to provide a new single operational interface.

Virtual WAN

In the above diagram, a Virtual WAN at the centre acts as a single operational hub to manage all the traffic coming from multiple resources in a VNet. Instead of contacting the multiple branches separately, a VNet can contact the central hub to connect with all the branches connected to it.

More Azure Virtual Network Information

Pricing

There is no charge for using Azure VNet; it’s freed from cost. Standard charges are applicable for resources, like Virtual Machines (VMs) and other products. to be told more, see VNet pricing and the Azure pricing calculator

Protecting Resources

Network security may well be defined because the process of protecting resources from unauthorized access or attack by applying controls to network traffic. The goal is to confirm that only legitimate traffic is allowed. Azure includes a sturdy networking infrastructure to support your application and repair connectivity requirements. Network connectivity is feasible between resources located in Azure, between on-premises and Azure hosted resources, and to and from the net and Azure.

Conclusion

Azure Networking allows secure communication between multiple resources in a network. From this blog, we understand the IP Address and created a subnet mask using the CIDR method. Also, we covered the basic Azure Networking topics like VNet (Virtual Network), Azure Subnet, Azure Network Interface, Network Security Group (NSG), Service Endpoints, Web Application Firewall (WAF), VNet Peering and Virtual WAN.

Azure Virtual Network


Azure Virtual Network

The Azure Virtual Network is a logical representation of the network in the cloud. So, by creating an Azure Virtual Network, we can define our private IP address range on Azure, and also deploy different kinds of Azure resources. For Example - Azure virtual machine, App service environment, Integration service environment, etc.

Azure Vnet Capabilities


Isolation and segmentation: To deploy resources such as virtual machines into virtual networks, they will be isolated from other resources. By putting the virtual machine into your virtual network, it cannot be reached from the Internet or other Azure resources unless we enable communication in between. We can also use subnets within virtual networks to further segment our resources within the network.

Communication with the Internet: All resources in a virtual network can communicate outbound to the Internet by default. But it needs to establish an inbound connection from the Internet. We can either use public IP or load balancers.

Current Time 0:00
Duration 18:10
Loaded0.37%
 

Communication with on-premises resources: By establishing either point to site VPN or site to site VPN or Express route, your workloads within Azure virtual network can seamlessly communicate with workloads within our on-premises data center.

There are lots of capabilities within the Azure virtual network that we can use to control the traffic.

Filter network traffic: We can use Network Security Groups, Application Security Group, Azure firewall, or third-party network virtual appliance to filter the traffic coming to the resources in the virtual network.

Route network traffic: We can route the network traffic using the routing tables, we can configure user-defined routes to route all the outbound traffic, let's say via a firewall.

Monitor network traffic: By network security groups and traffic analytics monitoring solution, you'll be able to carry out extensive monitoring on both inbound and outbound communications

Subnet

Subnet plays a vital role because many configurations will be done at a subnet level. It is a range of IP addresses in the VNet. Vnet can be divided into multiple subnets based on different design considerations, for example - we can deploy a virtual machine, App services environment, integration service environment, etc. VMs & PaaS services deployed to subnets n the same VNet and can communicate with each other without any extra configuration. Route tables, NSG, Service endpoints, and policies are configured to the subnets.

Creating Azure Virtual Network and subnets

Step 1: Select your existing resource group, or you can create a new resource group.

Azure Virtual Network

Step 2: After opening your resource group, click on Add then type in Virtual network in the search box. Click on Create.

Azure Virtual Network

Step 3: A new window will appear, where you need to fill the details like - name, address space (e.g., 99.0.0.0/16), Name of the subnet, subnet address space (e.g., 99.0.1.0/24). Leave everything as it is and click on create.

Azure Virtual Network

Step 4: Now, your Vnet is created. Let's add a subnet into it. Click on the subnet, then click on add subnet.

ADVERTISEMENT
ADVERTISEMENT

Azure Virtual Network

Step 5: On the next slider window, give a name to the subnet you want to create, provide the address range (if the address range is currently in use, you cannot change it). Then click on the ok button to create the subnet.