Azure VNets

Alberto De Natale
4 min readDec 16, 2019

--

Azure VNets allow Azure resources to communicate with each other, with other devices connected to the internet or with other on-premises networks.

In this article, I will look at how to get started with using them.

IAAS, Infrastructure as a Service

IAAS is an acronym for Infrastructure as a Service and may be defined as:

An instant computing infrastructure, provisioned and managed over the internet (..) it quickly scales up and down with demand, letting you pay only for what you use.

Infrastructure as a Service then enables a company to quickly get the infrastructure they need without no upfront investment nor maintenance costs.

It is similar to renting a car using PCP compared to buying one upfront.

Address Spaces

When creating a VNET, you will be prompted to provide the address space that you want to use.

An address space is needed in order to have a pool of IP addresses that may be assigned to devices connected with a VNET.

Each address assigned to a device will be made of two sections, namely the network section and the host section.

The “slash notation” is used to differentiate the network section from the host section. An example may be: 192.168.100.14/24

Recalling that each IP address is made of 32 bits and 4 numbers, each number taking 8 bits, the network section of 192.168.100.14/24 would be 192.168.100.0.

One of the first things to do is to choose a network ID, not only for one application or your current project but for the whole enterprise. It needs to cover future projects too.

Subnets

VNETs can be segmented in Subnets.

A device connected to a subnet may communicate with a device connected to a different subnet as far as they are on the same VNET.

The “slash notation” allows segmenting a VNET further. For instance if I wanted to take out two subnets of 8 addresses each from the VNET 192.168.100.0/24, I would use the following notations:

  • Subnet 1: 192.168.100.0/29 (.0, .1, .2, …, .7)
  • Subnet 2: 192.168.100.8/29 (.8, .9, .10, …, .15)

A useful reference to check is:

Each subnet comes with 5 IP addresses reserved by Azure. In the examples above only 3 IPv4 addresses would be available for use.

Create in the portal

Search for the product

Add The Address Space

When creating a new VNet and inserting the address space, one may need to be careful it does not overlap the space already in use in some other VNet.

I will change that in:

Add a Subnet

Add Standard Properties

As usual, you will be asked for Location, Name, Resource Group, Subscription.

Other Options

Other options not covered in this article are:

  • Add an IPv6 address space
  • DDoS protection
  • Firewall

Create a VNet using C#

Creating a VNet using C# may be done through the “Microsoft.Azure.Management.Network.Fluent” library. An example on how to do that may be found at:

Summary

In this article, I looked at the basic concepts needed to get started with VNets.

I hope that will help you thank you for reading.

--

--

Alberto De Natale
Alberto De Natale

Written by Alberto De Natale

Alberto De Natale is a passionate tech-enthusiast software developer.

No responses yet