You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/load-balancer/configure-inbound-NAT-rules-vm-scale-set.md
+32-25Lines changed: 32 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,22 +9,20 @@ ms.date: 12/06/2022
9
9
ms.custom: template-how-to
10
10
---
11
11
12
-
# Configure Inbound NAT Rules for Virtual Machine Scale Sets
12
+
# Configure inbound NAT Rules for Virtual Machine Scale Sets
13
13
14
-
In this article you'll learn how to configure, update, and delete inbound NAT Rules for Virtual Machine Scale Set instances. Azure offers two options for inbound NAT rules. The first option is the ability to add a single inbound NAT rule to a single backend resource. The second option is the ability to create a group of inbound NAT rules for a backend pool. Additional information on the various options is provided [here](inbound-nat-rules.md). It's recommended to use the second option for inbound NAT rules when using Virtual Machine Scale Sets, since this option provides better flexibility and scalability.
14
+
In this article, you'll learn how to configure, update, and delete inbound NAT Rules for Virtual Machine Scale Set instances. Azure offers two options for inbound NAT rules. The first option is the ability to add a single inbound NAT rule to a single backend resource. The second option is the ability to create a group of inbound NAT rules for a backend pool. It's recommended to use the second option for inbound NAT rules when using Virtual Machine Scale Sets, since this option provides better flexibility and scalability. Learn more about the various options for [inbound NAT rules](inbound-nat-rules.md).
15
15
16
16
## Prerequisites
17
17
18
-
- A standard SKU [Azure Load Balancer](quickstart-load-balancer-standard-public-portal.md) in the same subscription as the Virtual Machine Scale Set.
18
+
- A Standard SKU [Azure Load Balancer](quickstart-load-balancer-standard-public-portal.md) in the same subscription as the Virtual Machine Scale Set.
19
19
- A [Virtual Machine Scale Set instance](configure-vm-scale-set-portal.md) in the backend pool of the load balancer.
20
20
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
21
21
22
22
## Add inbound NAT rules
23
23
Individual inbound NAT rules can't be added to a Virtual Machine Scale Set. However, you can add a set of inbound NAT rules with a defined front-end port range and back-end port for all instances in the Virtual Machine Scale Set.
24
24
25
-
To add a whole set of inbound NAT rules for the Virtual Machine Scale Sets, first create an inbound NAT rule in the load balancer that targets a backend pool.
26
-
27
-
The new inbound NAT rule shouldn't have an overlapping front-end port range with existing inbound NAT rules. To view existing inbound NAT rules that are set up, use this [CLI command](/cli/azure/network/lb/inbound-nat-rule):
25
+
To add a set of inbound NAT rules for the Virtual Machine Scale Sets, you create a set of inbound NAT rules in the load balancer that targets a backend pool using [az network lb inbound-nat-rule create](/cli/azure/network/lb/inbound-nat-rule#az-network-lb-inbound-nat-rule-create) as follows:
28
26
29
27
```azurecli
30
28
@@ -41,32 +39,19 @@ The new inbound NAT rule shouldn't have an overlapping front-end port range with
41
39
42
40
```
43
41
44
-
## Update inbound NAT rules
45
-
When using inbound NAT rules with Virtual Machine Scale Sets, Individual inbound NAT rules can't be updated. However, you can update a set of inbound NAT rules that target a backend pool.
46
-
47
-
```azurecli
48
-
49
-
az network lb inbound-nat-rule update \
50
-
--resource-group MyResourceGroup \
51
-
--name MyNatPool \
52
-
--lb-name MyLb \
53
-
--frontend-port-range-start 150 \
54
-
--frontend-port-range-end 250
55
-
56
-
```
57
-
## Delete inbound NAT rules
58
-
59
-
When using inbound NAT rules with Virtual Machine Scale Sets, Individual inbound NAT rules can't be deleted. However, you can delete the entire set of inbound NAT rules by deleting the inbound NAT rule that targets a specific backend pool.
42
+
The new inbound NAT rule can't have an overlapping front-end port range with existing inbound NAT rules. To view existing inbound NAT rules that are set up, use [az network lb inbound-nat-rule show](/cli/azure/network/lb/inbound-nat-rule#az-network-lb-inbound-nat-rule-show) as follows:
## Add multiple inbound NAT rules behind a Virtual Machine Scale Set
68
53
69
-
Multiple inbound NAT rules can be attached to a single Virtual Machine Scale Set, given that the rules frontend port ranges aren’t overlapping. This is accomplished by having multiple inbound NAT rules that target the same backend pool. A full example using the CLI is shown below:
54
+
Multiple sets of inbound NAT rules can be attached to a single Virtual Machine Scale Set, given that the rules frontend port ranges aren’t overlapping. This is accomplished by having multiple sets of inbound NAT rules that target the same backend pool as follows:
70
55
71
56
```azurecli
72
57
az network lb inbound-nat-rule create \
@@ -91,6 +76,28 @@ az network lb inbound-nat-rule create \
91
76
--backend-pool-name mybackend \
92
77
--frontend-ip-name MyFrontendIp
93
78
79
+
```
80
+
## Update inbound NAT rules
81
+
When using inbound NAT rules with Virtual Machine Scale Sets, Individual inbound NAT rules can't be updated. However, you can update a set of inbound NAT rules that target a backend pool using [az network lb inbound-nat-rule update](/cli/azure/network/lb/inbound-nat-rule#az-network-lb-inbound-nat-rule-update) as follows:
82
+
83
+
```azurecli
84
+
85
+
az network lb inbound-nat-rule update \
86
+
--resource-group MyResourceGroup \
87
+
--name MyNatRule \
88
+
--lb-name MyLb \
89
+
--frontend-port-range-start 150 \
90
+
--frontend-port-range-end 250
91
+
92
+
```
93
+
## Delete inbound NAT rules
94
+
95
+
When using inbound NAT rules with Virtual Machine Scale Sets, individual inbound NAT rules can't be deleted. However, you can delete the entire set of inbound NAT rules by deleting the inbound NAT rule that targets a specific backend pool. Use [az network lb inbound-nat-rule delete](/cli/azure/network/lb/inbound-nat-rule#az-network-lb-inbound-nat-rule-delete) to delete a set of rules:
0 commit comments