DEV Community

Ibrahim Bio Abubakar
Ibrahim Bio Abubakar

Posted on

How to Create and Configure Virtual Networks Using Microsoft Azure

This article on virtual networking (VN) is going to be shared in the form of a series, where we shall cover several hands-on exercises to appreciate the idea of virtual networks in Microsoft Azure.

This series will include the following exercises on:

  • How to create and configure virtual networks (which we shall cover in this article).

  • How to create and configure a network security group

  • How to create and configure Azure Firewall

  • How to configure network routing

  • How to create DNS Zones and configure DNS settings

The steps applied in this article are from Microsoft learn

Let's swing into action by learning how to create and configure virtual networks.

Let's assume your organization is migrating a web-based application to Azure, and you've been tasked to put in place the virtual networks and subnets, followed by securely peering the virtual networks.

Outline of Tasks:

  • Create a virtual network.
  • Create a subnet.
  • Configure VNet peering.

Step 1. Sign in to the Azure Portal

Step 2. Search for and select virtual networks

Image - 1

Step 3. Select + Create and complete the configuration of the VN

Image -2

  • Resource Group(RG): Create a resource with a name of your choice and ensure you select it. I'm using DemoRG as my RG for this exercise.
  • Virtual network name: enter app-vnet
  • Region: Select a region closer to you in the drop-down menu. I'm using (Europe)UK South for mine.

Image - 3

Step 4. Select next to be at the IP Address page, then select Add IPv4 address space, and ensure the IP address range is configure to 10.1.0.0 and the size is 16

5

Delete the default address space as shown in step 2 above, then select Add a subnet to create a subnet.

Step 5. In the Add a subnet page, enter the following details

  • Name: frontend
  • IPv4 address range: the one we added above (in step 4) from the drop-down menu 10.1.0.0/16
  • Starting address: 10.1.0.0
  • Size: 24

Select Add to add the frontend subnet to our VN.

Image - 6

We need to repeat the same process above to create another subnet called backend.

However, ensure the Starting address is 10.1.1.0 and the Size is 24 as shown below. Leave all other settings as default, then select Add to add the backend subnet in the VN.

Image - 7

Now select Review + create to create the app-vnet virtual network.

Image - 8

Step 6. We need to create another VN called hub-vnet, which requires only a subnet for the firewall.

We'll repeat the same process from Step 3 to create the second VN.

Image -9

However, at the IP address page, use the default IPv4 address space and proceed to add a subnet.

Image - 10

For the subnet, select Azure Firewall as the Subnet purpose, then ensure the following:

  • IPv4 address range: select the default address space with the range 10.0.0.0/16
  • Starting address: 10.0.1.0.
  • Size: 26 is selected by default.

Leave other configurations as default and select Add.

Image - 11

The next step is to select Review + create

Image 12

Step 7. Since our app-vnet and hub-vnet virtual networks are now ready with their respective configurations, we can peer them using the following steps.

  • Search for and select the app-vnet virtual networks.
  • In the Settings blade, select Peerings.
  • Select + Add a peering between the two virtual networks.
    • Remote peering link name: api-vnet-to-hub
    • Select your subscription
    • Virtual network: select hub-vnet here.
    • Local peering link name: use hub-to-app-vnet.

Leave other settings as their defaults. Select Add to create the virtual network peering.

Image - 13

Finally, once the deployment completes, verify the Peering status is Connected.

Image - 14

Conclusion

Congratulations, we've completed this phase of the virtual network series. The next exercise will be "creating and configuring network security groups".

Top comments (0)