Azure NSG rules both for both public and private IPs

Jose Cintron 60 Reputation points
2024-08-29T21:57:05.1766667+00:00

Can I apply a public IP to a vm and have it not affect the nsg rules that I have for it's private IPs? I have current nsg rules for the private IP but i want to add a public IP and apply nsg rules to it as well. I will be limiting access to it from certain public IPs. Also, will adding a separate public IP affect the current waf rules that i have for it's private ip address?

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,491 questions
Azure Web Application Firewall
{count} votes

1 answer

Sort by: Most helpful
  1. Rohith Vinnakota 915 Reputation points Microsoft Vendor
    2024-08-30T05:36:13.0666667+00:00

    Hi Jose Cintron,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    • Yes, you can assign a public IP address to a VM, and this action will not impact the existing NSG rules applied to the VM’s private IP address and public IP does not alter these rules.
    • This allows you to restrict access to the VM based on the public IP address, such as allowing traffic only from certain public IP addresses.
    • Adding the new public IP won’t affect the existing WAF rules for the private IP. The current WAF rules for the private IP will stay the same and keep functioning as they are.
    • If you want the WAF to protect the new public IP as well, you’ll need to update its settings to cover the public IP in its monitoring and filtering. This involves adjusting the WAF configuration to handle traffic for the new public IP.

    Additional Information: custom-waf-rules-overview,waf-front-door-custom-rules
    Kindly let us know if the above helps or you need further assistance on this issue.


    If you have any further queries, do let us know. If the answer is helpful, please click "Accept Answer" and "Upvote it."

    0 comments No comments

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.