Skip to content

Commit 0bc1db4

Browse files
author
Michael Bender
committed
Additional CLI updates
1 parent 84a8a71 commit 0bc1db4

File tree

1 file changed

+32
-25
lines changed

1 file changed

+32
-25
lines changed

articles/load-balancer/configure-inbound-NAT-rules-vm-scale-set.md

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,20 @@ ms.date: 12/06/2022
99
ms.custom: template-how-to
1010
---
1111

12-
# Configure Inbound NAT Rules for Virtual Machine Scale Sets
12+
# Configure inbound NAT Rules for Virtual Machine Scale Sets
1313

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).
1515

1616
## Prerequisites
1717

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.
1919
- A [Virtual Machine Scale Set instance](configure-vm-scale-set-portal.md) in the backend pool of the load balancer.
2020
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
2121

2222
## Add inbound NAT rules
2323
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.
2424

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:
2826

2927
```azurecli
3028
@@ -41,32 +39,19 @@ The new inbound NAT rule shouldn't have an overlapping front-end port range with
4139
4240
```
4341

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:
6043

6144
```azurecli
6245
63-
az network lb inbound-nat-rule delete --resourcegroup MyResourceGroup --name MyNatRule --lb-name MyLb
46+
az network lb inbound-nat-rule show \
47+
--lb-name <load-balancer-name> \
48+
--name <nat-rule-name> \
49+
--resource-group <resource-group-name>
6450
6551
```
66-
6752
## Add multiple inbound NAT rules behind a Virtual Machine Scale Set
6853

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:
7055

7156
```azurecli
7257
az network lb inbound-nat-rule create \
@@ -91,6 +76,28 @@ az network lb inbound-nat-rule create \
9176
--backend-pool-name mybackend \
9277
--frontend-ip-name MyFrontendIp
9378
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:
96+
97+
```azurecli
98+
99+
az network lb inbound-nat-rule delete --resourcegroup MyResourceGroup --name MyNatRule --lb-name MyLb
100+
94101
```
95102

96103
## Next steps

0 commit comments

Comments
 (0)