Public and Private IP on same VM NIC

Michael Cook 21 Reputation points
2022-07-16T18:18:30.367+00:00

If I need users to access a server app on my VM from the WAN, and also need that same VM to be accessed from another VM on my Azure Vnet, can I (or should I) create a static public IP and assign it to the same NIC with the private internal IP? When I create and assign the public static IP to the NIC will it simply replace the already assigned private IP on that NIIC, or let me create two?

Thank you.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,041 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andreas Baumgarten 123.7K Reputation points MVP Volunteer Moderator
    2022-07-16T18:44:45.627+00:00

    Hi @Michael Cook ,

    you could bind multiple public IPs and multiple private IPs to the same NIC of an Azure VM.
    Just add another IP config on your NIC.

    221472-image.png

    Just for better understanding:
    You wrote "access from the WAN". Does this mean from on-premises network over internet? Or does it mean from a local on-premises network via VPN S2S connection?

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. risolis 8,741 Reputation points
    2022-07-16T18:48:37.063+00:00

    Hello @Michael Cook

    Thank you for your post.

    As per your description, I would like to gather the next observation stated below as well as a couple of pictures:

    221462-image.png

    As it was shown above, I have no PIP(Public IP) but I can either create a new one or use an existing one provisioned before. I move the the toggle bottom to static on the private IP settings so, I can keep the same IP address given via DHCP.

    221482-image.png

    Just a friendly reminder, You might need to permit traffic from Internet to your existing NIC by using NSG(Network security Group).

    I hope that was relevant to keep going with your task.

    Have a good one.

    Cheers,

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.