In this tutorial, we’re going to deploy two virtual machines on a single virtual network and configure them to allow one virtual machine to ping the other within the network—we will be testing to confirm their connection.
PREREQUISITE
- Working computer
- Internet connection
- Microsoft Azure account + active subscription
PROCEDURE
CREATE A VIRTUAL NETWORK
Open the Azure portal and type “Virtual network” in the search bar at the top. Click on “Virtual networks” under services as seen in the image below.
On the Virtual networks service webpage that loads, click on the “Create” or “Create virtual network” button as you deem fit.
You will be directed to the “Basics” page.
The first part of the “Basics” page is the “Project details” section where you are asked to select the subscription and resource group under which you want to create the virtual network.
Create a new resource group by clicking on “Create new” and entering a suitable name for the new resource group.
The next section is “Instance details” where you can input a virtual network name of choice and select a region.
Afterwards, click on “IP addresses”.
On that page, click on “Delete address space” to delete the current IPv4 address space.
Click on the “Add IPv4 address space” button.
Change the new address space to 10.1.0.0/16.
Click on “Add a subnet”
Leave everything as default and click on the “Add” button.
Click “Review + create”.
When a notification depicting Validation passed is displayed, click on the “Create” button to deploy the virtual network.
CREATE VIRTUAL MACHINES
After the deployment is complete, click on the “Go to resource” button.
Click on the menu and select “Virtual machines”.
Click on the “Create” button and then click on “Azure virtual machine” on the pop-up menu.
You will be directed to the “Basics” page.
The first part of the “Basics” page is the “Project details” section.
Select your subscription and the resource group created earlier.
The next section is “Instance details” where you are to input a VM name of choice.
Under “Image”, select “Windows Server 2019 Datacenter - ×64 Gen2”.
Scrolling down, we get to “Administrator account” section where you are required to provide a username and password.
This will be used to log in to the account so, keep a record or use a password you won’t forget.
At the “Inbound port rules” section, select “Allow selected ports” under “Public inbound ports” and select “RDP (3389)” from the drop-down list provided when you click on the box for “Select inbound ports”.
Since this is just a trial, we would be leaving most of the settings as default and skip to only those that need to be attended to personally.
Scroll back to the top and click on “Networking”.
Make sure that the VM is placed on the previously created vNet and subnet.
Click on “Review + create.
After successful validation, click on the “Create” button. There will be a pop-up at the top right showing the status of the deployment.
You will be directed to a “CreateVm” page which goes through several phases that you might need to be patient for.
After successful deployment, repeat the process to create a second VM with a different name and public IP address.
TEST CONNECTION
Open the first VM.
On the resource page, click on “Connect”.
Click on the “Download RDP file”.
Load the downloaded file and click on “Connect” on the window that pops up.
Input your username and password in the next window and affirm.
You should have a Windows VM running on your computer right about now.
Click on the start menu and type “Firewall” in the search bar.
Open “Windows Defender Firewall”.
Click on “Turn Windows Defender Firewall on or off”.
Turn off Windows Defender Firewall under both private and public network settings.
Click “OK”.
Repeat these steps for the second VM.
Head back to the first VM.
Click on the start menu and type “PowerShell” in the search bar.
Open “Windows PowerShell”.
Type in a command in this format:
ping nameofsecondvm
. That is, “ping vMdemo2
” in this case.
As can be seen, the second VM was successfully pinged from the first VM indicating a connection between them.
Top comments (0)