Azure NAT Gateway for specific subnet or VMs but not all

mpls 80 Reputation points
2024-03-07T23:54:03.87+00:00

Good Day,

We are wanting to tie a specific public IP that we have as a resource in our Resource Group for egress access. Our AVD hosts are the target for this. These AVD hosts though are part of a bigger Virtual Network that includes many other resources that we do not want to affect with this. When I am in the process of creating this NAT Gateway and choose the virtual network, there does not seem to be a way to only select the subnet with that vnet. Are we stuck and we have to look at either giving each AVD host (only 4 so far) a public IP each, A Load Balancer which comes with the disclaimer (port allocation need to be declared upfront).

My question boils down to can we just apply Nat Gateway to 1 /24 subnet of the larger virtual network?

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,498 questions
Azure Virtual Desktop
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,567 questions
Azure NAT Gateway
Azure NAT Gateway
NAT Gateway is a fully managed service that securely routes internet traffic from a private virtual network with enterprise-grade performance and low latency.
37 questions
0 comments No comments
{count} votes

Accepted answer
  1. TP 97,996 Reputation points
    2024-03-08T00:32:34.5966667+00:00

    Hi,

    My question boils down to can we just apply Nat Gateway to 1 /24 subnet of the larger virtual network?

    A: Yes. You can choose which subnets are associated with the NAT Gateway. You must have it associated with at least one subnet, but can choose multiple subnets if you want. During creation it asks you to select the Virtual Network and then you must choose which subnet(s) you want associated.

    In addition, after your NAT Gateway has been created you can click on the Subnets blade and make changes.

    qna nat gateway choose subnets

    Please click Accept Answer and upvote if the above was helpful.

    Thanks.

    -TP

    1 person found this answer helpful.

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.