Creating a Virtual Network in Microsoft Azure and Accessing Private VM from Public VM

Creating a Virtual Network in Microsoft Azure and Accessing Private VM from Public VM

In the search bar, type "Virtual network" and select "Virtual network" from the suggested results.

Creating a Virtual Network

Basic

In the "Virtual network" creation page, configure the following settings:

  • Subscription: Choose your desired subscription (e.g., free trial).

  • Resource group: Select an existing resource group or create a new one.

  • Name: Enter a name for your virtual network (e.g., Vnet01).

  • Region: Choose the desired region for your virtual network (e.g., Central India).

Security

  • Leave the default settings for DDOS protection, service endpoint, and firewall unless you have specific requirements.

IP addresses

  • Click on the "+ Subnet" button to add a new subnet.

  • Provide a name for the subnet (e.g., subnet).

  • Specify the address range for the subnet within the IP address range of your virtual network (e.g., 10.0.0.0/24).

  • Configure any additional subnet settings if needed.

Tags

You can leave the Tags for now.

Review & Create

Click on the "Review + create" button

Clicke to create a button

Creating a VM

  1. VM should be Public

  2. Second VM is our Private VM

The steps are very simple, I am attaching Vnet here with this VM

Our First VM is ready now

Now going to create 2nd VM which Private

Accessing VM in the Ubuntu Terminal

chmod 400 pem.key
ssh -i ~/Downloads/pem.key userIP

Now I have access to my Azure VM in Ubuntu Terminal

I am going to ping the private IP of Server02 in Server01, Two subnets in the same virtual network can communicate with each other.

But subnets in different Virtual Networks can't communicate with each other by default but we need to create Vnet peering connection to enable subnets in different Virtual Networks to communicate with each other.

Part 2 (Coming soon) - Peering Connection

Thank you for reading my blog, and I hope you find it informative and inspiring. If you have any feedback or questions, please feel free to reach out.

LinkedIn