Inbound IP Rules on NSGs when 3rd Octet changes

Matt Suderman 20 Reputation points
2024-03-07T14:38:28.5133333+00:00

We have a series of VMs being accessed by contractors. In order to create some inbound security, we have Inbound RDP rules on the NSG based on IP.

We use xxx.xxx.xxx.0/24 to handle situations where the 4th octet changes from day to day. However, we have one contractor where the 3rd Octet seems to change. I've searched all over and can't find and example of how to handle this situation.

Thanks for any guidance.

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,775 questions
{count} votes

Accepted answer
  1. KapilAnanth-MSFT 49,611 Reputation points Microsoft Employee Moderator
    2024-03-14T13:21:13.3333333+00:00

    @Matt Suderman ,

    Your example is misleading.

    With the below,

    • xxx.226.xx0.0/24, xxx.226.xx3.0/24, xxx.226.xx1.0/24
    • I can see the 3rd Octet changing.
    • For this, you have to specify the NSG rule as xxx.226.0.0/16

    However, with

    • xxx.94.189.158
    • Even the second octet changes (here it is 94)
    • In these cases, you should use xxx.0.0.0/8
    • Or if this is only one IP with a different second octet, you can simply create a new Allow rule with xxx.94.189.158/32 (allow single IP)

    Kindly let us know if this helps or you need further assistance on this issue.

    Thanks,

    Kapil


0 additional answers

Sort by: Most 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.