Multiple public ips azure with seperate inbound rules

Andrew Martin 1 Reputation point
2020-05-27T22:49:34.183+00:00

I have a virtual machine running in azure which i have recently added a second public ip to. Both the primary and secondary ip are associated to one nic on the vm. I would like to create seperate inbound rules per public ip however, as it appears any rule i make to one public ip, copies to the other. The reason to split up is because an external source ip will be communicating with both of the public ip's dependant on a service, can anyone share if its feasible to split out rules?9

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,160 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Stephane Budo 426 Reputation points
    2020-05-27T22:57:14.613+00:00

    Hi Andrew,

    When you create your NSG rule, have you tried to set the "destination" IP to the specific public IP you are targeting?
    If this doesn't work at the NIC level, try to apply it at the subnet level (NSG).

    Cheers,
    Stephane


  2. Stephane Budo 426 Reputation points
    2020-05-28T01:55:41.41+00:00

    So, I think the best way to achieve this would be to: - Assign two private IPs on the NIC, with a separate public IP associated with each private IP (see first screenshot below). - From there, you can create your NSG rules targeting the private IP in the destination. What ports or sources won't matter because you are targeting destination IP (see second screenshot with an example of NSG) In the NSG example below, any source would be able to access HTTPS on each IPs separately. You can change these rules with other ports or specific IPs in the sources. Note that the NSGs does not "direct" traffic, but instead allow or block traffic based on a set of conditions that are evaluated sequentially. The traffic is directed to one interface or the other based on the NAT used with the associated public IP address. IP Configuration example ![8791-nsg1.png][1] NSG rules example ![8763-nsg2.png][2] [1]: /api/attachments/8791-nsg1.png?platform=QnA [2]: /api/attachments/8763-nsg2.png?platform=QnA

    0 comments No comments