DEV Community

Cover image for Creating an Azure Virtual Network with Multiple Subnets
George Epebifie
George Epebifie

Posted on

Creating an Azure Virtual Network with Multiple Subnets

One of the key feature of networking is the ability to connect multiple machines together to share resources and, in some cases, to act as a way to even out the workload or traffic within a network infrastructure. Creating an Azure Virtual Network (VNet) with multiple subnets gives us the advantage of logically isolating different components of a defined network infrastructure, providing flexibility and security.
Today In this blog post we will consider creating an Azure Virtual Network with four subnets using the address space 192.148.30.0/26.

I’ll be your guide as we take a step by step journey through this virtual walk. Come with me.

Why Use Azure Virtual Networks?

Azure Virtual Networks offer several advantages:

  1. Isolation: with Subnets within a Virtual Network you can decide to isolate different tiers of your application or infrastructure, such as front-end, back-end, and database tiers.

  2. Security: Based on security needs within an organisation, you can decide to apply Network Security Groups (NSGs) to subnets to control inbound and outbound traffic, enhancing security.

  3. Connectivity Options: When it comes to virtual networks, there is wide range of connectivity options open to an organisation. This is due to the fact that virtual networks support connectivity to on-premises networks, other virtual networks, and the internet, providing flexibility in network design.

  4. Scalability: Virtual Networks permits either horizontal or vertical scaling, as such you can scale up as your application grows, accommodating additional resources and expanding to multiple regions if needed.

Prerequisites
Before we begin, ensure you have:

  • An Azure subscription. If you don't have one, you can create a free account.
  • Basic familiarity with Azure Portal and networking concepts.
  • A plan for subnet allocation within the address space 192.148.30.0/26.

Step 1 Sign in to Azure Portal:

Step 2 Create a Virtual Network:

  • from the Azure portal home page Click on Virtual network.

Image description

  • in the virtual networks default page Click on +Create.

Image description

  • Fill in the required details:
    • Subscription: Choose your subscription.
    • Resource group: Create a new one or select an existing resource group.
    • Name: Enter a name for your VNet, e.g., MyVNet.
    • Region: Choose the Azure region where you want to deploy the VNet.

Image description

  • Click on Next and Next again to get to the IP Addresses Tab

Image description

  • Address space: Enter 192.148.30.0/26 as the address space.The image below shows that we can have 64 addresses within this network.

Image description

if you noticed our IP Address tab is showing signs of an error because we are yet to configure our subnets. so the next step for us now is to configure our subnet.

Step 3 Configure Subnets:

  • Let us first of all delete the Default subnet.

Image description
look at the bottom right hand corner of your screen, you should see a Delete icon. click on it Image description
to delete the default subnet.

Now that we have deleted the default subnet let us do one more thing and that is specifying the names that we will use for our four subnets. for the tutorial let us use 'frontend', 'backend', 'management', and then 'database'. Okay we can continue...

  • just immediately after the area where we added the address space click on + Add Subnet.

Image description

  • Name: Specify the name FrontEnd for the first subnet

  • Address range: Assign a portion of the Virtual Network's address
    space to each subnet. For our first subnet FrontEnd:
    192.148.30.0/28 (16 IP addresses).

Image description

  • Repeat this step three more times to create four subnets with the
    following details:

    BackEnd: 192.148.30.16/28 (16 IP addresses)
    Management: 192.148.30.32/28 (16 IP addresses)
    Database: 192.148.30.48/28 (16 IP addresses)
    

Ensure the subnet address ranges do not overlap and fit within the
VNet's address space.

Step 4 Review and Create:

  • Review your configuration settings.
  • Click Review + create

Image description

if all the settings are in order the way you have planned it, then Click on Create to provision the Virtual Network and subnets.

Image description

Step 5 Verification:

Once the virtual network and its subnets have been provisioned the next step is to verify its creation.

Image description

  - Click **go to Resources** it will take you to the home page of 
    the virtual network you created.

  - Click **settings** on your left pane of your screen, a list of of 
   menus will appear.

  - Click **subnets** to see a list of of the subnets you created on 
   the right side of the screen.
Enter fullscreen mode Exit fullscreen mode

Image description

Bravo! we have successfully created and deployed an Azure Virtual Network with four subnets given the address space 192.148.30.0/26.

In conclusion, we can appreciate that creating an Azure Virtual Network with multiple subnets using the address space 192.148.30.0/26 provides a robust foundation for deploying and managing your Azure resources. By following the steps outlined in this guide, you can efficiently organize and secure your network infrastructure while leveraging Azure's scalability and connectivity options. Whether you're building a small-scale application or a complex enterprise solution, Azure Virtual Networks offer the flexibility and control needed to meet your networking requirements effectively.

Top comments (1)