How to Set Static Private IP Address for Azure Virtual Machine

Table of Contents

A virtual machine (VM) is automatically assigned a private IP address from a range that you specify. This range is based on the subnet in which the VM is deployed. Assign a static IP address to the VM if you want a specific IP address in the subnet.

if you change IP address in machine directly, Azure network will not be aware of that IP address. That can disrupt your access to virtual machine over virtual machine public IP.

How to Set Static Private IP Address for Azure Virtual Machine

Set static private IP address from Azure portal

1. From the vm blade, select Networking tab then select the Network Interface for this VM.

How to Set Static Private IP Address for Azure Virtual Machine

2. In the NIC configurations blade, select IP configurations. You can see the private IP address of the VM, select on it.

How to Set Static Private IP Address for Azure Virtual Machine

3. Under Assignment, change from Dynamic to Static then save the change.

How to Set Static Private IP Address for Azure Virtual Machine

Assign static private IP for VM

After set assignment is Static in the Azure portal, the IP address inside the VM when you connect using RDP remote desktop still remain in dynamic.

How to Set Static Private IP Address for Azure Virtual Machine

4. Run command ipconfig /all to get all information of the NIC. Take note:

  • IPv4 Address
  • Subnet Mask
  • Default Gateway
  • DNS Server

Note

DNS Server is very important, in next step, if the DNS server sets incorrectly, you’ll lose the connection to your VM.

How to Set Static Private IP Address for Azure Virtual Machine

5. Now, change the IP of your VM with the static IP address that you configured in the Azure portal.

How to Set Static Private IP Address for Azure Virtual Machine

Leave a Comment

Required fields are marked *