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
@@ -279,8 +279,7 @@ az network nat gateway create \
279
279
--resource-group test-rg \
280
280
--name nat-gateway \
281
281
--public-ip-addresses public-ip-nat \
282
-
--idle-timeout 10
283
-
282
+
--idle-timeout 4
284
283
```
285
284
286
285
Use [az network vnet subnet update](/cli/azure/network/vnet/subnet#az-network-vnet-subnet-update) to associate the NAT gateway with your virtual network subnet.
@@ -304,7 +303,7 @@ az network public-ip prefix create \
304
303
--length 29 \
305
304
--resource-group test-rg \
306
305
--location eastus2 \
307
-
--name myPublicIPprefix-NAT
306
+
--name public-ip-prefix-nat
308
307
```
309
308
310
309
Use [az network nat gateway create](/cli/azure/network/nat/gateway#az-network-nat-gateway-create) to create a NAT gateway resource and associate the public IP prefix that you created.
@@ -313,7 +312,7 @@ Use [az network nat gateway create](/cli/azure/network/nat/gateway#az-network-na
313
312
az network nat gateway create \
314
313
--resource-group test-rg \
315
314
--name nat-gateway \
316
-
--public-ip-prefixes myPublicIPprefix-NAT \
315
+
--public-ip-prefixes public-ip-prefix-nat \
317
316
--idle-timeout 10
318
317
319
318
```
@@ -422,6 +421,9 @@ You can now associate the NAT gateway with a different subnet or virtual network
Use [Set-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/set-azvirtualnetworksubnetconfig) to remove the NAT gateway association from the subnet by setting the value to $null. Use [Set-AzVirtualNetwork](/powershell/module/az.network/set-azvirtualnetwork) to update the virtual network configuration.
@@ -732,14 +748,14 @@ Complete the following steps to add or remove a public IP prefix from a NAT gate
732
748
733
749
To add a public IP prefix to the NAT gateway, add it to an array object along with the current IP prefixes. The PowerShell cmdlets replace all the IP prefixes.
734
750
735
-
In this example, the existing public IP prefix associated with the NAT gateway is named *myPublicIPprefix-NAT*. Replace this value with an array that contains both myPublicIPprefix-NAT and a new IP address prefix. If you have multiple IP prefixes already configured, you must also add them to the array.
751
+
In this example, the existing public IP prefix associated with the NAT gateway is named *public-ip-prefix-nat*. Replace this value with an array that contains both public-ip-prefix-nat and a new IP address prefix. If you have multiple IP prefixes already configured, you must also add them to the array.
736
752
737
753
Use [New-AzPublicIpPrefix](/powershell/module/az.network/new-azpublicipprefix) to create a new public IP prefix for the NAT gateway.
738
754
739
755
```azurepowershell
740
756
## Create public IP prefix for NAT gateway ##
741
757
$ip = @{
742
-
Name = 'myPublicIPPrefix-NAT2'
758
+
Name = 'public-ip-prefix-nat2'
743
759
ResourceGroupName = 'test-rg'
744
760
Location = 'eastus2'
745
761
Sku = 'Standard'
@@ -760,14 +776,14 @@ $nat = Get-AzNatGateway @ng
760
776
761
777
## Place the existing public IP prefix associated with the NAT gateway into a variable. ##
762
778
$ip = @{
763
-
Name = 'myPublicIPprefix-NAT'
779
+
Name = 'public-ip-prefix-nat'
764
780
ResourceGroupName = 'test-rg'
765
781
}
766
782
$prefixIP1 = Get-AzPublicIPPrefix @ip
767
783
768
784
## Place the public IP prefix you created previously into a variable. ##
769
785
$ip = @{
770
-
Name = 'myPublicIPprefix-NAT2'
786
+
Name = 'public-ip-prefix-nat2'
771
787
ResourceGroupName = 'test-rg'
772
788
}
773
789
$prefixIP2 = Get-AzPublicIPprefix @ip
@@ -785,7 +801,7 @@ Set-AzNatGateway @nt
785
801
786
802
### Remove public IP prefix
787
803
788
-
To remove a public IP prefix from a NAT gateway, create an array object that *doesn't* contain the IP address prefix that you want to remove. For example, you have a NAT gateway configured with two public IP prefixes. You want to remove one of the IP prefixes. The IP prefixes associated with the NAT gateway are named myPublicIPprefix-NAT and myPublicIPprefix-NAT2. To remove myPublicIPprefix-NAT2, create an array object for the PowerShell command that contains *only*myPublicIPprefix-NAT. When you apply the command, the array is reapplied to the NAT gateway, and myPublicIPprefix-NAT is the only prefix associated.
804
+
To remove a public IP prefix from a NAT gateway, create an array object that *doesn't* contain the IP address prefix that you want to remove. For example, you have a NAT gateway configured with two public IP prefixes. You want to remove one of the IP prefixes. The IP prefixes associated with the NAT gateway are named public-ip-prefix-nat and public-ip-prefix-nat2. To remove public-ip-prefix-nat2, create an array object for the PowerShell command that contains *only*public-ip-prefix-nat. When you apply the command, the array is reapplied to the NAT gateway, and public-ip-prefix-nat is the only prefix associated.
789
805
790
806
Use the [Set-AzNatGateway](/powershell/module/az.network/set-aznatgateway) cmdlet to remove a public IP prefix from the NAT gateway.
791
807
@@ -799,14 +815,14 @@ $nat = Get-AzNatGateway @ng
799
815
800
816
## Place the existing public IP prefix associated with the NAT gateway into a variable. ##
801
817
$ip = @{
802
-
Name = 'myPublicIPprefix-NAT'
818
+
Name = 'public-ip-prefix-nat'
803
819
ResourceGroupName = 'test-rg'
804
820
}
805
821
$prefixIP1 = Get-AzPublicIPPrefix @ip
806
822
807
823
## Place the secondary public IP prefix into a variable. ##
808
824
$ip = @{
809
-
Name = 'myPublicIPprefix-NAT2'
825
+
Name = 'public-ip-prefix-nat2'
810
826
ResourceGroupName = 'test-rg'
811
827
}
812
828
$prefixIP2 = Get-AzPublicIPprefix @ip
@@ -826,7 +842,7 @@ Set-AzNatGateway @nt
826
842
827
843
### Add public IP prefix
828
844
829
-
In this example, the existing public IP prefix associated with the NAT gateway is named *myPublicIPprefix-NAT*.
845
+
In this example, the existing public IP prefix associated with the NAT gateway is named *public-ip-prefix-nat*.
830
846
831
847
Use [az network public-ip prefix create](/cli/azure/network/public-ip/prefix#az-network-public-ip-prefix-create) to create a public IP prefix for the NAT gateway.
832
848
@@ -835,7 +851,7 @@ az network public-ip prefix create \
835
851
--length 29 \
836
852
--resource-group test-rg \
837
853
--location eastus2 \
838
-
--name myPublicIPprefix-NAT2
854
+
--name public-ip-prefix-nat2
839
855
```
840
856
841
857
Use [az network nat gateway update](/cli/azure/network/nat/gateway#az-network-nat-gateway-update) to add the public IP prefix that you created to the NAT gateway. The Azure CLI command replaces values. It doesn't add a value. To add the new IP address prefix to the NAT gateway, you must also include any other IP prefixes associated to the NAT gateway.
@@ -844,18 +860,18 @@ Use [az network nat gateway update](/cli/azure/network/nat/gateway#az-network-na
Use [az network nat gateway update](/cli/azure/network/nat/gateway#az-network-nat-gateway-update) to remove a public IP prefix from the NAT gateway. The Azure CLI command replaces the values. It doesn't remove a value. To remove a public IP prefix, include any prefix in the command that you wish to keep. Omit the one you want to remove. For example, you have a NAT gateway configured with two public IP prefixes. You want to remove one of the prefixes. The IP prefixes associated with the NAT gateway are named myPublicIPprefix-NAT and myPublicIPprefix-NAT2. To remove myPublicIPprefix-NAT2, omit the name of the IP prefix from the command. The command reapplies the IP prefixes listed in the command to the NAT gateway. It removes any IP address not listed.
868
+
Use [az network nat gateway update](/cli/azure/network/nat/gateway#az-network-nat-gateway-update) to remove a public IP prefix from the NAT gateway. The Azure CLI command replaces the values. It doesn't remove a value. To remove a public IP prefix, include any prefix in the command that you wish to keep. Omit the one you want to remove. For example, you have a NAT gateway configured with two public IP prefixes. You want to remove one of the prefixes. The IP prefixes associated with the NAT gateway are named public-ip-prefix-nat and public-ip-prefix-nat2. To remove public-ip-prefix-nat2, omit the name of the IP prefix from the command. The command reapplies the IP prefixes listed in the command to the NAT gateway. It removes any IP address not listed.
0 commit comments