DEV Community

Cover image for Create and configure virtual networks
daniel shaibu
daniel shaibu

Posted on • Edited on

Create and configure virtual networks

This exercise walks you through building a simple hub‑and‑spoke network architecture in Azure. You’ll create two virtual networks, configure subnets, and establish secure VNet peering between them.

Scenario
Your organization is migrating a web-based application to Azure. To prepare the environment, you must:

Create two VNets: app‑vnet (spoke) and hub‑vnet (hub)

Add subnets for frontend, backend, and firewall

Peer the VNets so they can communicate privately

Step-by-Step Instructions

  1. Sign in to Azure

ii. In the search bar, type Virtual Networks and open the service.

**

  1. Create the app‑vnet Virtual Network**

  2. Select + Create.

  3. Configure the VNet using the following values:

Property: Value
Resource group: RG1
Virtual network name: app-vnet
Region: East US
IPv4 address space: 10.1.0.0/16


  1. Add the **frontend **subnet:
  • Name: frontend

  • Address range: 10.1.0.0/24

  1. Add the **backend **subnet:
  • Name: backend

  • Address range: 10.1.1.0/24

  1. Leave all other settings at their defaults.

  2. Select Review + create, then Create.

3. Create the hub‑vnet Virtual Network
Repeat the creation process with these values:

Property Value
Resource group: RG1
Name: hub-vnet
Region: East US
IPv4 address space: 10.0.0.0/16
Subnet name: AzureFirewallSubnet
Subnet range: 10.0.0.0/26

Once deployed, verify both VNets and their subnets appear in the Virtual Networks list.


4. Configure VNet Peering
Now connect the two VNets so they can communicate privately.

Open app‑vnet.

In the left menu, select Peerings.

Choose + Add.

Configure the peering:

Property Value
Remote peering link name: app-vnet-to-hub
Virtual network: hub-vnet
Local peering link name: hub-to-app-vnet

  1. Leave all other settings as default.

  2. Select Add.

After deployment, confirm the Peering status shows Connected.

Top comments (0)