A Virtual Network (VNet) is a logically isolated network(a network segment intentionally separated from other networks, including the public internet, to improve security and performance by containing threats and controlling traffic flow)in the cloud that lets you securely connect and manage your resources, just like a traditional on-premises network.
Azure Virtual Network provides the fundamental building block for your private network in Azure. This service enables Azure resources like virtual machines (VMs) to securely communicate with each other, the internet, and on-premises networks. Virtual networks deliver the scale, availability, and isolation benefits of Azure infrastructure while maintaining the familiar networking concepts you use in traditional datacenters.
In this article, lets create two virtual networks app-vnet and hub-vnet that simulates a hub and spoke network architecture. The app-vnet will host the application. This virtual network requires two subnets. The frontend subnet will host the web servers. The backend subnet will host the database servers. The hub-vnet only requires a subnet for the firewall. The two virtual networks must be able to communicate with each other securely and privately through virtual network peering. Both virtual networks should be in the same region.
The Microsoft provides multiple ways to create Azure Virtual Networks.
- Using the Azure Portal
- Using Azure PowerShell
- Using the Azure CLI
This tutorial covers using the Azure portal.
Create hub and spoke virtual networks and subnets
1.Login to your Azure portal. https://portal.azure.com
2.In the search Resources, search for virtual network,click enter and select the grayed out virtual machine.
3.Select + Create
4.Complete the configuration of the app-vnet.
- Resource group RG1
- Virtual network name app-vnet
- Region East US
5.Still on the configuration of the app vnet, This virtual network requires two subnets, frontend and backend.
- IPv4 address space(vnet IP address) 10.1.0.0/16
- Subnet name frontend
- Subnet address range 10.1.0.0/24
- Subnet name backend
- Subnet address range 10.1.1.0/24
6.Leave all other settings as their defaults. When finished select “Review + create and wait for the validation to pass
Create the Hub-vnet virtual network configuration. This virtual network has the firewall subnet
1.In your Azure portal, , search for virtual network and select the grayed virtual nerwork.
2.Select + Create
3.Configure the Hub-vnet virtual network. This virtual network has firewall subnet .
- Resource group RG1
- Name hub-vnet
- Region East US
- IPv4 address space 10.0.0.0/16
- Subnet name AzureFirewallSubnet
- Subnet address range 10.0.0.0/26
4.Select Review + Create.After validation is passed select Create
5.Once the deployments are complete, search for and select your ‘virtual networks`
6.Verify your virtual networks and subnets were deployed.
App-vnet Subnets
Hub-vnet firewall subnet
Configure a peer relationship between the virtual networks
Virtual network peering enables you to seamlessly connect two or more Virtual Networks in Azure.
1.Search for and select the app-vnet virtual network.
2.In the Settings blade, select Peerings.
3.Select + Add a peering between the two virtual networks.
4.Configure a peer relationship between the virtual networks
- Remote peering link name app-vnet-to-hub
- Virtual network hub-vnet
- Local virtual network peering link name hub-to-app-vnet
5.Leave all other settings as their defaults. Select “Add” to create the virtual network peering.
6.Once the deployment completes, verify the Peering status is Connected
Top comments (0)